code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: zdde.py
# Purpose: Python based DDE link with ZEMAX server, similar to Matlab based
# MZDDE toolbox.
# Licence: MIT License
# This file is subject to the terms and co... | indranilsinharoy/PyZDDE | pyzdde/zdde.py | Python | mit | 493,037 |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="scatterternary.marker.colorbar.tickfont",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name... | plotly/python-api | packages/python/plotly/plotly/validators/scatterternary/marker/colorbar/tickfont/_size.py | Python | mit | 546 |
from django.apps import AppConfig
class ClothesConfig(AppConfig):
name = 'clothes'
| Meerkat007/Clothes-Shop-Website | server/clothes/apps.py | Python | mit | 89 |
# -*- coding: utf-8 -*-
from flask import jsonify
from flask.ext.bcrypt import generate_password_hash
from itsdangerous import (TimedJSONWebSignatureSerializer
as Serializer, BadSignature, SignatureExpired)
from app import db, app
class User(db.Model):
"""
Represent a user in datab... | gardyna/WalkerAppGame | NewAPI/app/mod_user/models.py | Python | mit | 1,496 |
import numpy as np
import glob
import math
import matplotlib.image as mpimg
import cv2
from lane_assist_pipeline_ops import LaneAssistOp, CameraCalibrationOp, PlotImageOp
# Import everything needed to edit/save/watch video clips
from moviepy.editor import VideoFileClip
# This constant ultimately contributes to deriv... | matthewzimmer/CarND-AdvancedLaneLines-P4 | pipeline_runner.py | Python | mit | 5,364 |
# -*- coding: utf-8 -*-
from collections import namedtuple
import hashlib
import io
import struct
import zlib
from . import sbon
from .btreedb5 import BTreeDB5
from .sbasset6 import SBAsset6
__version__ = '1.0.0'
# Override range with xrange when running Python 2.x.
try:
range = xrange
except:
pass
# Util... | blixt/py-starbound | starbound/__init__.py | Python | mit | 9,935 |
#!/usr/bin/env python
from nose.tools import *
import networkx
from test_graph import BaseGraphTester, BaseAttrGraphTester, TestGraph
class BaseDiGraphTester(BaseGraphTester):
def test_has_successor(self):
G=self.K3
assert_equal(G.has_successor(0,1),True)
assert_equal(G.has_successor(0,-1),... | LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/networkx/classes/tests/test_digraph.py | Python | bsd-2-clause | 10,754 |
#!/usr/bin/python
"""
getTweetsId.py: get tweets from Twitter by tweet ids
usage: ./getTweets < file
20170711 erikt(at)xs4all.nl
"""
import json
import operator
import re
import sys
import time
# import twitter library: https://github.com/sixohsix/twitter
# /usr/local/lib/python2.7/dist-packages/twitter-1.17.1-py2.7.e... | online-behaviour/machine-learning | getTweetsId.py | Python | apache-2.0 | 3,407 |
#!/usr/bin/env python
#
# Copyright 2004,2005,2007,2008,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version ... | iohannez/gnuradio | gr-audio/examples/python/dial_tone_wav.py | Python | gpl-3.0 | 2,414 |
# -*- coding: utf-8 -*-
import Queue
import functools
import utils.builtin
import jobs.definition.cloudshare_zhilian
from jobs.definition.batchconvert import *
class Batchconvert(BatchconvertCloudshare,
jobs.definition.cloudshare_zhilian.Zhilian):
CVDB_PATH = 'convert/zhilian'
ORIGIN_CVDB... | followcat/predator | jobs/definition/batchconvert_cloudshare_zhilian.py | Python | lgpl-3.0 | 2,388 |
import sys
import numpy
from python.src.data_processing.normalizer import Normalizer
from python.src.neural_networks.neural_network import NeuralNetwork
from python.src.neurons.receive_all_neuron import ReceiveAllNeuron
from python.src.neurons.output_only_neuron import OutputOnlyNeuron
from python.src.neurons.activati... | DomenicD/dom_ml_playground | python/src/neural_networks/feed_forward.py | Python | mit | 3,406 |
'''
This module should be called to regenerate cog code (it doesn't need to be rerun every time, as the
generated code itself is commited).
'''
from string import Template
import os
import sys
parent_dir = os.path.split(__file__)[0]
#====================================================================================... | smkr/pyclipse | plugins/org.python.pydev.red_core/install.py | Python | epl-1.0 | 1,220 |
"""Version info"""
short_version = '0.1'
version = '0.1.70'
| urinieto/msaf | msaf/version.py | Python | mit | 60 |
"""
Django settings for sisweb project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
#... | HumbertValles/BlaBlaPro | sisweb/settings.py | Python | gpl-3.0 | 3,175 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Post'
db.create_table('blog_pages_post', (
('id', self.gf('django.db.models.fi... | StephenPower/CollectorCity-Market-Place | stores/apps/blog_pages/migrations/0001_initial.py | Python | apache-2.0 | 14,914 |
WEB_APPS_ENVIRONMENT = 'web-apps'
PREVIEW_APP_ENVIRONMENT = 'preview-app'
DEVICE_ID = 'Formplayer'
| dimagi/commcare-hq | corehq/apps/cloudcare/const.py | Python | bsd-3-clause | 99 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, modify, merge, publish... | rwl/PyCIM | CIM14/CPSM/Equipment/Wires/Disconnector.py | Python | mit | 1,865 |
# pyuDMX.py - Anyma (and clones) uDMX interface module
# Copyright (C) 2016 Dave Hocker (email: AtHomeX10@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
... | dhocker/uDMX-pyusb | setup.py | Python | gpl-3.0 | 1,718 |
#! /usr/bin/env python
# SCardConnect_DIRECT2.py : Unitary test for SCardReconnect
# Copyright (C) 2010 Ludovic Rousseau
#
# 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 vers... | sudheesh001/RFID-DBSync | PCSC/UnitaryTests/SCardConnect_DIRECT2.py | Python | gpl-2.0 | 3,899 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
from odoo.exceptions import AccessError, MissingError
from odoo.tools import pickle
EXCLUDED_FIELDS = set((
'report_sxw_content', 'report_rml_content', 'report_sxw', 'r... | akhmadMizkat/odoo | openerp/addons/base/ir/ir_values.py | Python | gpl-3.0 | 24,020 |
from __future__ import absolute_import
import logging
import flask
from flask.signals import got_request_exception
from raygun4py import raygunprovider
log = logging.getLogger(__name__)
class Provider(object):
def __init__(self, flaskApp, apiKey):
self.flaskApp = flaskApp
self.apiKey = apiKey
... | MindscapeHQ/raygun4py | python2/raygun4py/middleware/flask.py | Python | mit | 1,082 |
from django.shortcuts import render
from django.http import HttpResponseRedirect
from ticket.models import *
from trains.models import *
from .forms import *
def get_availability(request, train_id, coach_id):
request.session['train_id'] = train_id
request.session['coach_id'] = coach_id
print train_id, coa... | KeshavSeth/RailwayReservationSystem | src/ticket/views.py | Python | mit | 995 |
# Copyright 2017--2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | awslabs/sockeye | sockeye/training.py | Python | apache-2.0 | 45,283 |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import mock
import os
import unittest
from mkdocs import nav, utils, exceptions
from mkdocs.tests.base import dedent
class UtilsTests(unittest.TestCase):
def test_html_path(self):
expected_results = {
'index.md': ... | d0ugal/mkdocs | mkdocs/tests/utils/utils_tests.py | Python | bsd-2-clause | 7,365 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
__author__ = 'Dirk Braunschweiger'
__version__ = "0.01"
# db_folders -> List of DB Folder (for space check)
# db_client -> name of ycsb client
# db_args -> special ycsb arguments for this db
# db_name -> name of this db (e.g. for workload file)
# db_desc -> more detailed... | TSDBBench/Overlord | vagrant_files/generator/files/databases/akumuli_cl1_rf1.py | Python | apache-2.0 | 4,455 |
''' Assemble WebSocket wire message fragments into complete Bokeh Server
message objects that can be processed.
'''
from __future__ import absolute_import
import six
from tornado import gen
from .exceptions import ValidationError
import logging
log = logging.getLogger(__name__)
class Receiver(object):
''' Rece... | dennisobrien/bokeh | bokeh/protocol/receiver.py | Python | bsd-3-clause | 4,356 |
# Copyright (C) 2015 – 2021 Noa-Emil Nissinen (4shadoww)
from core.hakkuframework import *
import os
from core import colors
from scapy.all import *
from core import network_scanner
import random
from core import getpath
from core.setvar import setvar
conf = {
"name": "mac_spoof",
"version": "1.0",
"short... | 4shadoww/hakkuframework | modules/mac_spoof.py | Python | mit | 2,683 |
from __future__ import unicode_literals
from copy import copy
import os
import shutil
import sys
import tempfile
from django.apps import apps
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from django.db import connections, DEFAUL... | dsanders11/django-migrate-project | tests/test_migrateproject.py | Python | mit | 12,384 |
# 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... | lukeiwanski/tensorflow | tensorflow/python/ops/metrics_impl.py | Python | apache-2.0 | 162,105 |
# Copyright 2017--2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | awslabs/sockeye | sockeye/log.py | Python | apache-2.0 | 4,642 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-07 15:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('siteapp', '0010_auto_20161207_1540'),
]
operations = [
migrations.AddField(... | GovReady/govready-q | siteapp/migrations/0011_organization_allowed_modules.py | Python | gpl-3.0 | 612 |
# -*- coding: utf-8 -*-
#
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | dhermes/google-cloud-python | bigtable/tests/unit/gapic/v2/test_bigtable_instance_admin_client_v2.py | Python | apache-2.0 | 35,949 |
#!/usr/bin/env python
import sys
import os.path
from zvm import zmachine, trivialzui
def usage():
print """Usage: %s <story file>
Run a Z-Machine story under ZVM.
""" % sys.argv[0]
sys.exit(1)
def main():
if len(sys.argv) != 2:
usage()
story_file = sys.argv[1]
if not os.path.isfile(story... | BGCX262/zvm-hg-to-git | run_story.py | Python | bsd-3-clause | 777 |
import datetime
from flask_sqlalchemy import Pagination
from app.exceptions.base import ResourceNotFoundException, \
BusinessRuleException, DuplicateResourceException
from app.models.course import Course
from app.repository import examination_repository
def get_examination_by_id(examination_id):
exam = exami... | viaict/viaduct | app/service/examination_service.py | Python | mit | 5,625 |
"""
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... | SaikWolf/gnuradio | grc/gui/Port.py | Python | gpl-3.0 | 10,040 |
# -*- coding: utf-8 -*-
from flask import Flask, render_template, session, request, redirect, g
import psycopg2, bcrypt
def render(error=None):
return render_template('login.html', error=error)
def post(request):
cursor = g.db.cursor()
username = unicode(request.form['username'])
password = unicode(r... | jclakkis/discus-inferno | routes/login.py | Python | mit | 885 |
from django.utils.translation import ugettext as _
#=========================================================================
# HELPERS
#=========================================================================
def get_display(key, list):
d = dict(list)
if key in d:
return d[key]
return None
def ... | marco-lancini/Showcase | app_collaborations/options.py | Python | mit | 5,831 |
import numpy as np
import pandas as pd
from pandas import date_range, Index, DataFrame, Series, Timestamp
from pandas.util import testing as tm
class TestDatetimeIndex(object):
def test_setitem_with_datetime_tz(self):
# 16889
# support .loc with alignment and tz-aware DatetimeIndex
mask =... | NixaSoftware/CVis | venv/lib/python2.7/site-packages/pandas/tests/indexing/test_datetime.py | Python | apache-2.0 | 9,075 |
# ******************************************************
# * EXEMPLE SCRIPT : Using Property file
# * - Check 2 conditions with "Logical AND"
# *****************************************************/
from org.ow2.proactive.scripting.helper.selection import SelectionUtils
from org.ow2.proactive.scripting.helper.selection... | acontes/scheduling | samples/scripts/selection/checkProperties.py | Python | agpl-3.0 | 985 |
#!/usr/bin/python
#~ This file is part of NoStaples.
#~ NoStaples 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.
#~ NoStaples is... | onyxfish/nostaples | controllers/document.py | Python | gpl-3.0 | 19,586 |
from django.conf.urls import url
from corehq.apps.receiverwrapper.views import post, secure_post
urlpatterns = [
url(r'^/?$', post, name='receiver_post'),
url(r'^/secure/(?P<app_id>[\w-]+)/$', secure_post, name='receiver_secure_post_with_app_id'),
url(r'^/secure/$', secure_post, name='receiver_secure_post... | qedsoftware/commcare-hq | corehq/apps/receiverwrapper/urls.py | Python | bsd-3-clause | 479 |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | 111pontes/ydk-py | cisco-ios-xe/ydk/models/cisco_ios_xe/_meta/_CISCO_SUBSCRIBER_SESSION_TC_MIB.py | Python | apache-2.0 | 2,087 |
from unittest import TestCase
import inspect
from ..sipmessaging import SIPURI
from ..sipmessaging import ContentLengthSIPHeaderField
from ..sipmessaging import ViaSIPHeaderField
from ..sipmessaging import AcceptSIPHeaderField
from ..sipmessaging import AcceptEncodingSIPHeaderField
from ..sipmessaging import AcceptLang... | bobjects/BobStack | bobstack/tests/abstractSIPMessageTestCase.py | Python | apache-2.0 | 60,836 |
"""
Tools for processing mentions:
- Finds candidate entities
- Calculates commonness
@author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no)
"""
from nordlys.tagme.config import SF_WIKI
class Mention(object):
def __init__(self, text):
self.text = text.lower()
self.__matched_ens = None ... | hasibi/TAGME-Reproducibility | nordlys/tagme/mention.py | Python | mit | 3,220 |
from django.core.management.base import BaseCommand, CommandError
from treeherder.perf.models import PerformanceFramework
class Command(BaseCommand):
help = "Add a performance framework to treeherder"
args = '<framework>'
def handle(self, *args, **options):
if len(args) != 1:
raise ... | moijes12/treeherder | treeherder/perf/management/commands/add_perf_framework.py | Python | mpl-2.0 | 453 |
# coding: utf-8
import re, sys, codecs
import alignment, read_inf_xml, clean_annotated_tweet
def calc_alignment_sentence(sentence, rules):
# need to consider the case of multiple non-standard words
original_converted_list = get_original_informal_pair(sentence)
## hopefully, change it to multiple rules
# curren... | akkikiki/Research | calc_alignment.py | Python | apache-2.0 | 3,106 |
from pysnmp.smi import view
from pysnmp.smi.rfc1902 import *
__all__ = ['CommandGeneratorVarBinds', 'NotificationOriginatorVarBinds']
class AbstractVarBinds:
def getMibViewController(self, snmpEngine):
mibViewController = snmpEngine.getUserContext('mibViewController')
if not mibViewController:
... | imron/scalyr-agent-2 | scalyr_agent/third_party/pysnmp/hlapi/varbinds.py | Python | apache-2.0 | 2,626 |
#!/usr/bin/env python
import os
import unittest
from six import StringIO
from piprot.piprot import parse_req_file
class TestRequirementsParser(unittest.TestCase):
def setUp(self):
pass
def test_requirement_exact(self):
f = StringIO("requests==1.2.3")
d = parse_req_file(f)
sel... | sesh/piprot | piprot/test/test_parser.py | Python | mit | 3,174 |
#!/usr/bin/env python
### ToDo
''' A script to fast analyze relevant measurement parameters, without calculating n, for comparism of different spectrometer
The script should work for single input files, and also for a series of sample and reference measurements
runGetSignalInfos should print:
maxDR of fourier and... | DavidJahn86/terapy | getSignalInfos.py | Python | gpl-2.0 | 7,347 |
import time
import datetime
import sys
import getopt, argparse
from collections import defaultdict
import json
import MySQLdb
import unicodecsv
import pprint
ITEM_MAP_VARCHAR_INSERT = "insert into item_map_varchar (item_id, attr_id, value) values ((select item_id from items where client_item_id = %(id)s),(select attr_... | smrjan/seldon-server | python/build/lib/seldon/cli/import_items_utils.py | Python | apache-2.0 | 7,344 |
"""
Created on Dec 09, 2014.
"""
from pyramid.httpexceptions import HTTPOk
from everest.mime import XmlMime
from everest.resources.utils import get_root_collection
from thelma.interfaces import ITubeRack
from thelma.tests.functional.conftest import TestFunctionalBase
class TestRackFunctional(TestFunctionalBase):
... | helixyte/TheLMA | thelma/tests/functional/test_rack.py | Python | mit | 1,605 |
import os
import pickle
import pprint
import time
from collections import deque
from twisted.internet import reactor
from twisted.application import service
from twisted.application.internet import TimerService
from zope.interface import implements
from foolscap.api import eventually, DeadReferenceError, Referenceabl... | kytvi2p/tahoe-lafs | src/allmydata/stats.py | Python | gpl-2.0 | 11,418 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.enums import HTTP_HEADER
from lib.core.settings import WAF_ATTACK_VECTORS
__product__ = "TrafficShield (F5 Networks)"
def detect(get_page):
retv... | golismero/golismero | tools/sqlmap/waf/trafficshield.py | Python | gpl-2.0 | 681 |
# Copyright (c) 2007-2009 Citrix Systems 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; version 2 only.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ... | mcclurmc/xcp-console | XSConsoleData.py | Python | gpl-2.0 | 46,581 |
import sure # noqa # pylint: disable=unused-import
from unittest.mock import patch
from moto.server import main, create_backend_app, DomainDispatcherApplication
def test_wrong_arguments():
try:
main(["name", "test1", "test2", "test3"])
assert False, (
"main() when called with the inc... | spulec/moto | tests/test_core/test_server.py | Python | apache-2.0 | 1,547 |
"""
audit_log - File ``/var/log/audit/audit.log``
=============================================
"""
import shlex
from datetime import date
from .. import LogFileOutput, parser, add_filter
from insights.specs import Specs
# Currently, only selinux related(AVC type) audit logs are interested.
# Add this filter in parse... | RedHatInsights/insights-core | insights/parsers/audit_log.py | Python | apache-2.0 | 5,722 |
import numpy as np
from pydlv.dl_model_base import DLModelBase
class DLModel3(DLModelBase):
'''
This class defines the mathematical model for decision landscape in the form of
a system of two ordinary differential equations. It also encapsulates the definitions of
fit error functions and its jacobians... | cherepaha/PyDLV | pydlv/dl_model_3.py | Python | gpl-3.0 | 2,380 |
# -*- coding: utf-8 -*-
from nprl.td import TDLearning
import unittest
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_run_td(self):
td = TDLearning(discount_rate=0.5, maximum_state_id=None)
# Simple one-way environment
states = ['ONE', 'TWO', 'THREE', 'FO... | ugo-nama-kun/nonpara_discrete_rl | tests/test_td.py | Python | mit | 1,156 |
#!/usr/bin/env python
# coding: utf-8
import sys
import os
import recursion
import unittest
class KWLTest(unittest.TestCase):
def setUp(self):
self.psr = recursion.recursionParser()
self.maxDiff = None
def testToken(self):
alpha = 'abc'
number = '12'
sem_alpha = {'t': 'alpha', 'v': 'abc'}
... | kasahorow/kwl | kwl2text/recursion_test.py | Python | bsd-2-clause | 1,091 |
from collections import Counter
import heapq
class Solution(object):
def topKFrequent(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
threshold = len(nums) // k
result, left = [], []
for key, val in Counter(nums).items():... | wufangjie/leetcode | 347. Top K Frequent Elements.py | Python | gpl-3.0 | 596 |
#!/usr/bin/env python
#
# Copyright 2014 Huawei Technologies Co. Ltd
#
# 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 ... | baigk/compass-core | bin/poll_switch.py | Python | apache-2.0 | 3,576 |
# Copyright 2013, Nachi Ueno, NTT I3, 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... | samsu/neutron | services/vpn/device_drivers/ipsec.py | Python | apache-2.0 | 24,853 |
# Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Federico Ceratto <federico.ceratto@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.or... | tonyli71/designate | designate/tests/unit/test_objects/test_domain.py | Python | apache-2.0 | 2,790 |
import operator
import numpy as np
import sys
'''
Description:
Author: Mikko Auvinen
mikko.auvinen@helsinki.fi
University of Helsinki &
Finnish Meteorological Institute
'''
# =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
def writeNumpyZFootprintRaw( filename, arr ):
fstr = filenam... | saskartt/P4UL | pyLib/footprintTools.py | Python | mit | 12,182 |
# -*- coding: utf-8 -*-
import re
import urllib.parse
from ..base.simple_downloader import SimpleDownloader
class UloziskoSk(SimpleDownloader):
__name__ = "UloziskoSk"
__type__ = "downloader"
__version__ = "0.31"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?ulozisko\.sk/.+"
__conf... | vuolter/pyload | src/pyload/plugins/downloaders/UloziskoSk.py | Python | agpl-3.0 | 2,810 |
import argparse
import json
import html
import logging
import pkg_resources
import atexit
from time import sleep
from threading import Thread
from vexmessage import decode_vex_message
from vexbot.adapters.messaging import Messaging
from vexbot.adapters.socket_io.observer import SocketObserver
try:
from websocket... | benhoff/vex | vexbot/adapters/socket_io/__init__.py | Python | gpl-3.0 | 4,594 |
__author__ = 'michael'
def solve_depthfirst(gm, heuristic=lambda gm: gm.get_options(), num=1):
curseq = []
solutions = []
hist_gm = [gm.copy()]
gm.copy()
hist_opt = [1, heuristic(gm)]
while len(solutions) != num:
gm.move(hist_opt[-1][0])
curseq.append(hist_opt[-1][0])
d... | sonnerm/games | games/solver.py | Python | agpl-3.0 | 862 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.models import Displayable, RichText, Ownable
class JobPost(Displayable, RichText):
"""
A career job posting
"""
class Meta:
verbose_name = _("Job Post"... | robmoggach/mezzanine-careers | careers/models.py | Python | bsd-2-clause | 664 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import pytest
from pages.firefox.browsers.what_is_a_browser import WhatIsABrowserPage
@pytest.mark.nondestructive
@p... | pascalchevrel/bedrock | tests/functional/firefox/browsers/test_what_is_a_browser.py | Python | mpl-2.0 | 636 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/test/unit/test_plugins.py | Python | gpl-2.0 | 14,759 |
# FlaskTaskr/forms.py
from flask_wtf import Form
from wtforms import StringField, DateField, IntegerField,\
SelectField, PasswordField
from wtforms.validators import DataRequired, length, EqualTo, Email
class AddTaskForm(Form):
task_id = IntegerField()
name = StringField('Task Name', validators=[DataRequired()]... | yangchandle/FlaskTaskr | project/forms.py | Python | mit | 1,247 |
from twisted.internet import protocol, defer, reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from ooni.nettest import NetTestCase
from ooni.errors import failureToString
from ooni.utils import log
class TCPSender(protocol.Protocol):
def __init__(self):
self.received_data = ''
se... | lordappsec/ooni-probe | ooni/templates/tcpt.py | Python | bsd-2-clause | 3,113 |
"""
This module contains utilities for use in conjunction with field renderers.
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2014, G. Klyne"
__license__ = "MIT (http://opensou... | gklyne/annalist | src/annalist_root/annalist/views/fields/find_renderers.py | Python | mit | 15,530 |
#! /usr/bin/env python
#This runs on M2
#Take the masked value of M1 and multiply by M2
import os
import sys
import shutil
import ds_config
#Get the params
biobank_name = sys.argv[1]
masking_vector_name = sys.argv[2]
data_from_M1 = sys.argv[3]
data_set_name = sys.argv[4]
masked_location_local = sys.argv[5]
masked_l... | Vertical-Datashield/vertical_datashield | source/common/masked_M1_times_M2.py | Python | gpl-3.0 | 1,666 |
# SOAP envelope
SOAP_NS = 'http://schemas.xmlsoap.org/soap/envelope/'
# xmldsig
DS_NS = 'http://www.w3.org/2000/09/xmldsig#'
# xmlenc
ENC_NS = 'http://www.w3.org/2001/04/xmlenc#'
WSS_BASE = 'http://docs.oasis-open.org/wss/2004/01/'
# WS-Security
WSSE_NS = WSS_BASE + 'oasis-200401-wss-wssecurity-secext-1.0.xsd'
# WS-Ut... | orcasgit/py-wsse | wsse/constants.py | Python | bsd-3-clause | 544 |
class Scraper(object):
def __init__(self, client):
self.client = client | rozap/vulnpub_aggregator | scraper.py | Python | mit | 77 |
#!/usr/bin/env python
import os
import time
import proctest
import mozunit
from mozprocess import processhandler
here = os.path.dirname(os.path.abspath(__file__))
class ProcTestKill(proctest.ProcTest):
""" Class to test various process tree killing scenatios """
# This test should ideally be a part of te... | Yukarumya/Yukarum-Redfoxes | testing/mozbase/mozprocess/tests/test_mozprocess_kill_broad_wait.py | Python | mpl-2.0 | 1,067 |
"""
The Template Module contains the base definition for Executing Templates
"""
import json
import logging
import os
from argparse import ArgumentParser
from qds_sdk.qubole import Qubole
from qds_sdk.resource import Resource
log = logging.getLogger("qds_template")
from qds_sdk.commands import *
class TemplateCmdLi... | msumit/qds-sdk-py | qds_sdk/template.py | Python | apache-2.0 | 9,095 |
from os.path import abspath, dirname, join as pjoin
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
fn = abspath(pjoin(dirname(__file__), 'README.rst'))
fp = open(fn, 'r')
long_description = fp.read()
fp.close()
setup(
name='aino-convert',
version='0.1.0.14',
... | aino/aino-convert | setup.py | Python | bsd-3-clause | 1,068 |
# -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py | Python | apache-2.0 | 16,810 |
# 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 ... | SUSE/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/stateful_service_update_description.py | Python | mit | 6,746 |
"""
.. module:: MetaBuilder Credit Card Test
:platform: Linux
:synopsis: An small framework for creating builders or entities with validators. Test for version version >=0.15.
:copyright: (c) 2013 by Ernesto Bossi.
:license: GPL v3.
.. moduleauthor:: Ernesto Bossi <bossi.ernestog@gmail.com>
"""
from unitt... | bossiernesto/PyMetaBuilder | test/testTarjetaBuilder.py | Python | gpl-3.0 | 2,103 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... | xieta/mincoin | qa/rpc-tests/mempool_reorg.py | Python | mit | 4,520 |
import os
import shutil
import unittest
import tempfile
import deepchem as dc
import numpy as np
from sklearn.ensemble import RandomForestClassifier
class TestDrop(unittest.TestCase):
"""
Test how loading of malformed compounds is handled.
Called TestDrop since these compounds were silently and erroneously drop... | bowenliu16/deepchem | deepchem/data/tests/test_drop.py | Python | gpl-3.0 | 1,096 |
"""
This module defines the interface every store needs to adhere to.
"""
from abc import ABCMeta, abstractmethod
class IStore:
"""
This interface handles object-storage.
Implementations of this interface can be made for different object-storages
Currently this interface is only implemented for PairT... | OnroerendErfgoed/augeias | augeias/stores/StoreInterface.py | Python | gpl-3.0 | 3,870 |
#
# Copyright (c) 2015 Matthew Bentley
#
#
# 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, modify, merge, publish,... | mjuric/duplicity | duplicity/backends/b2backend.py | Python | gpl-2.0 | 5,646 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-06-07 23:30
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0100_auto_20160627_2213'),
]
operati... | shirishgoyal/crowdsource-platform | crowdsourcing/migrations/0093_auto_20160607_2330.py | Python | mit | 839 |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... | SmartDeveloperHub/sdh-fragment-server | sdh/fragments/__init__.py | Python | apache-2.0 | 1,569 |
from setuptools import setup, find_packages
version = open('VERSION').read().strip()
license = open('LICENSE').read().strip()
setup(
name = 'python-package-boilerplate',
version = version,
license = license,
author = 'Your Name Here',
author_email = 'you@somewhere.com',
url = 'http://www.somew... | dagostinelli/python-package-boilerplate | setup.py | Python | unlicense | 678 |
# -*- coding: utf-8 -*-
import urllib as _ul
import pandas as _pd
from atmPy.general import measurement_site as _ms
def get_all_sites(url = "https://www.esrl.noaa.gov/gmd/dv/site/"):
html = _ul.request.urlopen(url).read()
sites = _pd.read_html(html)[0]
#remove discontinued
sites = sites[~sit... | hagne/atm-py | atmPy/data_archives/noaa_gml/gml_lab.py | Python | mit | 1,097 |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 18:16:24 2015
@author: Eugenio Panadero
A raíz del cambio previsto:
DESCONEXIÓN DE LA WEB PÚBLICA CLÁSICA DE E·SIOS
La Web pública clásica de e·sios (http://www.esios.ree.es) será desconectada el día 29 de marzo de 2016.
Continuaremos ofreciendo servicio en la nueva ... | azogue/esiosdata | esiosdata/importdemdata.py | Python | mit | 5,807 |
#! /usr/bin/env python2.5
# -*- coding: utf-8 -*-
"""Script to run the pybrain testsuite."""
__author__ = 'Justin Bayer, bayerj@in.tum.de'
__version__ = '$Id$'
import doctest
import logging
import os
import sys
from unittest import TestLoader, TestSuite, TextTestRunner
def setUpLogging():
logging.basicConfi... | bayerj/theano-rnn | rnn/tests/runtests.py | Python | bsd-3-clause | 3,491 |
# ***** 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 di... | jemandez/creaturas-magicas | Configuraciones básicas/scripts/addons/add_window/window_panel.py | Python | gpl-3.0 | 70,889 |
from nflpool.viewmodels.viewmodelbase import ViewModelBase
class UpdateWeeklyStats(ViewModelBase):
def __init__(self):
self.player_id = None
self.passyds = None
self.rushyds = None
self.recyds = None
self.sacks = None
self.interceptions = None
self.week = No... | prcutler/nflpool | nflpool/viewmodels/update_weekly_stats_viewmodel.py | Python | mit | 773 |
__version__ = '19.6.2'
| mlaidouni/Artistfunds | venv/lib/python2.7/site-packages/setuptools/version.py | Python | mit | 23 |
#!/usr/bin/env python
# Copyright 2004-present Facebook. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import ast
import jinja2
import logging
import os
import sys
# set DEVELOPING to True for ... | subailong/testgit | tools/gentable.py | Python | bsd-3-clause | 9,148 |
class Person:
def __init__(self, name, job=None, pay=0):
self.name = name
self.job = job
self.pay = pay
def lastName(self):
return self.name.split()[-1]
def giveRaise(self, percent):
self.pay = int(self.pay * (1 + percent))
def __repr__(self):
return '[P... | dreadrel/UWF_2014_spring_COP3990C-2507 | notebooks/scripts/book_code/code/person-department.py | Python | apache-2.0 | 1,409 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asnn.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| marvinglenn/asnn-mda | manage.py | Python | gpl-2.0 | 247 |
# vim:sw=4:et:
"""This module contains some helpers that can be used to execute generator
functions in the GObject main loop.
This module provided the following classes:
GIdleThread - Thread like behavior for generators in a main loop
Queue - A simple queue implementation suitable for use with GIdleThread
Exceptions:... | ActiveState/code | recipes/Python/327082_Pseudo_threads_generators/recipe-327082.py | Python | mit | 5,662 |
# 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... | kevin-coder/tensorflow-fork | tensorflow/contrib/distributions/python/kernel_tests/mvn_diag_plus_low_rank_test.py | Python | apache-2.0 | 15,463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.