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 |
|---|---|---|---|---|---|
# Hermite polynomials H_n(x) on the real line for n=0,1,2,3,4
f0 = lambda x: hermite(0,x)
f1 = lambda x: hermite(1,x)
f2 = lambda x: hermite(2,x)
f3 = lambda x: hermite(3,x)
f4 = lambda x: hermite(4,x)
plot([f0,f1,f2,f3,f4],[-2,2],[-25,25]) | pducks32/intergrala | python/sympy/doc/src/modules/mpmath/plots/hermite.py | Python | mit | 240 |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for changes affecting tools/perf/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about th... | Just-D/chromium-1 | tools/perf/PRESUBMIT.py | Python | bsd-3-clause | 4,403 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import urllib
import json
import time
import os
#rootPath = os.getcwd() + "/wikiWomensStats/"
#dataPath = rootPath + 'data.json'
fullDataPath = 'data.json'
headers = { 'User-Agent' : 'Womens edit a thon India' }
cmtitle = "वर्गः:महिला-लेखाभियानम् २०१५"
apiUr... | tshrinivasan/wiki_women_edit_stats | samskrit/update_json.py | Python | gpl-2.0 | 3,942 |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.StreamView.as_view(), name='dash'),
url(r'^manager/$', views.ManagerView.as_view(), name='manager'),
url(r'^manager/delete/$', views.deletePost, name='deletepost'... | CMPUT404W17T06/CMPUT404-project | dash/urls.py | Python | apache-2.0 | 1,043 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Active Directory Enumerator',
# l... | adaptivethreat/EmPyre | lib/modules/template.py | Python | bsd-3-clause | 3,978 |
#!/usr/bin/python
import qb
qb.run()
| drjod/tUNIX | qb/run.py | Python | gpl-3.0 | 41 |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
'''
Copyright 2016,暗夜幽灵 <darknightghost.cn@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,... | darknightghost/console-debugger | adapters/gdb/adapter.py | Python | gpl-3.0 | 989 |
"""
WSGI config for ldap_rest_service project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPL... | nanshu/ldap_rest_service | ldap_rest_service/ldap_rest_service/wsgi.py | Python | mit | 1,582 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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
#
# ... | lexxito/monitoring | ceilometer/tests/test_collector.py | Python | apache-2.0 | 6,841 |
# -*- coding: utf-8 -*-
"""The FSI for dropbox."""
# this module is named 'DropBox' instead of 'dropbox' to avoid a
# naming conflict.
import os
import logging
import stat
import tempfile
import dropbox
from stashutils.fsi.errors import OperationFailure, IsDir, IsFile
from stashutils.fsi.errors import AlreadyExists
f... | ywangd/stash | lib/stashutils/fsi/DropBox.py | Python | mit | 12,191 |
from skylines.model.geo import Location
class Waypoint(Location):
def __init__(self):
super(Waypoint, self).__init__()
self.altitude = 0
self.name = ''
self.short_name = ''
self.icao = ''
self.country_code = ''
self.surface = None
self.runway_len = ... | kerel-fs/skylines | skylines/lib/waypoints/waypoint.py | Python | agpl-3.0 | 656 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#É adimensional?
adi = False
#É para salvar as figuras(True|False)?
save = True
#Caso seja para salvar, qual é o formato desejado?
formato = 'jpg'
#Caso seja para salvar, qual é o diretório que devo salvar?
dircg = 'fig-sen'
#Caso seja para salvar, qual é o nome do arquivo... | asoliveira/NumShip | scripts/plot/beta-velo-r-zz-plt.py | Python | gpl-3.0 | 3,130 |
from netforce.model import get_model
from netforce import migration
from netforce.database import get_connection
class Migration(migration.Migration):
_name="stock.stock_journal"
_version="1.115.0"
def migrate(self):
res=get_model("stock.journal").search([])
if res:
print("Stoc... | sidzan/netforce | netforce_stock/netforce_stock/migrations/stock_journal.py | Python | mit | 1,123 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
""" This module contains dictionaries with sets of parameters for a
given cosmology.
Each cosmology has the following parameters defined:
========== =====================================
Oc0 Omega cold dark matter at z=0
Ob0 ... | StuartLittlefair/astropy | astropy/cosmology/parameters.py | Python | bsd-3-clause | 5,618 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | EmreAtes/spack | var/spack/repos/builtin/packages/py-natsort/package.py | Python | lgpl-2.1 | 2,087 |
# client code here
import socket
PORT = 5050
HEADER = 64
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = 'utf-8'
DISCONNECT_MESSAGE = "!!!DISCONNECTED"
| elsuizo/Python_work_git | Sockets/client.py | Python | gpl-3.0 | 188 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation. 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... | subramani95/neutron | neutron/tests/unit/nec/test_trema_driver.py | Python | apache-2.0 | 13,518 |
# Include this module into a population script.
# Remember to setup the django environment before calling populate().
import os
import uuid
import xml.etree.ElementTree as etree
from chords.models import Artist, Song, User, Comment
DATA_PATH = os.path.join(os.path.dirname(__file__), 'data.xml')
def str_to_bool(s):... | Ilias95/guitarchords | chords/fixtures/populate_data.py | Python | mit | 2,215 |
"""
Parse Python files and output a unified list of imported symbols.
The imported modules/symbols are output even if they cannot be found. (You
could try to do this with grep, but this is more accurate because it uses the
AST to obtain the list of imports.)
"""
# This file is part of the Snakefood open source packag... | GreatFruitOmsk/snakefood | lib/python/snakefood/list.py | Python | gpl-2.0 | 2,664 |
from OpenGLCffi.GL import params
@params(api='gl', prms=['source', 'type', 'severity', 'count', 'ids', 'enabled'])
def glDebugMessageControl(source, type, severity, count, ids, enabled):
pass
@params(api='gl', prms=['source', 'type', 'id', 'severity', 'length', 'buf'])
def glDebugMessageInsert(source, type, id, seve... | cydenix/OpenGLCffi | OpenGLCffi/GL/EXT/KHR/debug.py | Python | mit | 2,870 |
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2020 Samuele Carcagno <sam.carcagno@gmail.com>
# This file is part of pychoacoustics
# pychoacoustics 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,... | sam81/pychoacoustics | pychoacoustics/dialog_show_exp_doc.py | Python | gpl-3.0 | 3,078 |
# Copyright 2009-2014 MongoDB, 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 or agreed to in writin... | llvtt/mongo-python-driver | tools/fail_if_no_c.py | Python | apache-2.0 | 842 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | sxjscience/tvm | python/tvm/contrib/debugger/debug_runtime.py | Python | apache-2.0 | 8,310 |
"""
Module that checks if the current directory
is a git repository or is within one
"""
import sys
import subprocess
from sub_proc import _check_output
try:
_check_output(['git', '-C', '.', 'rev-parse'])
remotes = _check_output(['git', 'remote', '-v'])
if sys.argv[1] in remotes:
print("True")
... | NOhs/git_info | git_info/check_in_git_repository.py | Python | mit | 407 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
### Create tsi.src format from original taigime.txt
### filtering out the non-chinese output
###
import os
import sys
import re
finals = [ 'a' , 'e', 'i', 'o', 'u', 'm' ]
final_dict = { 'a': [ 'a', 'a', 'á', 'à', 'a', 'â', 'ǎ', 'ā', 'a̍', 'a̋' ],
'e': [ 'e', '... | bbyykk/libtaigi | data/create-tsi.py | Python | lgpl-2.1 | 3,468 |
{
'name': 'Product warehouse',
'summary': 'Force product/category warehouse on sale, purchase and manufacturing orders',
'version': '10.0.2.0',
"author": 'DVIT.ME',
'category': 'Warehouse',
'license': 'AGPL-3',
'website': "http://www.dvit.me",
'depends': ['sale_stock',
... | mohamedhagag/dvit-odoo | dvit_product_warehouse/__manifest__.py | Python | agpl-3.0 | 516 |
import numpy as np
class BirthDeathFeatures(object):
def __init__(self, dynamic_persistence):
self.dp = dynamic_persistence.dynamic_persistence
self.smap = dynamic_persistence.simplex_map
self.evaluator = dynamic_persistence.rips.eval
def extract(self):
features = []
for node in self.dp:
... | nonabelian/tda_dionysus | topology/feature_extraction.py | Python | gpl-3.0 | 814 |
# use priority queue to implement stack and queue
import heapq
class stack:
data = []
highestPriority = 0
lowestPriority = 0
def push(self, e):
self.highestPriority -= 1 # smaller value means priority is higher
heapq.heappush(self.data, (self.highestPriority, e))
def pop(self):... | yubinbai/python_practice | priorityqueue.py | Python | apache-2.0 | 1,718 |
from cssypy.nodes import *
from cssypy import datatypes, errors
from .. import base
#==============================================================================#
class Node_TestCase(base.TestCaseBase):
def test_unknown_kwargs(self):
with self.assertRaises(ValueError) as cm:
Node(unknown_kw... | colossalbit/cssypy | cssypy/tests/nodes/test_nodes.py | Python | bsd-3-clause | 2,726 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#É adimensional?
adi = False
#É para salvar as figuras(True|False)?
save = True
#Caso seja para salvar, qual é o formato desejado?
formato = 'jpg'
#Caso seja para salvar, qual é o diretório que devo salvar?
dircg = 'fig-sen'
#Caso seja para salvar, qual é o nome do arquivo... | asoliveira/NumShip | scripts/plot/acel-r-zz-plt.py | Python | gpl-3.0 | 2,416 |
# Orca
#
# Copyright 2006-2008 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This... | ruibarreira/linuxtrail | usr/lib/python3/dist-packages/orca/orca_platform.py | Python | gpl-3.0 | 1,405 |
#!/usr/bin/env Python
"""
Tables Extension for Python-Markdown
====================================
Added parsing of tables to Python-Markdown.
A simple example:
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Copyright 2009 - [Wa... | yeyanchao/calibre | src/calibre/ebooks/markdown/extensions/tables.py | Python | gpl-3.0 | 3,161 |
#! /usr/bin/python
# Copyright 2015 Kevin Lynch
#
# 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 agre... | klynch/collectd-chronos | chronos.py | Python | apache-2.0 | 2,703 |
"""
Test the __init__ module.
"""
import os
import sys
import unittest
import tempfile
import importlib
# Testing the local package
here = os.path.dirname(__file__)
packdir = os.path.abspath(os.path.join(here, os.pardir))
sys.path.insert(0, packdir)
import dwdat2py
DATAFILE1 = os.path.join(here, 'Example_Drive01.d7d... | tomnor/dwdat2py | tests/test_init.py | Python | apache-2.0 | 3,770 |
# -*- coding: utf-8 -*-
import logging
from time import time
from google.appengine.api import apiproxy_stub_map
request_arrive_time = 0
db_count = 0
db_time = 0
db_start_time = 0
def before_db(service, call, request, response):
global db_count, db_start_time
db_count += 1
db_start_time = time()
... | vvoody/doodle_fork | hook.py | Python | mit | 716 |
from nose.tools import *
from pysb.core import Model, SelfExporter
import pickle
def with_model(func):
"""Decorate a test to set up and tear down a Model."""
def inner(*args, **kwargs):
model = Model(func.func_name, _export=False)
# manually set up SelfExporter, targeting func's globals
... | alubbock/pysb-legacy | pysb/testing/__init__.py | Python | bsd-2-clause | 2,346 |
# -*- coding: utf-8 -*-
#!/usr/bin/python
__doc__ = '''
Reasonable Python
A module for integrating F-logic into Python
py2f.py --- converting Python objects into Flora2 F-molecules
by Markus Schatten <markus_dot_schatten_at_foi_dot_hr>
Faculty of Organization and Informatics,
Varaždin, Croatia, 2007
This libr... | johannesloetzsch/reasonablepy | rp/py2f.py | Python | lgpl-2.1 | 11,566 |
from operator import itemgetter
def encrypt(text, key):
txt = list(text)
for i in range(len(txt)):
txt[i] = chr(ord(txt[i]) + key)
return ''.join(txt)
def decrypt(cipherText, key):
txt = list(cipherText)
for i in range(len(txt)):
txt[i] = chr(ord(txt[i]) - key)
return ''.join... | jaydeep17/crypto | src/caesarCipher.py | Python | mit | 1,580 |
# -*- coding: utf-8 -*-
"""Super class for server/client configuration"""
from abc import ABCMeta, abstractmethod
class Config(metaclass=ABCMeta):
@abstractmethod
def __init__(self, *settings):
"""Initialize the configuration object by the given settings.
The settings are stored into a dict""... | westial/restfulcomm | restfulcomm/configurations/superconfiguration.py | Python | gpl-3.0 | 552 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import DLFramework
| DaveL17/matplotlib | matplotlib.indigoPlugin/Contents/Server Plugin/DLFramework/__init__.py | Python | mit | 67 |
from __future__ import unicode_literals
from copy import copy
import difflib
import errno
from functools import wraps
import json
import os
import re
import sys
import select
import socket
import threading
import unittest
from unittest import skipIf # Imported here for backward compatibility
from unittest.util... | makinacorpus/django | django/test/testcases.py | Python | bsd-3-clause | 49,061 |
# 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/.
from django.conf.urls import url
from bedrock.mozorg.util import page
from bedrock.newsletter import views
# A UUID lo... | flodolo/bedrock | bedrock/newsletter/urls.py | Python | mpl-2.0 | 2,235 |
"""
********************************************************************************
* Name: Gssha File Object Base
* Author: Nathan Swain
* Created On: August 2, 2013
* Copyright: (c) Brigham Young University 2013
* License: BSD 2-Clause
********************************************************************************
... | CI-WATER/gsshapy | gsshapy/base/file_base.py | Python | bsd-3-clause | 10,173 |
# 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
# distrib... | BjoernT/python-openstackclient | openstackclient/network/common.py | Python | apache-2.0 | 1,715 |
"""
Data models for the EHP Portfolios Private Comments application.
@author: Sam Pottinger
@license: GNU GPL v3
"""
from google.appengine.ext import db
class UserInfo(db.Model):
"""Data model for application specific user information."""
email = db.StringProperty()
safe_email = db.StringProperty()... | Samnsparky/ehp_private_comments | models.py | Python | gpl-3.0 | 7,637 |
#
# http://www.namecheap.com/
#
# https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-to-use-the-browser-to-dynamically-update-hosts-ip
from pydyndnsclient.protocols.protobase import DDCP
import pydyndnsclient.common as common
import re
class DDCP_NameCheap(DDCP):
def __init__(self):
se... | DerSaidin/ddpyient | pydyndnsclient/protocols/namecheap.py | Python | mit | 2,822 |
#!/usr/bin/python
#(2 ways)Saves highlighting & delete time by printing out
#just the users on a system.
#d3hydr8[at]gmail[dot]com
import sys
if len(sys.argv) != 2:
print "Usage: ./passext.py </etc/passwd file>"
sys.exit(1)
pwfile = sys.argv[1]
try:
pws = open(pwfile, "r")
except(IOError):
print "Error: Che... | knightmare2600/d4rkc0de | misc/passext.py | Python | gpl-2.0 | 616 |
import discord
from discord.ext import commands
class Admin (commands.Cog):
def __init__ (self, bot):
self.bot = bot
self.owner = None
@commands.command(pass_context=True,hidden=True)
async def load (self,ctx,module):
"""Loads a bot module."""
module = "plugins."+module
... | archie-m-vist/urist-dicehammer | plugins/admin.py | Python | gpl-3.0 | 3,365 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lobbyapp', '0011_remove_lobby_curr_users_count'),
]
operations = [
migrations.AddField(
model_name='lobby',
... | nikmoon/test | lobbyapp/migrations/0012_lobby_curr_users_count.py | Python | gpl-3.0 | 420 |
# Copyright 2015: Mirantis 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 required b... | amit0701/rally | rally/common/plugin/plugin.py | Python | apache-2.0 | 7,159 |
#!/usr/bin/env python
# Copyright (C) 2009 Martin Sandve Alnes
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | MiroK/dolfin | site-packages/dolfin_utils/pjobs/torque.py | Python | gpl-3.0 | 2,196 |
from funtests import transport
class test_redis(transport.TransportCase):
transport = "redis"
prefix = "redis"
def after_connect(self, connection):
client = connection.channel().client
client.info()
def test_cant_connect_raises_connection_error(self):
conn = self.get_connecti... | mzdaniel/oh-mainline | vendor/packages/kombu/funtests/tests/test_redis.py | Python | agpl-3.0 | 399 |
#!/usr/bin/python2.4
#
# Copyright 2007 The Python-Twitter Developers
#
# 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... | erikdejonge/newsrivr | www_newsrivr_com/twitterpythonapiwrapper.py | Python | gpl-2.0 | 116,682 |
#
# Editor lua interface wrapped into python functions
#
def search(lua):
deviceList = lua.require("util.LiveReloadServer").search(2)
pyDevices = []
for k, v in deviceList.items():
pyDevices.append({"ip" : v.ip, "name" : v.name})
return pyDevices
def reloadFile(lua, workingDir, path, deviceIP... | Vavius/moai-ide | editor/luainterface.py | Python | mit | 596 |
"""
Nose plugin to restrict access to blacklisted os modules.
Activate by running nosetests --with-ospatch or like this in local settings:
NOSE_PLUGINS = [
'amo.tests.ospatch.OSPatch',
]
NOSE_ARGS = [
'--with-ospatch',
]
This was originally made to
help identify code that needed ... | wagnerand/zamboni | apps/amo/tests/ospatch.py | Python | bsd-3-clause | 4,635 |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
# Create your models here.
@python_2_unicode_compatible # only if you need to support Python 2
class Question(models.Model):
questio... | Chasego/nie | proj/libdemo/django/mysite/polls/models.py | Python | gpl-3.0 | 910 |
# this file is intended to be edited by the user running the script.
#
# by editing this file you can easily change whether the scripts are run from the local machine
# that is, on the raspberry pi itself
# or from another computer on the network
#
# if you are running the scripts on the raspberry pi, then set address ... | cheapjack/MemoryCraft | server.py | Python | mit | 1,062 |
"""
Script for removing all redundant Mac OS metadata files (with filename ".DS_Store"
or with filename which starts with "._") for all courses
"""
import logging
from django.core.management.base import BaseCommand
from xmodule.contentstore.django import contentstore
log = logging.getLogger(__name__)
class Comma... | stvstnfrd/edx-platform | cms/djangoapps/contentstore/management/commands/cleanup_assets.py | Python | agpl-3.0 | 1,319 |
#coding: utf-8
from urllib import urlencode
from GJDB import GJDB
dicType = {'租房':'fang1','个人':'a1','合租':'fang3','写字楼':'fang8','商铺':'fang6'}
othersKws = open('othersKws.txt','r').readlines()
result = open('SEMURLresult.txt','w')
def getCityDistrictStreet(sql=''):
management = GJDB()
management.m... | hfutsuchao/Python2.6 | SEM/SEMURLtwice.py | Python | gpl-2.0 | 10,511 |
import time
from itertools import count
from zope.interface import implements
from twisted.internet import defer
from twisted.python import failure
from twisted.internet.interfaces import IPushProducer, IConsumer
from foolscap.api import eventually, fireEventually, DeadReferenceError, \
RemoteException
from allm... | pombredanne/tahoe-lafs | src/allmydata/mutable/retrieve.py | Python | gpl-2.0 | 42,245 |
# Copyright 2013 Google, Inc. or its affiliates. All Rights Reserved.
#
# 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, ... | jonparrott/botocore | botocore/gcpcrypto.py | Python | mit | 5,682 |
# Copyright 2016 Susan Bennett, David Mitchell, Jim Nicholls
#
# This file is part of AutoHolds.
#
# AutoHolds 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 opt... | SydneyUniLibrary/auto-holds | sierra/migrations/0001_initial.py | Python | gpl-3.0 | 1,534 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import time
from .defaults import ELAPSED_TIME_FORMAT
from .generators import generate_oid
from .prefix import make_prefix, join_prefix
class DirectPrefixInjector(object):
__slots__ = ['prefix', 'enter_time', ]
def __init__(se... | oblalex/isotopic-logging | isotopic_logging/injectors.py | Python | lgpl-3.0 | 2,136 |
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | sigmavirus24/glance | glance/tests/functional/test_bin_glance_cache_manage.py | Python | apache-2.0 | 11,530 |
"""
Tests for @cfunc and friends.
"""
from __future__ import division, print_function, absolute_import
import ctypes
import os
import subprocess
import sys
import numpy as np
from numba import unittest_support as unittest
from numba import cfunc, carray, farray, types, typing, utils
from numba import cffi_support
f... | stefanseefeld/numba | numba/tests/test_cfunc.py | Python | bsd-2-clause | 12,287 |
# encoding: utf-8
# This module monkey patches the docx library to add support for Windows Enhanced Metafile images (EMF)
# Put in a local folder and "import docx_emf_patch" to enable EMF support.
from __future__ import absolute_import, division, print_function
import docx
from docx.image.exceptions import Unrecogniz... | ROCmSoftwarePlatform/rocFFT | scripts/perf/perflib/docx_emf_patch.py | Python | mit | 3,040 |
#!/usr/bin/env python
# Copyright (c) 2015 Peter Cerno
#
# 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, ... | petercerno/good-morning | good_morning/__init__.py | Python | mit | 1,657 |
# vi: ts=4 sw=4
import numpy
import uci.Ptcls as Ptcls
import pyopencl as cl
import pyopencl.array as cl_array
import sys
import os
class BorisUpdater():
def __init__(self, ctx = None, queue = None):
self.ctx = ctx
self.queue = queue
if self.ctx == None:
self.ctx = cl.create_... | Tech-XCorp/ultracold-ions | uci/BorisUpdater.py | Python | mit | 1,450 |
# coding=UTF-8
# Copyright (c) 2010-2011 openpyxl
#
# 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... | Jian-Zhan/customarrayformatter | openpyxl/writer/drawings.py | Python | mit | 11,175 |
"""
WSGI config for sensuconfigs project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... | Numerical-Brass/sensu-configs | sensuconfigs/wsgi.py | Python | mit | 1,437 |
"""
Acceptance tests for studio related to the outline page.
"""
from datetime import datetime, timedelta
import itertools
from pytz import UTC
from bok_choy.promise import EmptyPromise
from ...pages.studio.overview import CourseOutlinePage, ContainerPage, ExpandCollapseLinkState
from ...pages.studio.utils import add_... | jelugbo/tundex | common/test/acceptance/tests/studio/test_studio_outline.py | Python | agpl-3.0 | 70,143 |
from typing import Any
from docutils import nodes
def set_role_source_info(inliner: Any, lineno: int, node: nodes.Node):
"""From sphinx, for intersphinx"""
node.source, node.line = inliner.reporter.get_source_and_line(lineno)
| tony/django-docutils | django_docutils/references/rst/utils.py | Python | mit | 237 |
__author__ = 'Călin Sălăgean'
import unittest
class TestEventController(unittest.TestCase):
def test_index(self):
pass | dooma/Events | spec/controllers/test_event.py | Python | mit | 135 |
'''
Created on May 17, 2011
@author: Keith Robertson
'''
import unittest
import api
class Test(unittest.TestCase):
def setUp(self):
self.xmlDoc = api.parse("isodomain.xml")
self.domainAry = self.xmlDoc.get_storage_domain()
pass
def tearDown(self):
pass
def tes... | anjalshireesh/gluster-ovirt-poc | backend/manager/tools/engine-tools-common-lib/src/rhev/schemas/isotest.py | Python | apache-2.0 | 1,621 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | Codlydodly/python-client | venv/lib/python2.7/site-packages/pyglet/gl/gl_info.py | Python | mit | 6,603 |
import bootstrap3.forms
from jinja2 import Markup
from jinjadp.utils import safe_rendering
@object.__new__
class bootstrap:
def __getattr__(self, name):
setattr(
self,
name,
safe_rendering(
getattr(
bootstrap3.forms,
... | afg984/happycoding | jinjadp/bootstrap.py | Python | mit | 1,014 |
# Copyright 2016 ASLP@NPU. 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 applicable law or ag... | npuichigo/voicenet | src/export_inference_graph.py | Python | apache-2.0 | 6,966 |
__doc__ = 'Interface to qt webkit for parsing JavaScript dependent webpages'
import sys
import os
import re
import urllib2
import random
from time import time, sleep
from datetime import datetime
# for using native Python strings
import sip
sip.setapi('QString', 2)
from PyQt4.QtGui import QApplication, QDesktopServic... | Hack42/BusNotifier | webscraping/webkit.py | Python | mit | 21,179 |
#!/usr/bin/env python
from icqsol.bem.icqPotentialIntegrals import PotentialIntegrals
from icqsol.bem.icqLaplaceMatrices import getFullyQualifiedSharedLibraryName
import numpy
def testObserverOnA(order):
paSrc = numpy.array([0., 0., 0.])
pbSrc = numpy.array([1., 0., 0.])
pcSrc = numpy.array([0., 1., 0.])
... | gregvonkuster/icqsol | tests/testPotentialIntegrals.py | Python | mit | 3,128 |
# coding: utf-8
"""
Paasta API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
impor... | Yelp/paasta | paasta_tools/paastaapi/model/integer_and_error.py | Python | apache-2.0 | 6,718 |
#!/usr/bin/env python
from setuptools import setup, find_packages
from pgsearch import __version__
long_description = """
Django app for making PostgreSQL full text search queries
See more on: https://github.com/akszydelko/django-pg-search
Copyright (c) 2017, Arkadiusz Szydełko All rights reserv... | akszydelko/django-pg-search | setup.py | Python | bsd-3-clause | 1,423 |
"""
Test basic std::vector functionality but with a declaration from
the debug info (the Foo struct) as content.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDbgInfoContentVector(TestBase):
mydir = TestBase.compute_mydir(__file__)... | apple/swift-lldb | packages/Python/lldbsuite/test/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVector.py | Python | apache-2.0 | 1,822 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licens... | pombredanne/python-cabarchive | fix-checksum.py | Python | lgpl-2.1 | 1,555 |
import asyncio
import aiofoomodules.handlers
from aiofoomodules.utils import get_simple_body
class Pong(aiofoomodules.handlers.AbstractHandler):
RESPONSE_MAP = {
"ping": "pong",
"gnip": "gnop",
}
def analyse_message(self, ctx, message):
body = get_simple_body(message).strip().low... | horazont/xmpp-crowd | aiofoomodules/misc.py | Python | mit | 633 |
import time
from unittest.mock import MagicMock
from unittest.mock import patch
from cauldron.ui import statuses
@patch('time.time')
@patch('cauldron.session.writing.step_writer.serialize')
@patch('cauldron.session.writing.save')
@patch('cauldron.project.get_internal_project')
def test_get_status(
get_inter... | sernst/cauldron | cauldron/test/ui/statuses/test_get_status.py | Python | mit | 2,655 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.coils import CoilHeatingWater
log = logging.getLogger(__name__)
class TestCoilHeatingWater(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstem... | rbuffat/pyidf | tests/test_coilheatingwater.py | Python | apache-2.0 | 4,432 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "orchids.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | igrowing/Orchids | manage.py | Python | mit | 805 |
from askbot.models import Message
from askbot.models import User
from askbot.models import ImportedObjectInfo
from askbot.models import ImportRun
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
from django.conf import settings as django_settings
from ... | knowledgepoint-devs/askbot-devel | askbot/management/commands/base.py | Python | gpl-3.0 | 13,547 |
from django.core.management.base import BaseCommand
from devilry.devilry_compressionutil.models import CompressedArchiveMeta
class Command(BaseCommand):
help = 'Delete compressed archives.'
def add_arguments(self, parser):
parser.add_argument(
'--days',
dest='days',
... | devilry/devilry-django | devilry/devilry_superadmin/management/commands/devilry_delete_compressed_archives.py | Python | bsd-3-clause | 2,091 |
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2012-17, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup... | j-carl/ansible | lib/ansible/plugins/lookup/template.py | Python | gpl-3.0 | 5,755 |
# Copyright 2012, 2013 by the Micromagnum authors.
#
# This file is part of MicroMagnum.
#
# MicroMagnum 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) a... | MicroMagnum/MicroMagnum | src/magnum/config.py | Python | gpl-3.0 | 9,403 |
from gwpy.timeseries import TimeSeries # load the class
gwdata = TimeSeries.fetch_open_data('H1', 968654552, 968654562) # fetch data from LOSC
plot = gwdata.plot() # make a plot
ax = plot.gca() # extract the Axes object
ax.set_ylabel('Gravitational-wave amplitude [strain]') # set the label for the Y-axis
ax.set_ti... | gwpy/gwpy.github.io | docs/v0.1/timeseries/index-1.py | Python | gpl-3.0 | 405 |
import logging
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterable,
List,
Optional,
Set,
Tuple,
Type,
Union,
cast,
)
from urllib.parse import quote_plus
import pydantic
from sqlalchemy import create_... | linkedin/WhereHows | metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py | Python | apache-2.0 | 31,618 |
# 132. Palindrome Partitioning II QuestionEditorial Solution My Submissions
# Total Accepted: 58982
# Total Submissions: 256833
# Difficulty: Hard
# Given a string s, partition s such that every substring of the partition is a palindrome.
#
# Return the minimum cuts needed for a palindrome partitioning of s.
#
# Fo... | shawncaojob/LC | QUESTIONS/132_palindrome_partitioning_ii.py | Python | gpl-3.0 | 1,362 |
"""
Generate classes from a specification and generate the class declaration code
"""
from datetime import datetime, timedelta
import inspect
from valid_model.base import Object, ObjectMeta
from valid_model.descriptors import (
String, Integer, Bool, Dict, List, TimeDelta, DateTime, Set, Generic
)
class ObjectPrinter... | outbrain/valid_model | examples/dynamic_code.py | Python | mit | 4,083 |
# coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# 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 la... | tensorflow/agents | tf_agents/agents/tf_agent_test.py | Python | apache-2.0 | 6,832 |
#!/usr/bin/python
# Copyright 2008-2010 WebDriver committers
# Copyright 2008-2010 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-... | onedox/selenium | py/test/selenium/webdriver/common/implicit_waits_tests.py | Python | apache-2.0 | 3,524 |
import time
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of... | hcrlab/access_teleop | rosbridge_suite/rosbridge_library/src/rosbridge_library/internal/ros_loader.py | Python | mit | 7,340 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | toomoresuch/pysonengine | parts/google_appengine/google/appengine/ext/mapreduce/quota.py | Python | mit | 4,989 |
from __future__ import absolute_import, print_function, unicode_literals
from io import BytesIO
import warnings
try:
from unittest import mock
except ImportError:
import mock
try:
import msgpack
HAVE_MSGPACK = True
except:
warnings.warn(
"Cannot import msgpack. It is necessary for using ... | pystorm/pystorm | test/pystorm/serializers/test_msgpack_serializer.py | Python | apache-2.0 | 1,997 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.