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 |
|---|---|---|---|---|---|
jordiclariana/ansible | contrib/inventory/zabbix.py | 86 | 4168 | #!/usr/bin/env python
# (c) 2013, Greg Buehler
#
# 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 ve... | gpl-3.0 |
ferreum/distanceutils | tests/test_workshoplevelinfos.py | 1 | 4185 | import unittest
from distance import WorkshopLevelInfos
from distance.printing import PrintContext
from . import common
from .common import check_exceptions
class Version0Test(unittest.TestCase):
LEVEL_IDS = [469806096, 822049253, 738529116, 753242700, 819617632, 837765551, 895852129, 920857185, 922165443, 9233... | mit |
CLVsol/odoo_addons | clv_medicament_dispensation_mng/clv_professional/__init__.py | 3 | 1428 | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | agpl-3.0 |
vanpact/scipy | scipy/optimize/_basinhopping.py | 50 | 26115 | """
basinhopping: The basinhopping global optimization algorithm
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import cos, sin
import scipy.optimize
import collections
__all__ = ['basinhopping']
class Storage(object):
"""
Class used to store the lowest en... | bsd-3-clause |
seekuoitdc/clubcheckout | workingdemo/basic/3server.py | 1 | 4657 | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import urlparse, pickle, os
p = 'htmlsnips/'
nofile = 'Bud, I can\'t find the file.'
def makePage():
if not os.path.isfile('login.html'):
try:
with open(p+'header.xml', 'r') as h, open(p+'login.xml','r') as i, open(p+'login.h... | mit |
pincopallino93/rdfendpoints | lib/rdflib/plugins/parsers/nquads.py | 20 | 3055 | """
This is a rdflib plugin for parsing NQuad files into Conjunctive
graphs that can be used and queried. The store that backs the graph
*must* be able to handle contexts.
>>> from rdflib import ConjunctiveGraph, URIRef, Namespace
>>> g = ConjunctiveGraph()
>>> data = open("test/nquads.rdflib/example.nquads", "rb")
>>... | apache-2.0 |
IONISx/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/id_manager.py | 189 | 1433 | """
An implementation of IdReader and IdGenerator that manages ids for the SplitMongo storage
mechanism.
"""
from opaque_keys.edx.locator import LocalId, DefinitionLocator
from xmodule.x_module import OpaqueKeyReader, AsideKeyGenerator
from xmodule.modulestore.split_mongo import BlockKey
# TODO: Migrate split_mongo ... | agpl-3.0 |
citrix-openstack-build/heat | heat/openstack/common/rpc/impl_fake.py | 5 | 5870 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 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/LICEN... | apache-2.0 |
indictranstech/ebuy-now-frappe | frappe/website/doctype/web_page/web_page.py | 4 | 8841 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, re, os, json, imp
import requests, requests.exceptions
from frappe.utils import strip_html
from frappe.website.website_generator import WebsiteGenerator
from frappe... | mit |
oscarolar/odoo | addons/account/report/account_general_ledger.py | 183 | 15416 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 CamptoCamp
# Copyright (c) 2006-2010 OpenERP S.A
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all po... | agpl-3.0 |
IssamLaradji/scikit-learn | sklearn/qda.py | 15 | 7139 | """
Quadratic Discriminant Analysis
"""
# Author: Matthieu Perrot <matthieu.perrot@gmail.com>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import BaseEstimator, ClassifierMixin
from .externals.six.moves import xrange
from .utils import check_array, check_X_y
__all__ = ['QDA']
class QDA... | bsd-3-clause |
danielfreeman11/convex-nets | LaunchScripts/ConnectedCompsCalc.py | 1 | 22577 | import numpy as np
import sys
#Usage:
#python thisprog.py threshold numofnetworks
#Will randomly initialize numofnetworks neural networks and train them until the error on a training set is less than threshold
#Will then try to interpolate between these networks while keeping error below that of threshold.
#Will ... | mit |
zsiciarz/variablestars.net | observations/utils.py | 1 | 1279 | import time
def jd_now():
"""
Returns Julian Date at the current moment.
"""
return 2440587.5 + time.time() / 86400.0
def normalize_star_name(name):
"""
Normalize star name with GCVS names, for example: V339 -> V0339.
"""
digits = "123456789"
if name[0] == "V" and name[1] in digi... | mit |
jswope00/griffinx | common/djangoapps/student/roles.py | 15 | 11247 | """
Classes used to model the roles used in the courseware. Each role is responsible for checking membership,
adding users, removing users, and listing members
"""
from abc import ABCMeta, abstractmethod
from django.contrib.auth.models import User
import logging
from student.models import CourseAccessRole
from xmodu... | agpl-3.0 |
bdupharm/sqlalchemy | lib/sqlalchemy/orm/util.py | 2 | 38404 | # orm/util.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import sql, util, event, exc as sa_exc, inspection
from ..sql import expression... | mit |
grimoirelab/perceval | perceval/backends/core/git.py | 1 | 46476 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# 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 ... | gpl-3.0 |
uniteddiversity/mediadrop | mediadrop/model/tests/media_test.py | 7 | 2851 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
atcemgil/notes | HiddenMarkovModel.py | 1 | 8122 | import numpy as np
from notes_utilities import randgen, log_sum_exp, normalize_exp, normalize
class HMM(object):
def __init__(self, pi, A, B):
# p(x_0)
self.pi = pi
# p(x_k|x_{k-1})
self.A = A
# p(y_k|x_{k})
self.B = B
# Number of possible latent states at ea... | mit |
SpoonITCurrency/SpoonITCoin | contrib/pyminer/pyminer.py | 766 | 6434 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
dandygithub/kodi | addons/plugin.audio.dandy.amdm.ru/default.py | 1 | 19076 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Writer (c) 2018, dandy
# Rev. 1.0.0
# Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html
import os
import urllib
import urllib2
import sys
import re
import socket
import json
import xbmc
import xbmcplugin
import xbmcgui
import xbmcaddon
from operator import itemgetter
im... | gpl-3.0 |
ryanGT/sympy | sympy/core/relational.py | 2 | 4080 |
from basic import Basic, C
from sympify import _sympify
from numbers import Number
def Rel(a, b, op):
"""
A handy wrapper around the Relational class.
Rel(a,b, op)
Example:
>>> from sympy import *
>>> x,y = symbols('xy')
>>> Rel(y, x+x**2, '==')
y == x + x**2
"""
return Rela... | bsd-3-clause |
fafaman/django | tests/prefetch_related/test_uuid.py | 291 | 4347 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Flea, House, Person, Pet, Room
class UUIDPrefetchRelated(TestCase):
def test_prefetch_related_from_uuid_model(self):
Pet.objects.create(name='Fifi').people.add(
Person.objects.create(name='Ellen'),
... | bsd-3-clause |
jokey2k/sentry | src/sentry/migrations/0003_auto__add_field_message_group__del_field_groupedmessage_server_name.py | 36 | 4187 | # 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 field 'Message.group'
db.add_column('sentry_message', 'group', self.gf('sentry.db.models.fields.FlexibleF... | bsd-3-clause |
sensysnetworks/uClinux | user/python/Lib/lib-tk/Canvas.py | 4 | 6473 | # This module exports classes for the various canvas item types
# NOTE: This module was an experiment and is now obsolete.
# It's best to use the Tkinter.Canvas class directly.
from Tkinter import Canvas, _cnfmerge, _flatten
class CanvasItem:
def __init__(self, canvas, itemType, *args, **kw):
self.canvas = canva... | gpl-2.0 |
ATIX-AG/ansible | lib/ansible/modules/network/vyos/vyos_logging.py | 38 | 7851 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
yk5/beam | sdks/python/apache_beam/utils/windowed_value_test.py | 16 | 2446 | #
# 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 |
UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/actionlib/msg/_TestRequestFeedback.py | 1 | 2926 | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from actionlib/TestRequestFeedback.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TestRequestFeedback(genpy.Message):
_md5sum = "d41d8cd98f00b204e9800998ecf8427e... | gpl-3.0 |
daviskirk/climatecontrol | climatecontrol/processors.py | 1 | 7460 | """Fragment processors."""
import glob
import logging
import os
from typing import Any, Callable, Iterable, Iterator, Mapping, Sequence, Tuple, Type
from climatecontrol.constants import REMOVED
from climatecontrol.file_loaders import (
FileLoader,
NoCompatibleLoaderFoundError,
iter_load,
load_from_file... | mit |
greedo/flask-oauth2-devices | myservice.py | 2 | 10080 | import OpenSSL
import hmac
import hashlib
from binascii import hexlify
from datetime import datetime, timedelta
from flask import Flask, abort, render_template
from flask import make_response, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask.ext.wtf import Form
from wtforms import StringField, Select... | mit |
gem/oq-hazardlib | openquake/hazardlib/tests/gsim/fukushima_tanaka_1990_test.py | 1 | 1631 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2017 GEM Foundation
#
# OpenQuake 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 Licen... | agpl-3.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/tool/steps/options.py | 44 | 2269 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
YouthAndra/apprtc | src/third_party/httplib2/socks.py | 811 | 18459 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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
... | bsd-3-clause |
sghai/robottelo | robottelo/api/assertions.py | 4 | 2440 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from robottelo.test import AssertApiNotRaisesContextManager
def assert_api_not_raises(expected_exception, callable_obj=None,
expected_value=None, value_handler=None, *args,
**kwargs):
""... | gpl-3.0 |
pombredanne/MOG | nova/api/openstack/compute/images.py | 15 | 7373 | # Copyright 2011 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 requ... | apache-2.0 |
dannyperry571/theapprentice | script.module.unidecode/lib/unidecode/x070.py | 252 | 4693 | data = (
'You ', # 0x00
'Yang ', # 0x01
'Lu ', # 0x02
'Si ', # 0x03
'Jie ', # 0x04
'Ying ', # 0x05
'Du ', # 0x06
'Wang ', # 0x07
'Hui ', # 0x08
'Xie ', # 0x09
'Pan ', # 0x0a
'Shen ', # 0x0b
'Biao ', # 0x0c
'Chan ', # 0x0d
'Mo ', # 0x0e
'Liu ', # 0x0f
'Jian ', # 0x10
'P... | gpl-2.0 |
WilliamWickerson/MLProject | fastNetwork.py | 1 | 7332 | from random import uniform
import numpy
def sigmoidFunction(x):
try:
ret = 1 / (1 + numpy.exp(-x))
except OverflowError:
ret = 0
return ret
def softMax(array):
exp = [numpy.exp(x) for x in array]
return numpy.array([x / sum(exp) for x in exp])
global sigmoid
sigmoid = nump... | mit |
nazo/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_route_table_facts.py | 62 | 4169 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
brianlsharp/MissionPlanner | Lib/threading.py | 44 | 33709 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from collections impo... | gpl-3.0 |
wxgeo/geophar | wxgeometrie/sympy/physics/mechanics/tests/test_kane3.py | 33 | 14636 | import warnings
from sympy.core.compatibility import range
from sympy import evalf, symbols, pi, sin, cos, sqrt, acos, Matrix
from sympy.physics.mechanics import (ReferenceFrame, dynamicsymbols, inertia,
KanesMethod, RigidBody, Point, dot, msubs)
from sympy.utilities.exceptions imp... | gpl-2.0 |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/pipes.py | 82 | 9647 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | mit |
named-data/ndn-atmos | lib/hep_translators/hep_translator/hep2ndn_parser/conf_file_parser.py | 1 | 4345 | #!/usr/bin/env python3
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (c) 2015, Colorado State University.
#
# This file is part of ndn-atmos.
#
# ndn-atmos is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as publish... | gpl-3.0 |
mlperf/training_results_v0.7 | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v4-16/google/trainer/base_runner.py | 3 | 1048 | # Lint as: python2, python3
"""Base class for all jobs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from REDACTED.tensorflow_models.mlperf.models.rough.transformer_lingvo.lingvo import base_runner as lingvo_base_runner
from REDACTED.tensorf... | apache-2.0 |
vipullakhani/mi-instrument | mi/platform/rsn/simulator/oms_values.py | 10 | 7128 | #!/usr/bin/env python
"""
@package ion.agents.platform.rsn.simulator.oms_values
@file ion/agents/platform/rsn/simulator/oms_values.py
@author Carlos Rueda
@brief Platform attribute value generators for the RSN OMS simulator.
"""
__author__ = 'Carlos Rueda'
__license__ = 'Apache 2.0'
import time
import ntplib
... | bsd-2-clause |
elvandy/nltools | nltools/data/adjacency.py | 1 | 34227 | from __future__ import division
'''
This data class is for working with similarity/dissimilarity matrices
'''
__author__ = ["Luke Chang"]
__license__ = "MIT"
import os
import pandas as pd
import numpy as np
import six
from copy import deepcopy
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.mani... | mit |
tmhm/scikit-learn | examples/svm/plot_weighted_samples.py | 188 | 1943 | """
=====================
SVM: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
The sample weighting rescales the C parameter, which means that the classifier
puts more emphasis on getting these points right. The effect might ... | bsd-3-clause |
ubic135/odoo-design | addons/mrp/wizard/change_production_qty.py | 245 | 4852 | # -*- 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 |
solintegra/addons | mrp_project_link/models/project_project.py | 16 | 2484 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program 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... | agpl-3.0 |
themiurgo/csvkit | csvkit/utilities/in2csv.py | 20 | 3537 | #!/usr/bin/env python
from csvkit import convert
from csvkit.cli import CSVKitUtility
class In2CSV(CSVKitUtility):
description = 'Convert common, but less awesome, tabular data formats to CSV.'
epilog='Some command line flags only pertain to specific input formats.'
override_flags = ['f']
def add_arg... | mit |
sjl767/woo | py/tests/grid.py | 1 | 3704 | # encoding: utf-8
# 2013 © Václav Šmilauer <eu@doxos.eu>
import unittest
from minieigen import *
import woo._customConverters
import woo.dem
class TestGridStore(unittest.TestCase):
def setUp(self):
self.gs=woo.dem.GridStore(gridSize=(5,6,7),cellLen=4,denseLock=True,exNumMaps=4)
self.ijk=Vector3i(... | gpl-2.0 |
hazrpg/calibre | src/odf/easyliststyle.py | 95 | 3771 | # -*- coding: utf-8 -*-
# Create a <text:list-style> element from a text string.
# Copyright (C) 2008 J. David Eisenberg
#
# 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 versio... | gpl-3.0 |
nicememory/pie | pyglet/pyglet/font/ttf.py | 3 | 24856 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# 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... | apache-2.0 |
catnet23/PocketMap | pogom/fakePogoApi.py | 32 | 1370 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import struct
from time import time
from .utils import get_args
class FakePogoApi:
def __init__(self, mock):
# Fake a 24 hour auth token.
self._auth_provider = type('', (object,), {
"_ticket_expire": (time() + (3600 * 24))... | agpl-3.0 |
a115027a/Openkore | src/scons-local-2.0.1/SCons/Tool/yacc.py | 61 | 4750 | """SCons.Tool.yacc
Tool-specific initialization for yacc.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
#... | gpl-2.0 |
EkaterinaFedorova/murano-repository | muranorepository/openstack/common/network_utils.py | 57 | 2690 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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.apac... | apache-2.0 |
CelticWebSolutions/Android-Kernel-2.6.35-Nook-Tablet | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
gtko/CouchPotatoServer | libs/apscheduler/events.py | 144 | 2529 | __all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN',
'EVENT_JOBSTORE_ADDED', 'EVENT_JOBSTORE_REMOVED',
'EVENT_JOBSTORE_JOB_ADDED', 'EVENT_JOBSTORE_JOB_REMOVED',
'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED',
'EVENT_ALL', 'SchedulerEvent', 'JobStoreEve... | gpl-3.0 |
motion2015/a3 | lms/djangoapps/course_structure_api/v0/serializers.py | 22 | 2671 | """ Django REST Framework Serializers """
from django.core.urlresolvers import reverse
from rest_framework import serializers
from courseware.courses import course_image_url
class CourseSerializer(serializers.Serializer):
""" Serializer for Courses """
id = serializers.CharField() # pylint: disable=invalid... | agpl-3.0 |
geekboxzone/lollipop_prebuilts_gcc_darwin-x86_mips_mips64el-linux-android-4.9 | share/gdb/python/gdb/command/prompt.py | 120 | 2135 | # Extended prompt.
# Copyright (C) 2011-2014 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 vers... | gpl-2.0 |
aspidites/beets | beetsplug/web/__init__.py | 1 | 3486 | # This file is part of beets.
# Copyright 2011, Adrian Sampson.
#
# 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, ... | mit |
waheedahmed/edx-platform | openedx/core/lib/block_structure/factory.py | 22 | 3260 | """
Module for factory class for BlockStructure objects.
"""
from .block_structure import BlockStructureModulestoreData
class BlockStructureFactory(object):
"""
Factory class for BlockStructure objects.
"""
@classmethod
def create_from_modulestore(cls, root_block_usage_key, modulestore):
"... | agpl-3.0 |
lordappsec/ooni-probe | ooni/utils/onion.py | 5 | 3654 | import string
import subprocess
from distutils.spawn import find_executable
from distutils.version import LooseVersion
from txtorcon.util import find_tor_binary as tx_find_tor_binary
from ooni.settings import config
class TorVersion(LooseVersion):
pass
class OBFSProxyVersion(LooseVersion):
pass
def find... | bsd-2-clause |
sadaszewski/scimd | tables.py | 1 | 4234 | #
# Copyright (C) 2015, Stanislaw Adaszewski
# s.adaszewski@gmail.com
# http://algoholic.eu
#
# License: 2-clause BSD
#
from markdown import Extension
from markdown.blockprocessors import BlockProcessor
from markdown.util import etree
import numpy as np
from collections import defaultdict
import numpy.core.defchararr... | bsd-2-clause |
levilucio/SyVOLT | UMLRT2Kiltera_MM/Properties/from_thesis/HSS3_then2_IsolatedLHS.py | 1 | 2493 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HSS3_then2_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HSS3_then2_IsolatedLHS.
"""
# Flag this instanc... | mit |
daniestevez/gr-satellites | python/pwsat2_submitter.py | 1 | 4853 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Daniel Estevez <daniel@destevez.net>
#
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This contains code taken from
# https://github.com/PW-Sat2/SimpleUploader-radio.pw-sat.pl
# That code is licenced under the foll... | gpl-3.0 |
was4444/chromium.src | tools/polymer/txt_to_polymer_grdp.py | 21 | 2455 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import os
import string
import sys
FILE_TEMPLATE = \
"""<?xml version="1.0" encoding="utf-8"?>
... | bsd-3-clause |
spennihana/h2o-3 | h2o-py/tests/testdir_misc/pyunit_upload_file.py | 8 | 1807 | from __future__ import print_function
from builtins import zip
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def upload_file():
a = h2o.upload_file(pyunit_utils.locate("smalldata/logreg/prostate.csv"))
print(a.describe())
from h2o import H2OFrame
# using list... | apache-2.0 |
defcello/PatchCorral | src/data/synthesizers/rolandfantomxr/PRD.py | 4 | 8165 | ####################################################################################################
# Copyright 2013 John Crawford
#
# This file is part of PatchCorral.
#
# PatchCorral is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-3.0 |
erijo/sunnyportal-py | bin/testclient.py | 1 | 2557 | #!/usr/bin/env python3
# Copyright (c) 2016 Erik Johansson <erik@ejohansson.se>
#
# 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 late... | gpl-3.0 |
CJ8664/servo | tests/wpt/web-platform-tests/webdriver/tests/actions/mouse.py | 5 | 4724 | import pytest
from tests.support.inline import inline
from tests.actions.support.refine import get_events, filter_dict
from tests.support.wait import wait
def link_doc(dest):
content = "<a href=\"{}\" id=\"link\">destination</a>".format(dest)
return inline(content)
def get_center(rect):
return {
... | mpl-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/django-tastypie/tastypie/management/commands/backfill_api_keys.py | 27 | 1076 | from __future__ import print_function
from __future__ import unicode_literals
from django.core.management.base import NoArgsCommand
from tastypie.compat import User
from tastypie.models import ApiKey
class Command(NoArgsCommand):
help = "Goes through all users and adds API keys for any that don't have one."
... | agpl-3.0 |
Serenytics/mrq | tests/conftest.py | 1 | 9561 | from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins import str
from builtins import object
from past.builtins import basestring
import pytest
import os
try:
import subprocess32 as subprocess
except:
import subproce... | mit |
pombredanne/PyMISP | examples/search.py | 2 | 1727 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymisp import PyMISP
from keys import misp_url, misp_key,misp_verifycert
import argparse
import os
import json
def init(url, key):
return PyMISP(url, key, misp_verifycert, 'json')
def search(m, quiet, url, controller, out=None, **kwargs):
result = m.search... | bsd-2-clause |
matrixise/odoo | addons/portal_project_issue/tests/__init__.py | 167 | 1124 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
direvus/ansible | test/units/modules/cloud/amazon/test_aws_direct_connect_connection.py | 81 | 4165 | # (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 |
mavit/ansible | lib/ansible/modules/network/iosxr/iosxr_interface.py | 24 | 26061 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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 |
Juniper/contrail-dev-neutron | neutron/plugins/hyperv/hyperv_neutron_plugin.py | 7 | 14210 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.ap... | apache-2.0 |
coronary/RandomEpisode | depends/Lib/site-packages/pip/_vendor/retrying.py | 934 | 9972 | ## Copyright 2013-2014 Ray Holder
##
## 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 ... | mit |
jbking/demo-appengine-django-golang | myproject/django/core/servers/basehttp.py | 46 | 6634 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | mit |
KenKundert/abraxas | abraxas/secrets.py | 1 | 4131 | # Generate a Secret
import hashlib
import string
# Globals {{{1
DEFAULT_PASSPHRASE_LENGTH = 4
DEFAULT_PASSWORD_LENGTH = 12
DEFAULT_SEPARATOR = ' '
DEFAULT_ALPHABET = string.ascii_letters + string.digits
# Utilities {{{1
# Partition a string into chunks, each of chars_per_chunk characters, and return
# them one at a ... | gpl-3.0 |
potpath/django-rest-framework | tests/test_response.py | 68 | 10811 | from __future__ import unicode_literals
from django.conf.urls import include, url
from django.test import TestCase
from django.utils import six
from rest_framework import generics, routers, serializers, status, viewsets
from rest_framework.renderers import (
BaseRenderer, BrowsableAPIRenderer, JSONRenderer
)
from... | bsd-2-clause |
imk1/IMKTFBindingCode | makeGetMergedPeakSignalsScript.py | 1 | 2401 | import sys
import argparse
from itertools import izip
def parseArgument():
# Parse the input
parser=argparse.ArgumentParser(description=\
"Get the positions with the top scores and their scores")
parser.add_argument("--bedFileNameList", required=True,\
help='File with list of bed files')
parser.add_argument(... | mit |
dutradda/alquimia | alquimia/models_attrs_reflect.py | 1 | 4950 | # Copyright 2015 Diogo Dutra
# This file is part of alquimia.
# alquimia 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 version 3 of the License, or
# (at your option) any later version.
# Th... | lgpl-3.0 |
Peddle/hue | desktop/core/ext-py/pysaml2-2.4.0/example/sp-repoze/attributemaps/basic.py | 112 | 22565 |
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"fro": {
'urn:mace:dir:attribute-def:aRecord': 'aRecord',
'urn:mace:dir:attribute-def:aliasedEntryName': 'aliasedEntryName',
'urn:mace:dir:attribute-def:aliasedObjectName': 'aliasedObjectName',
'urn:mace:... | apache-2.0 |
asfaltboy/GitSavvy | core/git_mixins/active_branch.py | 1 | 5082 | import re
import string
class ActiveBranchMixin():
def get_current_branch_name(self):
"""
Return the name of the last checkout-out branch.
"""
stdout = self.git("branch", "--no-color")
try:
correct_line = next(line for line in stdout.split("\n") if line.startsw... | mit |
mrshelly/openerp71313 | openerp/addons/project_issue/project_issue.py | 1 | 29439 | #-*- 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 |
tellapart/Diamond | src/collectors/network/test/testnetwork.py | 8 | 11711 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
try:
from cStringIO import StringIO
StringIO # work... | mit |
beckastar/django | django/conf/locale/ko/formats.py | 82 | 2324 | # -*- 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 = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i:s'... | bsd-3-clause |
campbe13/openhatch | vendor/packages/sphinx/tests/etree13/HTMLTreeBuilder.py | 25 | 7771 | #
# ElementTree
# $Id$
#
# a simple tree builder, for HTML input
#
# history:
# 2002-04-06 fl created
# 2002-04-07 fl ignore IMG and HR end tags
# 2002-04-07 fl added support for 1.5.2 and later
# 2003-04-13 fl added HTMLTreeBuilder alias
# 2004-12-02 fl don't feed non-ASCII charrefs/entities as 8-bit strings... | agpl-3.0 |
nrjcoin-project/p2pool | p2pool/test/bitcoin/test_getwork.py | 275 | 4273 | import unittest
from p2pool.bitcoin import getwork, data as bitcoin_data
class Test(unittest.TestCase):
def test_all(self):
cases = [
{
'target': '0000000000000000000000000000000000000000000000f2b944000000000000',
'midstate': '5982f893102dec03e374b472647c4f19b1b... | gpl-3.0 |
cg31/tensorflow | tensorflow/contrib/layers/__init__.py | 9 | 2629 | # 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 |
jounex/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/sitemaps/tests/urls/http.py | 106 | 1647 | from datetime import datetime
from django.conf.urls import patterns, url
from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap, views
from django.views.decorators.cache import cache_page
from django.contrib.sitemaps.tests.base import TestModel
class SimpleSitemap(Sitemap):
changefreq = "ne... | apache-2.0 |
buckle2000/godot | tools/export/blender25/godot_export_manager.py | 13 | 20513 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed ... | mit |
ProgVal/cjdns | node_build/dependencies/libuv/build/gyp/test/copies/gyptest-default.py | 100 | 1347 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies file copies using the build tool default.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('copies.gyp',
... | gpl-3.0 |
marcusramberg/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/cloud/misc/ovirt.py | 32 | 14190 | #!/usr/bin/python
# (c) 2013, Vincent Van der Kussen <vincent at vanderkussen.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | mit |
savoirfairelinux/OpenUpgrade | addons/auth_ldap/users_ldap.py | 38 | 10550 | ##############################################################################
#
# 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 Publ... | agpl-3.0 |
wangyum/tensorflow | tensorflow/contrib/saved_model/python/saved_model/signature_def_utils_test.py | 64 | 8192 | # 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 |
jakevdp/lombscargle | ez_setup.py | 164 | 12155 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | bsd-3-clause |
jorik041/phantomjs | src/breakpad/src/tools/gyp/test/defines/gyptest-defines-env-regyp.py | 151 | 1312 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | bsd-3-clause |
CSIRT-MU/Stream4Flow | applications/statistics/tls_classification/web-interface/controllers/tls_classification_statistics.py | 1 | 3061 | # -*- coding: utf-8 -*-
# Import Elasticsearch library
import elasticsearch
from elasticsearch_dsl import Search, Q, A
# Import advanced python collections
import collections
# Import global functions
from global_functions import escape
#----------------- Main Functions -------------------#
def tls_classification_s... | mit |
dholbach/snapcraft | snapcraft/common.py | 10 | 1319 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.