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/env python
"""AFF4 Objects to enforce ACL policies."""
import email
import re
import urllib
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import email_alerts
from grr.lib import events
from grr.lib import flow
from grr.lib import rdfvalue
from grr.... | pidydx/grr | grr/lib/aff4_objects/security.py | Python | apache-2.0 | 35,585 |
from armor.graphics import specContour
from armor.initialise import *
import pickle, os
import numpy as np
import matplotlib.pyplot as plt
# COMPREF
#inputFolder = dp.root + 'labLogs2/powerSpec3/1404707377.16COMPREF_Rainband_March_2014/'
inputFolder = "C:/yau/1404716726.06COMPREF_Rainband_March_2014/"
outputFolder = i... | yaukwankiu/armor | tests/contourPlotTest.py | Python | cc0-1.0 | 7,007 |
from django.conf import settings
from django.forms import widgets
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django.forms.util import flatatt
class GoogleMapsAddressWidget(widgets.TextInput):
"a widget that will place a google map right after the #id_address... | desarrollosimagos/svidb | administrativo/django_google_maps/widgets.py | Python | gpl-3.0 | 1,168 |
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | VisTrails/VisTrails | vistrails/db/versions/v1_0_1/persistence/sql/sql_dao.py | Python | bsd-3-clause | 6,946 |
# lint-amnesty, pylint: disable=missing-module-docstring
from .outlines import (
get_content_errors,
get_course_keys_with_outlines,
get_course_outline,
get_user_course_outline,
get_user_course_outline_details,
key_supports_outlines,
replace_course_outline,
)
| eduNEXT/edx-platform | openedx/core/djangoapps/content/learning_sequences/api/__init__.py | Python | agpl-3.0 | 287 |
"""Support to interact with a Music Player Daemon."""
from datetime import timedelta
import logging
import os
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
MEDIA_TYPE_PLA... | fbradyirl/home-assistant | homeassistant/components/mpd/media_player.py | Python | apache-2.0 | 10,629 |
"""
Messages - file ``/var/log/messages``
=====================================
Reads the ``/var/log/messages`` file as a standard LogFileOutput class parser.
The important function is ``get(s)``, which finds all lines with the string
**s** and parses them into dictionaries with the following keys:
* ``timestamp`` -... | PaulWay/insights-core | insights/parsers/messages.py | Python | apache-2.0 | 3,079 |
# 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... | ppwwyyxx/tensorflow | tensorflow/tools/docs/generate2.py | Python | apache-2.0 | 8,840 |
#!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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
# ... | lanyuwen/openthread | tests/scripts/thread-cert/v1_2_test_backbone_router_service.py | Python | bsd-3-clause | 12,234 |
import asyncio
import json
import os
import pytest
import shakedown
import shlex
import time
import uuid
import sys
import retrying
from datetime import timedelta
from dcos import http, mesos
from dcos.errors import DCOSException, DCOSHTTPException
from distutils.version import LooseVersion
from json.decoder import JS... | guenter/marathon | tests/system/common.py | Python | apache-2.0 | 29,268 |
# -*- coding: utf-8 -*-
# yellowbrick.features.pca
# Decomposition based feature visualization with PCA.
#
# Author: Carlo Morales
# Author: Raúl Peralta Lozada
# Author: Benjamin Bengfort
# Created: Tue May 23 18:34:27 2017 -0400
#
# Copyright (C) 2017 The scikit-yb developers
# For license information, see LIC... | DistrictDataLabs/yellowbrick | yellowbrick/features/pca.py | Python | apache-2.0 | 22,996 |
"""
CacheItem interface:
'_id': string,
'url': string,
'response_url': string,
'body': string,
'head': string,
'response_code': int,
'cookies': None,#grab.response.cookies,
TODO: WTF with cookies???
"""
from __future__ import absolute_import
from hashlib import sha1
import zlib
import logging
import MySQLdb
import mar... | boooka/GeoPowerOff | venv/lib/python2.7/site-packages/grab/spider/cache_backend/mysql.py | Python | apache-2.0 | 7,771 |
# 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/.
from socorro.lib import MissingArgumentError, external_common
from socorro.external.postgresql.base import PostgreSQLBas... | Tayamarn/socorro | socorro/external/postgresql/signature_first_date.py | Python | mpl-2.0 | 1,181 |
# 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... | AndreasMadsen/tensorflow | tensorflow/python/ops/math_grad.py | Python | apache-2.0 | 32,638 |
"""Test the Dexcom config flow."""
from pydexcom import AccountError, SessionError
from homeassistant.components.dexcom.const import DOMAIN
from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED
from tests.async_mock import patch
from tests.common import MockConfigEntry
from tests.compone... | tchellomello/home-assistant | tests/components/dexcom/test_init.py | Python | apache-2.0 | 1,894 |
import copy
import numbers
from collections import Hashable
from functools import partial
from bson import ObjectId, json_util
from bson.dbref import DBRef
from bson.son import SON
import pymongo
import six
from mongoengine import signals
from mongoengine.base.common import get_document
from mongoengine.base.datastru... | Pablo126/SSBW | Entrega1/lib/python3.5/site-packages/mongoengine/base/document.py | Python | gpl-3.0 | 42,028 |
#!/usr/bin/env python
import io
import netCDF4
import numpy
import m6plot
import m6toolbox
import os
import sys
def run():
try: import argparse
except: raise Exception('This version of python is not new enough. python 2.7 or newer is required.')
parser = argparse.ArgumentParser(description='''Script for plottin... | nicjhan/MOM6-examples | tools/analysis/SST_monthly_bias_WOA05.py | Python | gpl-3.0 | 5,253 |
# 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 ... | rjschwei/azure-sdk-for-python | azure-mgmt-dns/azure/mgmt/dns/models/soa_record.py | Python | mit | 2,124 |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | protochron/aurora | src/main/python/apache/aurora/executor/thermos_task_runner.py | Python | apache-2.0 | 15,490 |
# PopGen 1.1 is A Synthetic Population Generator for Advanced
# Microsimulation Models of Travel Demand
# Copyright (C) 2009, Arizona State University
# See PopGen/License
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class ClickTool(QgsMapTool):
def __init__... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/synthesizer/gui/misc/pointSelectTool.py | Python | gpl-2.0 | 1,035 |
# Sample client program to communicate with gpsim
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("", 0x1234))
s.send("help\n")
print s.recv(20)
# helper functions
def ParseInt(buf):
if buf[0:3] == "$03" :
return eval("0x"+buf[3:11])
return 0
# Symbol Command
s.sen... | WellDone/gpsim | src/examples/scripts/testgensquares.py | Python | gpl-2.0 | 1,495 |
# -*- coding: utf-8 -*-
class DataType(object):
def __init__(self, type, preprocessor=None):
self.type = type
self.preprocessor = preprocessor
def preprocess(self, value):
return self.preprocessor(value) if self.preprocessor else value
def serialize(self, value):
return ... | aa403/betfair.py | betfair/meta/datatype.py | Python | mit | 514 |
# pyv8_print_fn is actually in pyv8run.py and is added to the Globals
def printFunc(objs, newline):
JS("""
var s = "";
for(var i=0; i < @{{objs}}.length; i++) {
if(s != "") s += " ";
s += @{{objs}}[i];
}
@{{pyv8_print_fn}}(s);
""")
# pyv8_import_modu... | minghuascode/pyj | library/pyjslib.PyV8.py | Python | apache-2.0 | 10,519 |
''' Selection Module '''
from flask import Blueprint, jsonify, abort, request
from karmaserver.constants import MAX_KARMA_LEVEL, MAX_FILTER_LEVEL
from karmaserver.data.content_resolver import content_resolver
from karmaserver.modules.selection.provider import ObservationSelectionProvider
from karmaserver.utils import... | mnunezdm/cazasteroides | karmaserver/modules/selection/__init__.py | Python | mit | 1,789 |
#!/usr/bin/env python
#
# This file is part of the Fun SDK (fsdk) project. The complete source code is
# available at https://github.com/luigivieira/fsdk.
#
# Copyright (c) 2016-2017, Luiz Carlos Vieira (http://www.luiz.vieira.nom.br)
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtai... | luigivieira/fsdk | fsdk/reports/immersion.py | Python | mit | 3,652 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import Node, Way, Relation, Member
class OSMFactory(object):
'''Subclass and implement to create basic OSM types'''
def createNode(self, id):
return Node(id)
def createWay(self, id):
return Way(id)
def createRelation(self, id):
... | larroy/osmcompiler | osm/factory.py | Python | agpl-3.0 | 425 |
from pudzu.charts import *
df = pd.read_csv("datasets/flagshearts.csv")
groups = list(remove_duplicates(df.group))
array = [[dict(r) for _,r in df.iterrows() if r.group == g] for g in groups]
data = pd.DataFrame(array, index=list(remove_duplicates(df.group)))
FONT = calibri or sans
fg, bg="black", "#EEEEEE"
default_i... | Udzu/pudzu | dataviz/flagshearts.py | Python | mit | 2,052 |
from __future__ import division
import numbers
import numpy as np
from numpy.lib.stride_tricks import as_strided
from warnings import warn
__all__ = ['view_as_blocks', 'view_as_windows']
def view_as_blocks(arr_in, block_shape):
"""Block view of the input n-dimensional array (using re-striding).
Blocks are n... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/skimage/util/shape.py | Python | gpl-3.0 | 8,436 |
#HOW TO RUN: change variables if wanted - lines 12-13 - and run without arguments
from threading import Thread, Semaphore
from time import sleep
import sys
from collections import deque
# Thread safe print
printf = lambda x: sys.stdout.write("%s\n" % x)
## Main setup
n_leaders = 2
n_followers = 5
##
## Advanced set... | ThomasDq/xv6OS | python/src/2_dance_mixer.py | Python | mit | 6,735 |
# -*- coding: utf-8 -*-
from math import *
from hotspin import *
Nx = 512
Ny = 512
Nz = 1
sX = 512e-9
sY = 512e-9
sZ = 15e-9
csX = sX / Nx
csY = sY / Ny
csZ = sZ / Nz
# set mesh size
setgridsize(Nx, Ny, Nz)
# set cell size
setcellsize(csX, csY, csZ)
# enable PBC in-plane
setperiodic(1, 1, 0)
# load heat equation... | godsic/hotspin | examples/heat-diffusion.py | Python | gpl-3.0 | 1,484 |
#!/usr/bin/env python
#Copyright (C) 2009-2011 by Benedict Paten (benedictpaten@gmail.com)
#
#Released under the MIT license, see LICENSE.txt
import unittest
import os
import xml.etree.ElementTree as ET
from sonLib.bioio import TestStatus
from sonLib.bioio import getLogLevelString
from cactus.shared.test import getC... | benedictpaten/cactus | src/cactus/reference/cactus_referenceTest.py | Python | mit | 2,803 |
import copy
import inspect
import os
import sys
import unittest
import uuid
rootDirectory = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if rootDirectory not in sys.path:
sys.path.insert(0, rootDirectory)
from oxford.emotion import Emotion
class TestEmotion(unittest.TestCase):
'''Tests the pr... | chidochipotle/oxford | tests/test_emotion.py | Python | mit | 2,094 |
""" The bellman ford algorithm for calculating single source shortest
paths - CLRS style """
graph = {
's' : {'t':6, 'y':7},
't' : {'x':5, 'z':-4, 'y':8 },
'y' : {'z':9, 'x':-3},
'z' : {'x':7, 's': 2},
'x' : {'t':-2}
}
INF = float('inf')
dist = {}
predecessor = {}
def initialize_single_source(gr... | Bernardinhouessou/Projets_Autres | Python-Projets/Scripts/Algorithms-master/dp/bellman_ford.py | Python | mit | 1,115 |
__author__ = 'zhyf'
import numpy as np
# import numpy as n
import sys
import getopt as opt
from util import *
from math import sqrt, ceil, floor
import os
from gpumodel import IGPUModel
import random as r
import numpy.random as nr
from convnet import ConvNet
from options import *
from PIL import Image
import pickle
# ... | wells-chen/Based-on-Machine-learning-for-Door-recongnition | Trainning for door/show_test_pic.py | Python | gpl-2.0 | 15,738 |
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
#
# Copyright (C) 2006 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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; ve... | carlgao/lenga | images/lenny64-peon/usr/share/python-support/python-sepolgen/sepolgen/refpolicy.py | Python | mit | 24,797 |
from __future__ import absolute_import, division, print_function
import pandas as pd
from toolz import partial
from dask.base import compute
def _categorize_block(df, categories):
""" Categorize a dataframe with given categories
df: DataFrame
categories: dict mapping column name to iterable of categori... | jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/dask/dataframe/categorical.py | Python | mit | 1,158 |
#########################################################################
# Uniprot XML parser to parse phosphorylation info of proteins
#
# eg 29/07/2009
#########################################################################
#from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import iterparse... | quimaguirre/diana | diana/toolbox/parse_uniprot.py | Python | mit | 9,091 |
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2015
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Ge... | steve-ord/daliuge | daliuge-translator/dlg/dropmake/scheduler.py | Python | lgpl-2.1 | 48,617 |
# Copyright 2011 OpenStack Foundation
# Copyright 2011 Ilya Alekseyev
#
# 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
#
#... | scripnichenko/nova | nova/tests/unit/test_nova_manage.py | Python | apache-2.0 | 25,186 |
import functools
import os
import re
from pathlib import Path
from typing import Optional, Union
from future import __annotations__
from .classes import *
class ValidateBusinessMails:
'''
This class provides 3 properties and 2 independent functions
- Properties: email, email_verifier, business_e... | LoginRadius/business-email-validator | dist/python-wrapper/business-email-validator/validate_class.py | Python | gpl-2.0 | 3,872 |
#coding=utf-8
import time
import sys
import requests
sys.path.append('/home/workDir/hubi/auto-btc')
from Util import *
from key import *
'''
获取账号详情
'''
def getAccountInfo(method):
timestamp = long(time.time())
params = {"access_key": ACCESS_KEY,"secret_key": SECRET_KEY, "created": timestamp,"method":method}... | bupt075225/auto-btc | HuobiService.py | Python | mit | 6,500 |
from bs4 import BeautifulSoup as BS4
import json
with open('list.html', 'r', encoding='utf-8') as node_f:
node_file = BS4(node_f, 'lxml')
node_list = node_file.find_all('li')
for i in node_list:
print(i.a.text + ', http://data.taichung.gov.tw/wSite/' + i.a.get('href'))
| OpenData-TW/DataPackage-DGTW | Datasets/taichung.gov.tw/getlist.py | Python | mit | 281 |
# -*- coding: utf-8 -*-
#
# Citizens Agenda documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 23 14:11:37 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | oysnet/czagenda-api | docs/conf.py | Python | bsd-3-clause | 7,106 |
from django.contrib import admin
from django.urls import include, path
from . import views
urlpatterns = [
path("", views.home, name="home"),
path("<str:game_name>", views.home, name="home"),
path("admin/", admin.site.urls),
]
| GoogleCloudPlatform/serverless-expeditions | cloud-run-django-terraform/gametracker/urls.py | Python | apache-2.0 | 240 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Lucas Huber, Copyright CoĐoo Project
# based on account_wallet by Yannick Buron, Copyright Yannick Buron
#
# This program is free software: you can redistribute it and/or modify
# it under the ... | moneygrid/vertical-exchange | exchange/__old/res_config.py | Python | gpl-3.0 | 9,110 |
#!/usr/bin/env python
## @package artnet_light_control
# Documentation for this module.
#
# More details.
"""
To activate a specific settings for the application, run:
source env/bin/activate
export APP_SETTINGS="config.DevelopmentConfig"
OR export APP_SETTINGS="config.ProductionConfig"
OR export AP... | nbremond77/Artnet_dmx_controler | Artnet_light_control.py | Python | gpl-3.0 | 17,388 |
# Portions Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# sshserver.py - ssh protocol server support for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
# Copyright 2006 Vadim Gelfer... | facebookexperimental/eden | eden/hg-server/edenscm/mercurial/sshserver.py | Python | gpl-2.0 | 4,778 |
from setuptools import setup, find_packages
entry_points = {} # {'console_scripts': ['wanderbits = wanderbits:main']}
with open('readme.md', 'r') as fi:
long_description = fi.read()
# Do it.
setup(name='HackingForMovieTrends',
description='Quick examples of playing with movie data.',
long_descript... | Who8MyLunch/HackingForMovieTrends | setup.py | Python | mit | 953 |
import json
import aiohttp
async def version_check(ev):
version_url = 'https://api.lucia.moe/data/version'
async with aiohttp.ClientSession() as session:
async with session.get(version_url) as version_data:
data = await version_data.read()
data = json.loads(data)
official_... | AXAz0r/apex-sigma-core | sigma/modules/core_functions/system/version_check.py | Python | gpl-3.0 | 1,064 |
"""
RefererMiddleware: populates Request referer field, based on the Response which
originated it.
"""
from scrapy.http import Request
class RefererMiddleware(object):
def process_spider_output(self, response, result, spider):
def _set_referer(r):
if isinstance(r, Request):
r.h... | mzdaniel/oh-mainline | vendor/packages/scrapy/scrapy/contrib/spidermiddleware/referer.py | Python | agpl-3.0 | 440 |
import sys
from django.apps import apps
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.dispatch import Signal
from ..utils.autoupdate import Element, inform_changed_elements
# This signal is send when the migrat... | emanuelschuetze/OpenSlides | openslides/core/signals.py | Python | mit | 3,069 |
#!/usr/bin/env python
from email.Utils import formatdate
from string import Template
from argparse import ArgumentParser
from hashlib import sha1
import subprocess
import base64
parser = ArgumentParser(description='Create an appcast XML file from a template')
parser.add_argument('--bundle_file','-f',
required=T... | bevacqua/gitx | updates/appcast.py | Python | gpl-2.0 | 1,571 |
from test_support import *
prove_all(opt=["-cargs", "-gnato13"])
prove_all()
| ptroja/spark2014 | testsuite/gnatprove/tests/N122-016__switches/test.py | Python | gpl-3.0 | 78 |
# Copyright 2020 Google LLC.
#
# 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 list of conditions and the following disclaimer.
#
#... | google/deepvariant | scripts/run_deepvariant.py | Python | bsd-3-clause | 19,921 |
import os, sys
from fabric.api import task
from management.shell import cpR, stream
from management.settings import settings
conf = settings(__package__,strip_leading=1)
from .stylesheets import buildcss
#def compile_js(src,dst=None):
#if dst is not None:
##stream("browserify "+src,program=True).pipe("... | jonathanverner/circular | management/web/deploy.py | Python | mit | 1,545 |
from django.conf import settings
from django.contrib.auth.hashers import get_hasher
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.core.validators import RegexValidator
from django.db import models
from era import random_str
from era.utils.translation import _, verbose_choices
from... | doctorzeb8/django-era | era/apps/user/models.py | Python | mit | 1,997 |
#! /usr/bin/python
#
# Copyright 2009, 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
import errno
import grp
import os
import pwd
import socket
import subprocess
import sys
import tempfile
from lazr.config import as_username_groupname
f... | abramhindle/UnnaturalCodeFork | python/testdata/launchpad/buildmailman.py | Python | agpl-3.0 | 7,591 |
"""
models
~~~~~~
Module containing all of our models that are typically
accessed in a CRUD like manner.
"""
from ..models.base import Model as BaseModel
from ..models.default_schema import Model as DefaultSchemaModel
from ..models.login import Model as LoginModel
MODELS = [
BaseModel,
Defau... | sassoo/goldman | goldman/models/__init__.py | Python | mit | 353 |
# -*- coding: utf-8 -*-
# __author__ = '磊'
from django.db import models
import datetime
class User(models.Model):
username = models.CharField(max_length=50)
password = models.CharField(max_length=200)
nickname = models.CharField(max_length=10)
email = models.EmailField()
phone = models.CharField(... | GavinZhuLei/GavinsDjango | mysite/gauth/models.py | Python | apache-2.0 | 2,086 |
#!/usr/bin/env python
"""
Parse vt100 input and print keys.
For testing terminal input.
(This does not use the `Input` implementation, but only the `Vt100Parser`.)
"""
import sys
from prompt_toolkit.input.vt100 import raw_mode
from prompt_toolkit.input.vt100_parser import Vt100Parser
from prompt_toolkit.keys import K... | jonathanslenders/python-prompt-toolkit | tools/debug_vt100_input.py | Python | bsd-3-clause | 642 |
"""
The objects used by the site module to add custom builtins.
"""
# Those objects are almost immortal and they keep a reference to their module
# globals. Defining them in the site module would keep too many references
# alive.
# Note this means this module should also avoid keep things alive in its
# globa... | Orav/kbengine | kbe/src/lib/python/Lib/_sitebuiltins.py | Python | lgpl-3.0 | 3,218 |
# -*- 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
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.tagline'
db.add_column(u'product_product', 'tagli... | AmandaCMS/amanda-cms | amanda/product/migrations/0002_auto__add_field_product_tagline__chg_field_product_slug__add_unique_pr.py | Python | mit | 2,908 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | mbohlool/client-python | kubernetes/client/models/v1_replication_controller_list.py | Python | apache-2.0 | 6,919 |
build_config = {
"folders": [
u'call'
]
}
| ohio813/alpha3 | x86/latin_1/mixedcase/getpc/build_config.py | Python | bsd-3-clause | 55 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import datetime
import logging
from six import python_2_unicode_compatible
from django.core import validators
from django.db import models
from django.db.backends.base.operations import BaseDatabaseOperations
from django.utils.encoding i... | saxix/django-excel-data-sync | src/excel_data_sync/columns.py | Python | mit | 14,232 |
"""
This is the config file for GSEA, containing various parameters the user may
wish to modify.
"""
path = dict(
input = 'data',
output = 'data',
)
analysis = dict(
rankby = 's2n',
permut = 1000,
p_weight = 1.0
) | tristanbrown/gsea | gsea/config.py | Python | mit | 245 |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from wordnik import *
import settings
class Keyword(models.Model):
name = models.CharField(max_length=200, unique=True) # case sensitive - lowercased on save()
created = models.DateTimeField(auto_... | Architizer/mendel | mendel/models.py | Python | agpl-3.0 | 3,850 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models47488.py | Python | gpl-3.0 | 17,589 |
import pytoolkit as tk
module = tk.applications.darknet53
def test_model():
model = module.create(input_shape=(256, 256, 3), weights=None)
assert tuple(module.get_1_over_1(model).shape[1:3]) == (256, 256)
assert tuple(module.get_1_over_2(model).shape[1:3]) == (128, 128)
assert tuple(module.get_1_over... | ak110/pytoolkit | pytoolkit/applications/darknet53_test.py | Python | mit | 752 |
from django.template.base import Context, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import SilentAttrClass, SilentGetItemClass, SomeClass, setup
basic_templates = {
'basic-syntax01': 'something cool',
'basic-syntax02': '{{ headline }}',
'basic-syntax03': '{{ first }} --- {{ s... | DONIKAN/django | tests/template_tests/syntax_tests/test_basic.py | Python | bsd-3-clause | 12,382 |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.4 or later
Recommended: CJKCodecs and iconv_codec <http://cjkpytho... | Arno-Nymous/pyload | module/lib/feedparser.py | Python | gpl-3.0 | 167,083 |
'''
Basic implementation of an emulator of Chip8 in python
to research low level purpose
More info about tech spec: http://en.wikipedia.org/wiki/CHIP-8
or http://es.wikipedia.org/wiki/CHIP-8
'''
__author__ = "Martin Dimondo"
__license__ = "Revised BSD"
__email__ = "martin.dimondo@gmail.com"
f... | martindimondo/PyC8 | chip8/cpu.py | Python | bsd-3-clause | 2,879 |
#!/usr/bin/env python
"""Core library to build and test the random forest."""
from __future__ import division
import numpy as np
from multiprocessing import Manager, cpu_count
from parallel import Worker, Task, retrieve
from base import Node, Leaf
__author__ = "Andrea Casini"
__copyright__ = "Copyright 2014"
__li... | bluesurfer/pyforest | pyforest/forest.py | Python | mit | 6,795 |
#!/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 node disconnect and ban behavior"""
import time
from test_framework.mininode import wait_until
fr... | earonesty/bitcoin | test/functional/disconnect_ban.py | Python | mit | 5,635 |
from django.core.urlresolvers import resolve, reverse
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from pretix.base.signals import logentry_display
from pretix.control.signals import nav_event
@receiver(nav_event, dispatch_uid="sendmail_nav")
def control_nav_import(sen... | Flamacue/pretix | src/pretix/plugins/sendmail/signals.py | Python | apache-2.0 | 2,026 |
"""
(C) Copyright 2009 Igor V. Custodio
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
any later version.
This program is distributed in the hope that it will b... | davidvon/pipa-pay-server | admin/posplat/test/example2.py | Python | apache-2.0 | 2,173 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
import logging
from django.utils.translation import ugettext as _
from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit, ... | pignacio/vld_django | vld_django/recipes/forms.py | Python | gpl-3.0 | 2,236 |
import _ast
import collections
from cStringIO import StringIO
import re
import sys
import os
from icbd.util import ast_utils, cfa
from icbd.type_analyzer import builtins, type_checker, type_system
from . import closure_analyzer, usage_checker, phi_analyzer
from .type_conversion import InferredTypeOutput
from .code_em... | kmod/icbd | icbd/compiler/codegen.py | Python | mit | 63,826 |
#!/usr/bin/env /usr/bin/python
# Copyright 2013-2014 Clayton Smith (argilo@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, either version 3 of the License, or
# (at your option) an... | argilo/sdr-examples | atsc-b200.py | Python | gpl-3.0 | 2,908 |
from __future__ import absolute_import
try:
from sklearn.model_selection import cross_val_predict as _orig_cross_val_predict
except ImportError:
from sklearn.cross_validation import cross_val_predict as _orig_cross_val_predict
import pandas as pd
from .._xy_estimator import make_estimator, make_xy
from .._uti... | atavory/ibex | ibex/sklearn/_cross_val_predict.py | Python | bsd-3-clause | 5,032 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
These are the user properties.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from twisted.protocols.amp import Command
#, String, Integer, ListOf, Boolean, DateTime
#from ...types import ObjHash, ObjSig, ObjPubKey, ObjAddress, ObjBlo... | congredi/congredi | congredi/commands/proofs/user.py | Python | gpl-3.0 | 4,897 |
from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import *
from rest_framework_json_api.utils import format_relation_name, get_resource_type_from_instance, \
get_resource_type_from_serializer
class ResourceIdentifierObjectSerializer(BaseSerializer):
default_error_message... | hnakamur/django-rest-framework-json-api | rest_framework_json_api/serializers.py | Python | bsd-2-clause | 3,036 |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2012-2014 Peter Williams <peter@newton.cx> and collaborators.
# Licensed under the MIT License.
"""A simple parser for ini-style files that's better than Python's
ConfigParser/configparser.
Functions:
read
Generate a stream of `pwkit.Holder` instances from an ini-f... | pkgw/pwkit | pwkit/inifile.py | Python | mit | 10,056 |
import matplotlib
matplotlib.use('WXAgg')
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
import CoolProp
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure(figsize=(2, 2))
ax = fig.add_subplot(111, projection='3d')
NT = 1000
NR = 1000
rho, t = np.logspace(np.log10(2e-3), np.log10(1... | CoolProp/CoolProp | Web/scripts/logo_2013.py | Python | mit | 1,263 |
# 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... | wainersm/buildbot | master/buildbot/test/unit/test_data_changes.py | Python | gpl-2.0 | 15,376 |
#!/usr/bin/env python
from game import Game
if __name__== '__main__':
game=Game()
game.mainloop()
| panthorstudios/Gold-Rush | goldrush.py | Python | mit | 110 |
# -*- coding: utf-8 -*-
import logging
import re
from streamlink.compat import html_unescape, unquote
from streamlink.exceptions import PluginError
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents, validate
from streamlink.stream import HLSStream, HTTPStream, RTMPStream
from streamlink... | wlerin/streamlink | src/streamlink/plugins/okru.py | Python | bsd-2-clause | 3,774 |
# -*- coding: utf-8 -*-
# Copyright (C) 2009 - Jesse van den Kieboom
#
# 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 vers... | GNOME/gedit | plugins/quickopen/quickopen/__init__.py | Python | gpl-2.0 | 5,861 |
# Copyright 2017-2018 Aaron C. Prunty
#
# 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 agree... | aaronprunty/starfish | vezda/setDataPath.py | Python | apache-2.0 | 13,566 |
"""Unit tests for the SonarQube source."""
from .base import SonarQubeTestCase
class SonarQubeSecurityWarningsTest(SonarQubeTestCase):
"""Unit tests for the SonarQube security warnings collector."""
METRIC_TYPE = "security_warnings"
def setUp(self):
"""Extend to set up SonarQube security warnin... | ICTU/quality-time | components/collector/tests/source_collectors/sonarqube/test_security_warnings.py | Python | apache-2.0 | 5,049 |
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 y... | diorcety/translate | translate/storage/txt.py | Python | gpl-2.0 | 5,443 |
import warnings
import numpy as np
from numpy.polynomial.hermite_e import HermiteE
from scipy.special import factorial
from scipy.stats import rv_continuous
import scipy.special as special
# TODO:
# * actually solve (31) of Blinnikov & Moessner
# * numerical stability: multiply factorials in logspace?
# * ppf & frie... | statsmodels/statsmodels | statsmodels/distributions/edgeworth.py | Python | bsd-3-clause | 6,678 |
import os.path
import unittest
import urllib
from io import StringIO
from unittest import mock
from django.conf import settings
from django.core.files.base import ContentFile
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
from wagtail.documents import ... | wagtail/wagtail | wagtail/documents/tests/test_views.py | Python | bsd-3-clause | 14,403 |
# yellowbrick.classifier.rocauc
# Implements visual ROC/AUC curves for classification evaluation.
#
# Author: Rebecca Bilbro <rbilbro@districtdatalabs.com>
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Author: Neal Humphrey
# Created: Wed May 18 12:39:40 2016 -0400
#
# Copyright (C) 2017 Distric... | pdamodaran/yellowbrick | yellowbrick/classifier/rocauc.py | Python | apache-2.0 | 20,061 |
from __future__ import with_statement
import json
import logging
import os
import sys
import textwrap
from os.path import join, normpath
from tempfile import mkdtemp
import pretend
import pytest
from pip._internal.req import InstallRequirement
from pip._internal.utils.misc import rmtree
from tests.lib import assert_... | RonnyPfannschmidt/pip | tests/functional/test_uninstall.py | Python | mit | 17,973 |
#!/usr/bin/env python
from __future__ import with_statement
from hvad.test_utils.cli import configure
from hvad.test_utils.tmpdir import temp_dir
import argparse
import sys
def main(test_runner='hvad.test_utils.runners.NormalTestRunner', junit_output_dir='.',
time_tests=False, verbosity=1, failfast=False, te... | promil23/django-hvad | runtests.py | Python | bsd-3-clause | 2,140 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sys import stdin
from decimal import Decimal, getcontext
__author__ = 'litleleprikon'
def main():
getcontext().prec = 6
last_key, count, last_sum = None, 0, Decimal(0.0)
for line in stdin:
key, value = line.split('\t', maxsplit=1)
if l... | litleleprikon/bachelor_paper | reducer.py | Python | mit | 669 |
#!/usr/bin/python
#
# Copyright 2018 Carl Anderson
#
# 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 ... | barabo/advanced-shell-history | python/ash_query.py | Python | apache-2.0 | 11,682 |
from __future__ import print_function, division
import numpy as np
import pytest
import sys
import chronostar.likelihood
sys.path.insert(0,'..')
from chronostar import expectmax as em
from chronostar.synthdata import SynthData
from chronostar.component import SphereComponent
from chronostar import tabletool
from ch... | mikeireland/chronostar | unit_tests/test_unit_expectmax.py | Python | mit | 6,240 |
# -*- coding: utf-8 -*-
"""
-------------------------------------
N A C S P Y T H O N S C R I P T
-------------------------------------
NACS version: 2.0.2745 - pre3
NACS architecture: CENTOS 5.11 (X86_64)
File generated at Tue Jan 20 16:55:05 2015
On host 'lse86' by 'cae42'
"""
from __future__ import division ... | cosailer/caeproject | simulation_result/3/project3_harmonic_sub.py | Python | gpl-2.0 | 1,987 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.