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 |
|---|---|---|---|---|---|
#!/usr/bin/python
#-*- coding: utf-8 -*-
from sys import argv
from xml.parsers import expat
from re import compile,sub
SEP = ":"
ENC = "UTF-8"
r = compile("---+")
TagsOnly = False
class CXmlParser:
def __init__(self):
self.names = []
self.data = ""
def StartElement(self,name,attrs):
#print name,attr... | lubyagin/sqface | xmldump.py | Python | agpl-3.0 | 1,016 |
# This file is part of OpenHatch.
# Copyright (C) 2010 OpenHatch, Inc.
#
# 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 License, or
# (at your option) any later v... | mzdaniel/oh-mainline | mysite/search/migrations/0040_project_involvement_question_key_string.py | Python | agpl-3.0 | 9,036 |
# Copyright 2018 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... | tombstone/models | official/benchmark/models/resnet_cifar_main.py | Python | apache-2.0 | 10,371 |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from vehicles.models import Vehicle_version
from django.conf import settings
#############
# Create your models here.
class Client(models.Model):
BOOL_CHOICES = ((True, 'Activo'), (False, 'Inactivo'))
use... | SurielRuano/backend-autonomo | clients/models.py | Python | mit | 2,282 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('restserver', '0013_auto_20150815_0058'),
]
operations = [
migrations.AddField(
mo... | thiagopa/planyourexchange-server | restserver/migrations/0014_auto_20150815_0122.py | Python | agpl-3.0 | 1,346 |
from common import *
from openglider.glider import ParametricGlider
from visual_test_glider import TestGlider
__ALL__ = ['GliderTestCase2D']
class GliderTestCaseParametric(TestCase):
def setUp(self):
self.glider = self.import_glider()
self.glider2d_ = ParametricGlider.fit_glider_3d(self.glider)
... | hiaselhans/OpenGlider | tests/visual_test_parametric_glider.py | Python | gpl-3.0 | 778 |
from __future__ import print_function
from __future__ import absolute_import
import six
import random
import re
import os
import xml.etree.cElementTree
import gzip
if six.PY2:
import httplib
from urllib2 import urlopen, HTTPError, URLError
from StringIO import StringIO
else:
import http.client as httplib
from ur... | oe-alliance/e2openplugin-CrossEPG | src/enigma2/python/crossepg_rytec_update.py | Python | lgpl-2.1 | 7,001 |
import urllib2
from bs4 import BeautifulSoup
import mysql.connector
from mysql.connector import Error
from ConfigParser import SafeConfigParser
import csv
try:
conn = mysql.connector.connect(host='54.218.87.210', database='play', user='root', password='root')
cursor = conn.cursor(buffered = True)
cursor.ex... | devmukul44/Play_Crawler | cloud/scraper1.py | Python | mit | 5,554 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('musterapp', '0019_auto_20150626_1535'),
]
operations = [
migrations.AddField(
model_name='pattern',
... | kleingeist/muster | musterapp/migrations/0020_pattern_vector_count.py | Python | gpl-2.0 | 424 |
"""
pyflot demo app based on Flask
"""
import flot
from flask import Flask, render_template
class Fx(flot.Series):
data = [(1, 3), (2, 2), (3, 5), (4, 4)]
class MyGraph(flot.Graph):
fx = Fx()
app = Flask(__name__)
@app.route("/")
def root():
my_graph = MyGraph()
return render_template('index.html',... | andrefsp/pyflot | examples/flask_app/sample/sample.py | Python | mit | 393 |
"""Test adding a validation hook for entity objects.
"""
import pytest
import icat
import icat.config
from conftest import getConfig
@pytest.fixture(scope="module")
def client(setupicat):
client, conf = getConfig(confSection="nbour")
client.login(conf.auth, conf.credentials)
return client
@pytest.fixtur... | icatproject/python-icat | tests/test_07_entity_validate.py | Python | apache-2.0 | 5,542 |
from typing import Set
from enum import Enum, IntEnum
class EAPTypes(IntEnum):
"""EAP Types accepted by the EAPClient.
See Also:
EAP8021X, EAP.h:51
"""
Invalid = 0
Identity = 1
Notification = 2
Nak = 3
MD5Challenge = 4
OneTimePassword = 5
GenericTokenCard = 6
... | mosen/commandment | commandment/profiles/eap.py | Python | mit | 677 |
# -- coding: utf-8 --
#-------------------------------------------------------------------------------
# Name: astate_edu
# Purpose: Parse Arkansas State University
#
# Author: Ramakrishna
#
# Dated: 07/Mar/2016
# Copyright: (c) Ramakrishna 2016
# Licence: <your licence>
#-------------... | brkrishna/freelance | univs/archives/astate_edu.py | Python | gpl-2.0 | 2,620 |
#!/usr/bin/env python
#coding: utf-8
# The MIT License
#
# Copyright (c) 2009-2011 the bpython authors.
#
# 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 witho... | hirochachacha/apython | bpython/interpreter.py | Python | mit | 12,791 |
# coding=utf-8
"""This is the main package for the application.
:copyright: (c) 2013 by Tim Sutton
:license: GPLv3, see LICENSE for more details.
"""
import os
import logging
from flask import Flask
from flask_mail import Mail
from flask.ext.appconfig import AppConfig
from users.database import db, migrate
APP = F... | ariestiyansyah/atlas | users/__init__.py | Python | gpl-2.0 | 2,699 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | roadmapper/ansible | lib/ansible/modules/network/fortios/fortios_system_proxy_arp.py | Python | gpl-3.0 | 9,679 |
import time
from nxdrive.tests.common import OS_STAT_MTIME_RESOLUTION
from nxdrive.tests.common_unit_test import UnitTestCase
class TestReinitDatabase(UnitTestCase):
def setUp(self):
super(TestReinitDatabase, self).setUp()
self.local = self.local_client_1
self.remote = self.remote_docum... | arameshkumar/nuxeo-drive | nuxeo-drive-client/nxdrive/tests/test_reinit_database.py | Python | lgpl-2.1 | 5,437 |
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Crovax the Cursed")
def crovax_the_cursed(card, abilities):
def crovax_the_cursed():
return AbilityNotImplemented
... | Julian/cardboard | cardboard/cards/sets/stronghold.py | Python | mit | 26,294 |
'''
Created on Oct 3, 2012
Copyright © 2013
The Board of Trustees of The Leland Stanford Junior University.
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.apa... | daStrauss/subsurface | src/expts/paramSplitFieldBoth.py | Python | apache-2.0 | 1,344 |
#!/usr/bin/python
usage = "pointy2OmegaScan.py [--options] gps,pointy.out gps,pointy.out ..."
description = "builds an OmegaScan config file based off the channels with pvalues below --pvalueThr"
author = "reed.essick@ligo.org"
#-------------------------------------------------
import os
import subprocess as sp
imp... | reedessick/pointy-Poisson | pointy2OmegaScan.py | Python | mit | 6,424 |
import fem.geometry as g
import fem.model as m
import fem.material as mat
import fem.solver as s
import fem.mesh as me
import plot
import pickle
from fem.matrices import stiffness_matrix, mass_matrix, stiffness_matrix_nl
def generate_layers(thickness, layers_count, material):
layer_top = thickness / 2
layer... | tarashor/vibrations | py/main3.py | Python | mit | 3,422 |
# coding=utf-8
"""
Base classes for data formats only
"""
import os
from abc import ABCMeta
from typing import Any, List, Dict
from ultros.core.storage.base import MutableFileStorageBase
__author__ = "Gareth Coles"
class DataFile(MutableFileStorageBase, metaclass=ABCMeta):
"""
Base class representing any da... | UltrosBot/Ultros3K | src/ultros/core/storage/data/base.py | Python | artistic-2.0 | 574 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the subversion repository browser dialog.
"""
from __future__ import unicode_literals
try:
str = unicode
except NameError:
pass
import os
from PyQt5.QtGui import QCursor
from PyQt5.QtWi... | testmana2/test | Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py | Python | gpl-3.0 | 16,503 |
import sys
import os
if sys.version < '3':
from .btcommon import *
else:
from bluetooth.btcommon import *
__version__ = 0.22
def _dbg(*args):
return
sys.stderr.write(*args)
sys.stderr.write("\n")
if sys.platform == "win32":
_dbg("trying widcomm")
have_widcomm = False
dll = "wbtapi.dll... | KHU-YoungBo/pybluez | bluetooth/__init__.py | Python | gpl-2.0 | 5,991 |
# -*- coding: utf-8 -*-
# pylint: disable=R0904,C0103
# R0904: Too many public methods (X/20)
# C0103: Invalid name "xX" (should match [a-z_][a-z0-9_]{2,30}$)
from __future__ import absolute_import, print_function, unicode_literals
import unittest
import email
from traceback import format_exc
from mailman.email.mess... | hyperkitty/kittystore | kittystore/test/test_scrub.py | Python | gpl-3.0 | 8,917 |
from pyTrivialFTP import pyTrivialFTP
| roberto-reale/pyTrivialFTP | pyTrivialFTP/__init__.py | Python | mit | 38 |
#!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Eforcers/inbox-cleaner | src/lib/atom/http.py | Python | mit | 12,803 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.base.login import BaseLoggedInPage
from cfme.utils.appliance import ViaREST, ViaUI
from cfme.utils.update import update
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
test_require... | anurag03/integration_tests | cfme/tests/generic_objects/test_definitions.py | Python | gpl-2.0 | 2,521 |
from django.views.generic.detail import DetailView
from .base import GoodsSellBase
class GoodsDetailView(GoodsSellBase, DetailView):
template_name = "trades/goods_detail.html"
slug_field = "hash_id"
def dispatch(self, request, *args, **kwargs):
# from IPython import embed; embed()
ret... | yevgnenll/but | but/trades/views/goods_detail.py | Python | mit | 385 |
# -*- coding: utf-8 -*-
# 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 http://mozilla.org/MPL/2.0/.
import os
import logbook
import logbook.more
import structlog
class UnstructuredRenderer(stru... | La0/mozilla-relengapi | src/pulselistener/pulselistener/lib/log.py | Python | mpl-2.0 | 3,559 |
#!/usr/bin/env/ python3
from distutils.core import setup
setup(name="temsc",
description="message flow generator",
version="v1.1",
author="Wolfgang Beck",
author_email="beckw@telekom.de",
url="https://github.com/bewo001/temsc",
packages=["msc"])
| bewo001/temsc | setup.py | Python | gpl-2.0 | 272 |
# coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | onshape-public/onshape-clients | python/onshape_client/oas/models/schema.py | Python | mit | 10,702 |
import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
class rotate(Command):
"""Delete older distributions"""
description = "delete older distributions, keeping N newest files"
user_options = [
('match='... | igoralmeida/tahoe-lafs | setuptools-0.6c16dev6.egg/setuptools/command/rotate.py | Python | gpl-2.0 | 1,985 |
import rsvg
from random import random
from livingthing import LivingThing
class Plant(LivingThing):
def __init__(self):
LivingThing.__init__(self)
self.x = (random() * 2.0) - 1
self.y = (random() * 2.0) - 1
size = random() * 0.02 + 0.02
self.width = size
self.height = size
self.ro... | antoinevg/survival | ontology/plant.py | Python | gpl-2.0 | 825 |
import unittest
from unittest.mock import patch, MagicMock
from twitchcancer.storage.readonlystorage import ReadOnlyStorage
# ReadOnlyStorage.*()
class TestReadOnlyStorageNotImplemented(unittest.TestCase):
# check that we don't answer calls we can't answer
@patch('twitchcancer.storage.readonlystorage.ReadOn... | Benzhaomin/TwitchCancer | twitchcancer/storage/tests/test_readonlystorage.py | Python | gpl-3.0 | 5,982 |
#!/usr/bin/python
# glib-ginterface-gen.py: service-side interface generator
#
# Generate dbus-glib 0.x service GInterfaces from the Telepathy specification.
# The master copy of this program is in the telepathy-glib repository -
# please make any changes there.
#
# Copyright (C) 2006, 2007 Collabora Limited
#
# This ... | GNOME/libsocialweb | tools/glib-ginterface-gen.py | Python | lgpl-2.1 | 28,402 |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name = 'django-supertools',
version = "0.3",
description = "Generic tools for django apps.",
long_description = "",
keywords = 'django',
author = 'Jesús Espino García & Andrey Antukh',
author_email = 'jespinog@gmail... | kaleidos/django-supertools | setup.py | Python | bsd-3-clause | 1,195 |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 24 13:46:03 2015
@author: sthomp
"""
import numpy as np
import nufft as nu
#import matplotlib.pyplot as plt
#from scipy import interpolate
#from scipy import signal
#Fit a sine wave at a series of harmonics.
def dofft(time,flux, over):
"""Take a fourier transform ... | barentsen/dave | susanplay/otherTools.py | Python | mit | 624 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def colorize(text, color):
colors = { "black" : 30,
"red" : 31,
"green" : 32,
"yellow" : 33,
"blue" : 34,
"purple" : 35,
"cyan" : 36,
... | weezel/BandEventNotifier | utils.py | Python | isc | 578 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from app_metrics.compat import AUTH_USER_MODEL
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'MetricItem.created'
db.alter_column('app_... | frankwiles/django-app-metrics | app_metrics/migrations/0002_alter_created_to_datetime.py | Python | bsd-3-clause | 7,469 |
# -*- coding: UTF-8 -*-
class WikipediaServerError(Exception):
def __init__(self, resp):
self.msg = u"Server error %s: \"%s\" on %s" % (
resp.status_code, resp.reason, resp.url)
super(WikipediaServerError, self).__init__(self.msg)
self.response = resp
def __str__(self):
... | tsalmon/WikiMD | wikimd/exceptions.py | Python | mit | 490 |
#!/usr/bin/env python
from collections import OrderedDict
import inspect
import json
import os
import re
import shutil
import io
from subprocess import call, Popen, PIPE
import sys, getopt
import pkg_resources
import subprocess
from jinja2 import Environment, FileSystemLoader
from drafter_postprocessing.json_process... | Lenijas/test-travisci | fiware_api_blueprint_renderer/src/renderer.py | Python | bsd-3-clause | 16,781 |
# -*- coding: utf-8 -*-
import collections
import datetime
import tavi.documents
class MongoCommand(object):
def __init__(self, target, **kwargs):
self.target = target
self.kwargs = kwargs
@property
def name(self):
raise "Not Implemented"
def execute(self):
self._now ... | bnadlerjr/tavi | tavi/commands.py | Python | mit | 2,311 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base... | tysonholub/twilio-python | twilio/rest/trunking/v1/trunk/origination_url.py | Python | mit | 17,613 |
from src.fflag import FeatureFlag
import pytest
class ConfigStub():
def __init__(self, input_dict):
self.conf = input_dict
def get(self, sec_name, key_name=None):
if self.conf is None:
raise Exception
if sec_name in self.conf :
if key_name is None:
return self.conf[sec_name]
else:
if key_na... | rchakra3/simple-flask-app | test/test_ff.py | Python | gpl-2.0 | 865 |
# PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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 ap... | cgqyh/pyalgotrade-mod | tools/symbols/get_sp500_symbols.py | Python | apache-2.0 | 2,820 |
import datetime
import sys
import pdb
from directory import directory
if False:
pdb.set_trace() # avoid warning message from pyflakes
class Logger(object):
# from stack overflow: how do i duplicat sys stdout to a log file in python
def __init__(self, logfile_path=None, logfile_mode='w', base_name=No... | rlowrance/re-local-linear | Logger.py | Python | mit | 886 |
"""
Configuration for datadog Django app
"""
from django.apps import AppConfig
from django.conf import settings
from dogapi import dog_http_api, dog_stats_api
class DatadogConfig(AppConfig):
"""
Configuration class for datadog Django app
"""
name = 'openedx.core.djangoapps.datadog'
verbose_name = ... | BehavioralInsightsTeam/edx-platform | openedx/core/djangoapps/datadog/apps.py | Python | agpl-3.0 | 866 |
#!/usr/bin/env python
'''
UBlox binary protocol handling
Copyright Andrew Tridgell, October 2012
Released under GNU GPL version 3 or later
'''
import struct
from datetime import datetime
import time, os
import sys
# specify Python version
if sys.version_info[0] < 3: # we're on python 2.x.x
PYTHON_VERSION = 2
els... | shawn1231/snowflakex-iii | Python/navio2/ublox.py | Python | bsd-3-clause | 39,252 |
#!/usr/bin/env python
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | chrissmall22/odl-client | odlclient/tests/unit/test_datatypes.py | Python | apache-2.0 | 8,243 |
#!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | tst-mswartz/earthenterprise | earth_enterprise/src/server/wsgi/search/common/exceptions.py | Python | apache-2.0 | 1,602 |
__author__ = "Mohammad Dabiri"
__copyright__ = "Free to use, copy and modify"
__credits__ = ["Mohammad Dabiri"]
__license__ = "MIT Licence"
__version__ = "0.0.1"
__maintainer__ = "Mohammad Dabiri"
__email__ = "moddabiri@yahoo.com"
from servo_control.ABE_ServoPi import PWM
from servo_control.ABE_helpers import ABEHelp... | moddabiri/simple_talking_robot | controllers/head/neck/motor.py | Python | mit | 3,834 |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from treemap.tests.base import OTMTestCase
from treemap.models import Role, Plot, Tree
from treemap.lib import perms
from treemap.tests import make_instance, make_officer_user, make_ad... | RickMohr/otm-core | opentreemap/treemap/tests/test_perms.py | Python | agpl-3.0 | 1,734 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | jrha/aquilon | lib/python2.6/aquilon/worker/commands/show_resourcegroup_resourcegroup.py | Python | apache-2.0 | 981 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software... | NoctuaNivalis/qutebrowser | qutebrowser/misc/sql.py | Python | gpl-3.0 | 10,463 |
__author__ = 'Maximilian Bisani'
__version__ = '$LastChangedRevision: 1667 $'
__date__ = '$LastChangedDate: 2007-06-02 16:32:35 +0200 (Sat, 02 Jun 2007) $'
__copyright__ = 'Copyright (c) 2004-2005 RWTH Aachen University'
__license__ = """
This program is free software; you can redistribute it and/or modify... | Louiiiss/ros_asr | src/grammar/mit_g2p_tools/g2p/IterMap.py | Python | gpl-2.0 | 7,066 |
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.views import generic
from django.template import RequestContext, loader
#import models from www if there are any
def index(request):
return ren... | RKD314/yumstat | site_flow/views.py | Python | mit | 497 |
import sys
import time
import uuid
import pandaserver.userinterface.Client as Client
from pandaserver.taskbuffer.JobSpec import JobSpec
from pandaserver.taskbuffer.FileSpec import FileSpec
aSrvID = None
prodUserNameDefault = 'unknown-user'
prodUserName = None
prodUserNameDP = None
prodUserNamePipeline = None
site = '... | PanDAWMS/panda-server | pandaserver/test/lsst/lsstSubmit.py | Python | apache-2.0 | 5,693 |
"""
To set up the OpenShift driver you need
* a workin OpenShift instance
* a user in the OpenShift instance (a separate machine to machine account is
recommended)
1. Start by adding the url, username, password and subdomain in the creds
file. names are "OSO_XXX_URL", where XXX is the name of your installation
(the... | CSC-IT-Center-for-Science/pouta-blueprints | pebbles/drivers/provisioning/openshift_driver.py | Python | mit | 32,797 |
#!/usr/bin/env python
# coding=utf-8
from biplist import *
import os
import subprocess
from util.colorlog import *
#货主PLIST_PATH="/Consignor4ios/Supporting Files/Consignor4ios-Info.plist"
#司机PLIST_PATH="/NewDriver4iOS/NewDriver4iOS/Info.plist"
VERSION_KEY = "CFBundleShortVersionString"
BUILD_VERSON_KEY = "CFBundleVe... | spWang/gitHooks | AutoVersion.py | Python | mit | 6,774 |
# mousepointer.py
# TODO:
# - remove code duplication in LoadImage/LoadStream
import wx
import colordb
import os
import sys
import utils
POINTERS = {
"arrow" : wx.CURSOR_ARROW,
"arrowright" : wx.CURSOR_RIGHT_ARROW,
"bullseye" : wx.CURSOR_BULLSEYE,
"char" : wx.CURSOR_CHAR,
"cross" : wx.CURSOR_CROS... | bblais/plasticity | plasticity/dialogs/waxy/mousepointer.py | Python | mit | 3,190 |
# pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102
"""Tests suite for MaskedArray & subclassing.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
from __future__ import division, absolute_import, print_function
__author__ = "Pierre GF Gerard-Marchant"
import warnings
import pickle
i... | pyparallel/numpy | numpy/ma/tests/test_core.py | Python | bsd-3-clause | 161,025 |
from chaco.api import Plot, ArrayPlotData, PlotAxis
from traits.api import HasTraits, Instance, Bool, Enum
class FrequencyPlot(HasTraits):
plot = Instance(Plot)
plotdata = Instance(ArrayPlotData, ())
def __init__(self, model):
super(FrequencyPlot, self).__init__(model=model)
model.set_plot... | kjordahl/subwoofer | frequency_plot.py | Python | gpl-3.0 | 1,257 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from six.moves.urllib import parse as urlparse
from txlib.http import exceptions
from txlib.http.auth import AnonymousAuth
from txlib.utils import _logger
class BaseRequest(object):
"""Base class for http request classes."""
errors = {
40... | transifex/transifex-python-library | txlib/http/base.py | Python | lgpl-3.0 | 3,037 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from functools import partial
from flask import request
from wtf... | mvidalgarcia/indico | indico/modules/categories/forms.py | Python | mit | 11,501 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | kobejean/tensorflow | tensorflow/contrib/data/python/kernel_tests/unique_dataset_op_test.py | Python | apache-2.0 | 3,320 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-02-26 16:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0006_auto_20180226_1601'),
]
operations = [
migrations.AddField... | flavoi/diventi | diventi/accounts/migrations/0007_auto_20180226_1708.py | Python | apache-2.0 | 1,057 |
# PHD.py
# Aaron Taylor
# Moose Abumeeiz
#
# The PHD ensures you have only positive pills
# when its in the players inventory
#
from pygame import *
from const import *
from Item import *
class PHD(Item):
"""The PHD is used to allow all positive affects on pills"""
collideable = False
pickedUp = False
tWidth... | ExPHAT/binding-of-isaac | PHD.py | Python | mit | 340 |
# Copyright 2021 Alfredo de la Fuente - Avanzosc S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common
from odoo.tests import tagged
@tagged("post_install", "-at_install")
class TestNameCodeYearId(common.SavepointCase):
@classmethod
def setUpClass(cls):
sup... | avanzosc/odoo-addons | event_name_code_year_id/tests/test_event_name_code_year_id.py | Python | agpl-3.0 | 1,353 |
import logging
import os
import time
from datetime import (datetime,
timedelta)
from hashlib import sha1
from datasource.bases.BaseHub import BaseHub
from datasource.DataHub import DataHub
from django.conf import settings
from treeherder.model import utils
logger = logging.getLogger(__name__)
... | avih/treeherder | treeherder/model/derived/refdata.py | Python | mpl-2.0 | 44,367 |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | plaid/plaid-python | plaid/model/processor_identity_get_response.py | Python | mit | 7,268 |
# Django settings for restaurant project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'loc... | dekoza/django-clausula | example_project/restaurant/settings.py | Python | bsd-3-clause | 5,265 |
#
# 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... | spektom/incubator-airflow | tests/providers/google/cloud/operators/test_pubsub.py | Python | apache-2.0 | 7,949 |
# Plots are currently included as images, because example is too big to
# run on readthedocs servers
"""
Cortical depth estimation from MGDM segmentation
=================================================
This example shows how to obtain a cortical laminar depth representation from
an MGDM segmentation result with the ... | nighres/nighres | examples/example_02_cortical_depth_estimation.py | Python | apache-2.0 | 8,890 |
import unittest
from ..play.trade import bf_left
from ..play.trade import bf_right
from ..play.trade import dyn_trader
class TestTrade(unittest.TestCase):
def test_play(self):
p = [4, 9, 1, 3, 8, 7, 1]
check_k_1 = [None, 5, 5, 5, 7, 7, 7]
check_k_2 = [None, None, None, 7, 12, 12, 12]
... | alex-am/pyalgo | pyalgo/test/test_play.py | Python | gpl-3.0 | 831 |
#!/usr/bin/python3
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (C) 2010-2012 Bryce Harrington <bryce@canonical.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to d... | yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/xdiagnose/edid.py | Python | mit | 10,364 |
"""Utilities for the MySQL backend"""
from django.db import connection
#in-memory cached variable
SUPPORTS_FTS = None
def supports_full_text_search():
"""True if the database engine is MyISAM"""
from askbot.models import Question
global SUPPORTS_FTS
if SUPPORTS_FTS is None:
cursor = connection... | aavrug/askbot-devel | askbot/utils/mysql.py | Python | gpl-3.0 | 611 |
# Test cases for VHT operations with hostapd
# Copyright (c) 2014, Qualcomm Atheros, Inc.
# Copyright (c) 2013, Intel Corporation
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import os
import subprocess, time
import... | wangybgit/Chameleon | hostapd-OpenWrt/tests/hwsim/test_ap_vht.py | Python | apache-2.0 | 19,862 |
from waab import SOURCE_ID_PATTERN
def description(req, d):
while SOURCE_ID_PATTERN.search(d):
d = SOURCE_ID_PATTERN.sub(lambda m: req.route_url('source', id=m.group('id')), d)
return d
| clld/waab | waab/util.py | Python | apache-2.0 | 204 |
#! /usr/bin/env python3
""" A Word class
Originally obtained from the 'pharm' repository, but modified.
"""
class Word(object):
doc_id = None
sent_id = None
in_sent_idx = None
word = None
pos = None
ner = None
lemma = None
dep_path = None
dep_parent = None
sent_id = None
... | amwenger/dd-genomics | code/dstruct/Word.py | Python | apache-2.0 | 1,410 |
from SloppyCell.ReactionNetworks import *
net = IO.from_SBML_file('BIOMD0000000049.xml', 'base')
net.compile()
# Add some useful things for plotting
net.add_parameter('total_active_Rap1')
to_sum = [k for k in net.species.keys() if k.count('Rap1_GTP')]
net.add_assignment_rule('total_active_Rap1', ' + '.join(to_sum))
... | GutenkunstLab/SloppyCell | Example/Gutenkunst2007/Sasagawa_2005/Nets.py | Python | bsd-3-clause | 1,555 |
from pygeons.glossary import GLOSSARY
from pygeons.io.io import pygeons_toh5,pygeons_totext,pygeons_info,pygeons_crop,pygeons_merge
from pygeons.plot.plot import pygeons_vector_view,pygeons_strain_view
from pygeons.clean.clean import pygeons_clean
from pygeons.main.main import pygeons_strain,pygeons_reml,pygeons_autocl... | treverhines/PyGeoNS | pygeons/__init__.py | Python | mit | 336 |
from headers import Headers
from url import Url
class Response(object):
"""
The ``Response`` object encapsulates HTTP style responses.
"""
def __init__(self, status, headers=Headers(), content=None,
message=None, request=None):
"""
Construct a new ``Response`` object.
... | XDrake99/IDTP | protocol/http/response.py | Python | mit | 5,596 |
# -*- coding: utf-8 -*-
print '''<!DOCTYPE html><html>'''
incluir(data,"head")
print ''''''
data["detalle"]=False
print ''''''
data["output"]="marco"
print ''''''
data["input"]="btn"
print '''<body class="container-fluid sin-marg pad-r08 pad-l08 ff">'''
incluir(data,"header")
print ''''''
incluir(data,"hero")
print '''... | ZerpaTechnology/AsenZor | apps/votSys2/user/vistas/templates/inscripcionPartido.py | Python | lgpl-3.0 | 844 |
# coding: utf-8
import numpy as np
class NeuralNetwork:
def __init__(self, layer_dims: tuple, *, sigma: float):
self.w, self.b, self.layer_dims = [], [], layer_dims
for i in range(1, len(layer_dims)):
self.w.append(np.random.randn(layer_dims[i], layer_dims[i - 1]) * sigma)
... | gonglinyuan/titanic | NeuralNetwork_old.py | Python | gpl-3.0 | 7,112 |
from contrib import *
from integrations import *
from handlers import *
from models import *
from views import *
from .test_decorators import TestDecoratorErrors
from .test_middleware import TestMiddleware
| Rediker-Software/doac | tests/tests/__init__.py | Python | mit | 206 |
#!/usr/bin/python3
import i3Common
new_workspace = i3Common.choose_workspace()
i3Common.switch_workspace_to_active_display(new_workspace.strip())
| nathanlippi/dotfiles | i3/i3.symlink/choose_workspace_active_display.py | Python | mit | 149 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from sentry.utils.db import is_postgres
class Migration(SchemaMigration):
def forwards(self, orm):
if is_postgres():
# Changing ... | looker/sentry | src/sentry/south_migrations/0285_auto__chg_field_release_project_id__chg_field_releasefile_project_id.py | Python | bsd-3-clause | 92,712 |
#!/usr/bin/env python
###############################################################
# AniConvert: Batch convert directories of videos using
# HandBrake. Intended to be used on anime and TV series,
# where files downloaded as a batch tend to have the same
# track layout. Can also automatically select a single audio
# ... | apsun/AniConvert | aniconvert.py | Python | mit | 34,380 |
from django import forms
from helios.payment.models import PaymentOption
class PaymentForm(forms.Form):
payment_option = forms.ModelChoiceField(
queryset=PaymentOption.objects.all(),
empty_label=None,
widget=forms.RadioSelect(attrs={
'class': 'order',
}),
)
| panosl/helios | helios/payment/forms.py | Python | bsd-3-clause | 313 |
class TestModule(object):
tests=lambda self: {'in': lambda l,v: v in l, '==': lambda a,b: a==b,
'inoreq': lambda l,v: v in l if type(l) is list else v==l,}
| thoto/ansible-role-strongswan | test_plugins/main.py | Python | gpl-3.0 | 173 |
from unittest import TestCase
from gpcook.modules.inspec import generate_inspec_tests
class TestInspec(TestCase):
# Compare output to example adml file
def test_inspec_stub(self):
self.assertTrue(generate_inspec_tests())
| rorychatt/GPCook | tests/modules/inspec_test.py | Python | mit | 240 |
# ext/associationproxy.py
# Copyright (C) 2005-2011 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
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Pyth... | eunchong/build | third_party/sqlalchemy_0_7_1/sqlalchemy/ext/associationproxy.py | Python | bsd-3-clause | 28,675 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_duration,
parse_iso8601,
)
class HuajiaoIE(InfoExtractor):
IE_DESC = '花椒直播'
_VALID_URL = r'https?://(?:www\.)?huajiao\.com/l/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://www.h... | TRox1972/youtube-dl | youtube_dl/extractor/huajiao.py | Python | unlicense | 1,849 |
# ptext module: place this in your import directory.
# ptext.draw(text, pos=None, **options)
# Please see README.md for explanation of options.
# https://github.com/cosmologicon/pygame-text
from __future__ import division
from math import ceil, sin, cos, radians, exp
import pygame
DEFAULT_FONT_SIZE = 2... | gentooza/Freedom-Fighters-of-Might-Magic | src/gamelib/gummworld2/pygametext.py | Python | gpl-3.0 | 21,402 |
import logging
from typing import Dict, List
import pandas as pd
import pytest
from great_expectations.core import (
ExpectationConfiguration,
ExpectationValidationResult,
)
from great_expectations.core.expectation_diagnostics.expectation_test_data_cases import (
ExpectationTestCase,
ExpectationTestDa... | great-expectations/great_expectations | tests/expectations/test_util.py | Python | apache-2.0 | 26,094 |
from typing import Type, Union
class MyClass:
pass
def expects_myclass_or_str1(x: Type[Union[MyClass, str]]):
pass
expects_myclass_or_str1(MyClass)
expects_myclass_or_str1(str)
expects_myclass_or_str1(<warning descr="Expected type 'Type[MyClass | str]', got 'Type[int]' instead">int</warning>)
expects_myclass... | smmribeiro/intellij-community | python/testData/inspections/PyTypeCheckerInspection/ClassObjectTypeWithUnion.py | Python | apache-2.0 | 781 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import test_app.storages
class Migration(migrations.Migration):
dependencies = [
('test_app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='testmodel... | kezabelle/django-storagecellar | test_app/migrations/0002_auto_20151111_1408.py | Python | bsd-2-clause | 693 |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the prioritisetransaction mining RPC."""
import time
from test_framework.messages import COIN, ... | fujicoin/fujicoin | test/functional/mining_prioritisetransaction.py | Python | mit | 7,674 |
# -*- coding: utf-8 -*-
##
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
# This file is part of openmano
# 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 ... | 312v/openmano | openmano/nfvo.py | Python | apache-2.0 | 86,385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.