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 -*-
#
##################################################################################
#
# Copyright 2016-2017 Félix Brezo and Yaiza Rubio (i3visio, contacto@i3visio.com)
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the term... | i3visio/osrframework | osrframework/wrappers/pending/pinterest.py | Python | agpl-3.0 | 4,064 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# Copyright (C) 2012 Raphaël Valyi - Akretion ... | rodrigoasmacedo/l10n-brazil | __unported__/l10n_br_sale/sale.py | Python | agpl-3.0 | 21,824 |
from copy import copy
from functools import reduce
import numpy as np
class Die(object):
def __init__(self, sides):
self.multiplier = 1
self.sides = sides
def __repr__(self):
return 'd%i' % self.sides
def __mul__(self, other):
assert isinstance(other, int), "Must multipl... | danni/dice-stats | dice.py | Python | bsd-2-clause | 2,656 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2019 Edgewall Software
# Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://... | rbaumg/trac | trac/loader.py | Python | bsd-3-clause | 11,004 |
import pytest
from libturpial.api.models.profile import Profile
class TestProfile:
@classmethod
@pytest.fixture(autouse=True)
def setup_class(self, monkeypatch):
self.profile = Profile()
self.profile.username = 'foo'
self.profile.account_id = 'foo-twitter'
self.profile.full... | satanas/libturpial | tests/models/test_profile.py | Python | gpl-3.0 | 1,860 |
#!/usr/bin/python
from __future__ import division
# We need the following two lines in order for matplotlib to work
# without access to an X server.
import matplotlib, sys
if 'show' not in sys.argv:
matplotlib.use('Agg')
from pylab import *
from scipy.special import erf
import os, glob
import styles
matplotlib.rc('... | droundy/deft | papers/fuzzy-fmt/figs/homogeneous.py | Python | gpl-2.0 | 7,805 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('esg_leipzig_homepage_2015', '0002_event_css_class_name'),
]
operations = [
migrations.AlterField(
model_name='me... | normanjaeckel/Homepage-2015 | esg_leipzig_homepage_2015/migrations/0003_auto_20150405_2051.py | Python | mit | 504 |
#!/usr/bin/env python
# Email notification
# Contributor:
# pseudokool <pseudokool@gmail.com>
import config
import smtplib
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.header import Header
from email.utils import formataddr
class SendMail:
def __in... | pseudokool/no7ify | sendmail275.py | Python | artistic-2.0 | 1,203 |
# -*- coding: utf-8 -*-
"""
Модуль с классами, предназначенными для загрузки страницы из интернета
или эмуляции этого процесса
"""
import os.path
import urllib.request
import urllib.error
from outwiker.utilites.textfile import readTextFile
class NormalLoader(object):
"""
Класс для загрузки страницы из интер... | unreal666/outwiker | plugins/updatenotifier/updatenotifier/loaders.py | Python | gpl-3.0 | 1,097 |
import os
import multiprocessing
import re
# pre: A fasta file name, an output base name
# post: Index is built at the base name
# modifies: Creates index files
def build_bowtie2_index(fasta_filename,base_name):
cmd = 'bowtie2-build '+fasta_filename+' '+base_name
os.system(cmd)
# pre: <reads filename... | jason-weirather/IDP-fusion-release-1 | bin/aligner_basics.py | Python | apache-2.0 | 923 |
import json
import os
from gettext import gettext as _
from PIL import Image
from lutris import settings
from lutris.services.base import BaseService
from lutris.services.service_game import ServiceGame
from lutris.services.service_media import ServiceMedia
from lutris.util import system
from lutris.util.dolphin.cach... | lutris/lutris | lutris/services/dolphin.py | Python | gpl-3.0 | 3,291 |
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
enable_verbose_mode, is_verbose_mode, get_target_arch
from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd
SOURCE_ROOT = os.p... | arturts/electron | script/bootstrap.py | Python | mit | 7,117 |
from platypus import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
if __name__ == '__main__':
# setup the experiment
problem = DTLZ2(3)
algorithms = [NSGAII,
(NSGAIII, {"divisions_outer":12}),
(CMAES, {"epsilons":[0.05]}),
... | Project-Platypus/Platypus | examples/comparison.py | Python | gpl-3.0 | 1,437 |
import regex as re
import sys
from types import GeneratorType
import unicodedata
from . import ignore_parens
def strip_ws(text, **kwargs):
return text.strip()
def pre_process(text):
text = re.sub('(?<=\d)\s+(?=\d)', '', text)
text = re.sub('\s*\.{3,}\s*', ' … ', text)
text = re.sub('\s+', ' ', text... | longnow/panlex-tools | libpython/gary/text_filter.py | Python | mit | 3,673 |
import os
import sys
import time
waiting_for_file = sys.argv[1]
attempts = 60
while not os.path.isfile(waiting_for_file):
if attempts <= 0:
raise Exception("File was never written.")
attempts -= 1
sys.stderr.write("Waiting for file {}\n".format(waiting_for_file))
time.sleep(1)
| tdyas/pants | testprojects/src/python/coordinated_runs/waiter.py | Python | apache-2.0 | 303 |
from django.contrib import admin
from bootcamp.core import models
class CoreAdmin(admin.ModelAdmin):
pass
admin.site.register(models.Count, CoreAdmin)
| Wang-Sen/nqzx-backend | bootcamp/core/admin.py | Python | gpl-3.0 | 157 |
#!/usr/bin/python
import sys
import requests
from bs4 import BeautifulSoup
soup = BeautifulSoup(requests.get('http://www.soupson.ca/?lang=en').text, "lxml")
menu = ""
for row in soup.find_all("div", class_="entry-content")[0].find_all("p")[1:]:
menu += row.string.encode('ascii', 'ignore') + "\n"
if len(sys.argv... | streetturtle/soupson-time | python/soupson.py | Python | mit | 398 |
from django.http.request import QueryDict
from django.utils.http import urlencode
def get_form_with_post_data(form_class, data, **kwargs):
"""Gets a form instance with posted data.
:param form_class: the form class to create the instance for
:param data: the dict data to pass to the form
"""
... | InfoAgeTech/django-testing | django_testing/forms.py | Python | mit | 397 |
#!/usr/bin/env py.test
"""Unit tests for FunctionSpace with constrained domain"""
# Copyright (C) 2012-2014 Garth N. Wells
#
# 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 Softwa... | MiroK/dolfin | test/unit/python/function/test_constrained_function_space.py | Python | gpl-3.0 | 5,208 |
from . import product_template
from . import sale_order
from . import sale_order_line
| OCA/sale-workflow | sale_order_lot_generator/models/__init__.py | Python | agpl-3.0 | 86 |
#!/usr/bin/env python
## \file parallel_computation.py
# \brief Python script for doing the continuous adjoint computation using the SU2 suite.
# \author T. Economon, T. Lukaczyk, F. Palacios
# \version 6.1.0 "Falcon"
#
# The current SU2 release has been coordinated by the
# SU2 International Developers Society <w... | drewkett/SU2 | SU2_PY/parallel_computation.py | Python | lgpl-2.1 | 4,309 |
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | viktorTarasov/PyKMIP | kmip/tests/unit/core/factories/test_attribute_values.py | Python | apache-2.0 | 14,378 |
from scipy.stats import fisk
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
c = 3.09
mean, var, skew, kurt = fisk.stats(c, moments='mvsk')
# Display the probability density function (``pdf``):
x = np.linspace(fisk.ppf(0.01, c),
fisk.ppf(0.99, c), 100)
a... | platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-stats-fisk-1.py | Python | gpl-2.0 | 1,051 |
#!/usr/bin/env python
#a Documentation
"""
"""
#a Imports
import time
import server_threads
import world
#a Toplevel
#b Create world
world = world.c_world()
#b Set up world, server and client threads and start them
threads = server_threads.c_server_client_thread_set()
threads.add_signal_handler()
threads.create_thre... | embisi-github/gjslib | python/gjslib/math/server.py | Python | apache-2.0 | 546 |
# Copyright (c) 2019 PaddlePaddle 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 app... | chengduoZH/Paddle | python/paddle/fluid/tests/unittests/ngraph/test_cross_entropy_ngraph_op.py | Python | apache-2.0 | 924 |
import os
import yaml
from ConfigParser import ConfigParser as cp
path = os.environ['HOME'] + "/.config/sflphone/sflphonedrc"
# path = "sflphonedrc"
c = cp()
c.read(path)
accnodes = ['srtp', 'tls', 'zrtp']
auxnodes = ['alsa', 'pulse', 'dtmf']
dico = {}
dico['accounts'] = []
# Dictionary used to convert s... | max3903/SFLphone | tools/ini2yaml.py | Python | gpl-3.0 | 5,631 |
# -*- coding: utf-8 -*-
import os
import shutil
from mutagen.trueaudio import TrueAudio, delete
from mutagen.id3 import TIT1
from tests import TestCase, DATA_DIR
from tempfile import mkstemp
class TTrueAudio(TestCase):
def setUp(self):
self.audio = TrueAudio(os.path.join(DATA_DIR, "empty.tta"))
def... | douglaskastle/mutagen | tests/test_trueaudio.py | Python | gpl-2.0 | 1,544 |
from django.conf.urls.defaults import *
from example.forms import AutoCompleteOrderedItemForm, OrderedItemForm, ContactFormset, MaxFiveContactsFormset, EmptyContactFormset, EventFormset
from example.forms import AutoCompleteSelectFieldForm
urlpatterns = patterns('example.views',
url(r'^stacked/$', 'formset', {'for... | shearichard/spellsplash | splsplsh_project/static/js/django-dynamic-formset-master/demo/example/urls.py | Python | gpl-3.0 | 2,173 |
"""
Views handling read (GET) requests for the Discussion tab and inline discussions.
"""
from functools import wraps
import json
import logging
import xml.sax.saxutils as saxutils
from django.contrib.auth.decorators import login_required
from django.core.context_processors import csrf
from django.contrib.auth.models... | cyanna/edx-platform | lms/djangoapps/django_comment_client/forum/views.py | Python | agpl-3.0 | 20,685 |
#!/usr/bin/python2
# -*- coding: utf-8
#
## @package makeprojecttikz
#
# Script to (re)create all tikz plots
# from the .s*p files in #sourcedir
# and comparison plots with all .s*p files
# in subfolders of #sourcedir.
#
# Resulting .tikz files are exported to #resultdir.
#
# @date Created on 27.04.2017\n
# Last edited... | lukasl93/touchstone2tikz | src/makeprojecttikz.py | Python | gpl-3.0 | 2,980 |
from __future__ import unicode_literals # pragma: no cover
from __future__ import print_function # pragma: no cover
# We have to use this entire file before we can turn coverage on, so we exclude
# it from coverage. We still have tests, though!
import argparse # pragma: no cover
try: # pragma: no cover
impo... | CleanCut/green | green/config.py | Python | mit | 27,275 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import mkt.translations.models
import mkt.translations.fields
class Migration(migrations.Migration):
dependencies = [
('translations', '__first__'),
('version... | ingenioustechie/zamboni | mkt/versions/migrations/0002_auto_20150727_1017.py | Python | bsd-3-clause | 1,075 |
import csv, pprint, sys, os, random
distexplore_enabled = False
try:
import distexplore
distexplore_enabled = True
except:
pass
def process(path):
f = open(path, 'rb')
filename = os.path.basename(path)
filename_pure = filename.rsplit('.',1)[0]
print filename
reader = csv.reader(f)
columns = [x.strip() for ... | MarkNenadov/csv-intel | csv_intel/__init__.py | Python | mit | 2,849 |
# Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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,... | sorenh/cc | vendor/boto/boto/sdb/db/model.py | Python | apache-2.0 | 8,009 |
# -*- coding: utf-8 -*-
#
# 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
#... | Fokko/incubator-airflow | airflow/api/common/experimental/get_task.py | Python | apache-2.0 | 1,169 |
# Choregraphe bezier export in Python.
from naoqi import ALProxy
names = list()
times = list()
keys = list()
names.append("HeadYaw")
times.append([ 0.80000, 1.56000, 2.24000, 2.80000, 3.48000, 4.60000])
keys.append([ [ -0.13503, [ 3, -0.26667, 0.00000], [ 3, 0.25333, 0.00000]], [ -0.35133, [ 3, -0.25333, 0.04939], [ 3... | Rctue/nao-lib | gestures/Welcoming.py | Python | gpl-2.0 | 6,506 |
from flask_classy import FlaskView, route
from flask import abort, request
import json
from subprocess import call
from ..config import _cfg
from ..network import *
class HookView(FlaskView):
def post(self):
print("Hook recieved")
allow = False
for ip in _cfg("hook_ips").split(","):
... | nerdzeu/NERDZCrush | mediacrush/views/hook.py | Python | mit | 1,357 |
from cStringIO import StringIO
from captcha.models import CaptchaStore
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
import Image,ImageDraw,ImageFont,ImageFilter
import random
from captcha.conf import settings
def captcha_image(request,key):
store = get_object_or_404(... | DraXus/andaluciapeople | captcha/views.py | Python | agpl-3.0 | 2,889 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
from frappe.model.document import Document
from frappe.website.utils import cleanup_page_name
from frappe.website.utils import clear_cache
from frappe.modules import get_module_name
from frappe.search.webs... | mhbu50/frappe | frappe/website/website_generator.py | Python | mit | 5,141 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... | HewlettPackard/oneview-ansible | library/oneview_server_profile_template_facts.py | Python | apache-2.0 | 6,255 |
"""\
NAME
force.py
SYNOPSIS
Force module for PyQuante electronic structure calculations. Code is
loosely based upon Szabo and Ostlund's appendix C describing geometry
optimization and calculating analytic derivatives.
DESCRIPTION
AUTHOR
Hatem H. Helal, hhh23@cam.ac.... | certik/pyquante | PyQuante/force.py | Python | bsd-3-clause | 12,245 |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
import os.path as osp
import PIL
from utils.cython_bbox impor... | AtsushiHashimoto/fujino_mthesis | tools/frcnn/imdb.py | Python | bsd-2-clause | 9,812 |
# Copyright 2000 - 2015 NeuStar, 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 by applicable l... | neustar/wpm_api_client | src/monitor.py | Python | apache-2.0 | 11,284 |
"""
module for generating C, C++, Fortran77, Fortran90, Julia and Octave/Matlab
routines that evaluate sympy expressions. This module is work in progress.
Only the milestones with a '+' character in the list below have been
completed.
--- How is sympy.utilities.codegen different from sympy.printing.ccode? ---
We con... | jerli/sympy | sympy/utilities/codegen.py | Python | bsd-3-clause | 64,829 |
"""
Utilities for interacting with twitter
"""
import tweepy
from helga import log, settings
logger = log.getLogger(__name__)
def is_properly_configured():
"""
Ensures that all necessary settings for communicating with twitter are configured.
This includes:
* ``TWITTER_CONSUMER_KEY``
* ``TWITT... | shaunduncan/helga-poems | helga_poems/util.py | Python | mit | 2,705 |
#!/usr/bin/env python
import sys
from abjad import *
from random import choice, shuffle
from graph import Graph
from superset import Superset
sets = [
[0, 1, 5, 6],
[1, 4, 5, 7],
[2, 3, 9, 11],
[3, 5, 10, 11]]
cardinalities = [6, 7, 8]
supersets = list()
sequence = list()
seq_i = list... | johncburnett/Lavender | src/main.py | Python | gpl-3.0 | 6,770 |
#!/usr/bin/env python2
#
# Copyright (C) 2016 TU Delft
#
# This file is part of paparazzi.
#
# paparazzi 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... | HWal/paparazzi | sw/tools/iridium/iridium_link.py | Python | gpl-2.0 | 8,349 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) a... | MSusik/invenio | invenio/testsuite/test_utils_hash.py | Python | gpl-2.0 | 1,644 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Project'
db.create_table('profiles_project', (
('id', self.gf('django.db.models.fields.... | ParsonsAMT/Myne | datamining/apps/profiles/migrations/0003_auto__add_project__add_field_course_tags__add_field_course_timeline.py | Python | agpl-3.0 | 20,037 |
#!/usr/bin/python
# -*- coding: ascii -*-
# Author: @harvie Tomas Mudrunka
# Date: 7 july 2018
from __future__ import print_function
from __future__ import print_function
__author__ = "@harvie Tomas Mudrunka"
#__email__ = ""
__name__ = _("Difference")
__version__ = "0.0.1"
import math
import os.path
import re
from... | samowitsch/bCNC | bCNC/plugins/difference.py | Python | gpl-2.0 | 5,254 |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... | Telestream/telestream-cloud-python-sdk | telestream_cloud_qc_sdk/telestream_cloud_qc/models/video_bit_depth_test.py | Python | mit | 4,820 |
import datetime
from django.test import TestCase
from schedule.templatetags.scheduletags import querystring_for_date
class TestTemplateTags(TestCase):
def test_querystring_for_datetime(self):
date = datetime.datetime(2008,1,1,0,0,0)
query_string=querystring_for_date(date)
self.assert... | mfalcon/edujango | schedule/tests/test_templatetags.py | Python | apache-2.0 | 404 |
#!/usr/bin/env python
#
# Copyright 2013-2015 Matthew Wall, Andrew Miles
# See the file LICENSE.txt for your full rights.
#
# Thanks to Andrew Miles for figuring out how to read history records
# and many station parameters.
# Thanks to Sebastian John for the te923tool written in C (v0.6.1):
# http://te923.fukz.org... | paolobenve/weewx | bin/weewx/drivers/te923.py | Python | gpl-3.0 | 99,426 |
#!/usr/bin/env python
# based on cb-exit used in CrunchBang Linux <http://crunchbanglinux.org/>
import pygtk
pygtk.require('2.0')
import gtk
import os
import getpass
import time
class i3_exit:
def disable_buttons(self):
self.cancel.set_sensitive(False)
self.logout.set_sensitive(False)
sel... | RationalAsh/configs | i3-exit.py | Python | mit | 4,584 |
# -*- coding: utf-8 -*- | dstelter/ctfstore | store/__init__.py | Python | gpl-3.0 | 28 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__, static_url_path='/static')
app.config.from_object('config')
db = SQLAlchemy(app)
from app import views
| JohnnyNiu/example_webapp | python_flask/app/__init__.py | Python | apache-2.0 | 191 |
# -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.
| benoitc/offset | offset/net/__init__.py | Python | mit | 93 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from resources.datatables import FactionStatus
from java.util import Vector
def addTemplate(co... | agry/NGECore2 | scripts/mobiles/generic/faction/imperial/imp_dead-eye_78.py | Python | lgpl-3.0 | 1,434 |
import json
from pytest import fixture, yield_fixture
from base64 import b64encode
def new_api_client(db, namespace):
from inbox.api.srv import app
app.config['TESTING'] = True
with app.test_client() as c:
return TestAPIClient(c, namespace.public_id)
@yield_fixture
def api_client(db, default_nam... | closeio/nylas | tests/api/base.py | Python | agpl-3.0 | 2,007 |
# -*- coding: utf-8 -*-
import wx
from .i18n import get_
class MenuMaker(object):
"""
Класс добавляет пункты в контекстное меню
"""
def __init__(self, controller, menu, parent):
"""
menu - контекстное меню
parent - родительское окно, которое будет получать сообщение от меню
... | unreal666/outwiker | plugins/externaltools/externaltools/menumaker.py | Python | gpl-3.0 | 3,555 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | wangyum/tensorflow | tensorflow/contrib/seq2seq/python/kernel_tests/decoder_test.py | Python | apache-2.0 | 6,979 |
import k3d
from k3d.headless import k3d_remote, get_headless_driver
def generate():
plot = k3d.plot(screenshot_scale=1.0)
headless = k3d_remote(plot, get_headless_driver())
headless.sync(hold_until_refreshed=True)
headless.camera_reset(1.0)
screenshot = headless.get_screenshot()
headless.clo... | K3D-tools/K3D-jupyter | docs/source/basic_plotting/empty_plot.py | Python | mit | 348 |
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
from django.core.mail import send_mail
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils.models import TimeStampedModel
class UserManager(BaseUserManager):
use_in_migrati... | gregazevedo/gregazevedo | gregazevedo/account/models.py | Python | mit | 3,121 |
# encoding: utf-8
"""
nrnpython implementation of the PyNN API.
:copyright: Copyright 2006-2016 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""
from copy import deepcopy
import numpy
import logging
try:
from itertools import izip
except ImportError:
izip = zip # Python 3 zip ret... | anupkdas-nus/global_synapses | pyNN-dispackgaes/neuron/projections.py | Python | gpl-3.0 | 7,227 |
__author__ = 'maxiee'
class CreditCard:
""" A consumer credit card
"""
def __init__(self, customer, bank, acnt, limit, balance = 0):
"""
Create a new credit card instance
The initial balance is zero.
:param customer: the name of the customer (e.g., 'Maxiee')
:par... | maxiee/DataStructuresAlgorithmsPythonExercises | chapter2/R_2_7_constructor_fifth_parameter_balance.py | Python | gpl-2.0 | 2,169 |
# -*- coding: utf-8 -*
"""
`grappa_http` provides HTTP protocol assertion for `grappa` testing library.
Example::
import grappa
import grappa_http
# Register plugin
grappa.use(grappa_http)
# Use plugin assertion
res = requests.get('httpbin.org/status/204')
res | should.have.status(204)
... | grappa-py/http | grappa_http/__init__.py | Python | mit | 830 |
# coding: utf-8
"""Generate GeoJSON objects from their components."""
def point(position):
"""Create a valid GeoJSON Point."""
return {
"type": "Point",
"coordinates": position,
}
def multi_point(coordinates=None):
"""Create a valid GeoJSON MultiPoint."""
return {
"type"... | dmtucker/gjtk-py | gjtk/generate.py | Python | lgpl-2.1 | 1,765 |
import os
__all__ = ["CompilerTestCase",
"OperatorTestCase",
"ParseNodeTestCase",
"ParserTestCase",
"PrimitiveTestCase",
"UtilTestCase"]
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
FIXTURES_ROOT = os.path.join(TEST_ROOT, "fixtures")
from .test_comp... | treycucco/pyebnf | tests/__init__.py | Python | mit | 534 |
# -*- coding: utf-8 -*-
""" Utilities to track and assert transferred messages. """
from __future__ import print_function
import string
from raiden.messages import decode
from raiden.network.transport import DummyTransport
from raiden.utils import pex, make_privkey_address, sha3
from raiden.tests.utils.tests import f... | charles-cooper/raiden | raiden/tests/utils/messages.py | Python | mit | 5,896 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_index('eve_api_eveplayercharacterskill', ['character_id', 'skill_id'], unique=True)
def backwards(self, orm):
... | nikdoof/test-auth | app/eve_api/migrations/0011_add_skills_index.py | Python | bsd-3-clause | 12,560 |
from fabric.api import run, cd
from fabric.contrib.project import rsync_project
def deploy():
"Deploy the Rest api & website to production"
with cd('/home/protected/jtime/JTime-rest'):
run('git stash && git pull && git stash pop')
run('npm install .')
rsync_project(
remote_d... | ismail-s/JTime | fabfile.py | Python | gpl-2.0 | 489 |
"""
Mixins used across multiple views.
"""
from django.contrib.auth.decorators import login_required
from django.db.models import Q
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.views.generic import View
import ws.utils.perms as perm_utils
from ws import models
fr... | DavidCain/WinterSchool | ws/mixins.py | Python | gpl-3.0 | 2,437 |
# 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... | cmouse/buildbot | master/buildbot/test/util/steps.py | Python | gpl-2.0 | 19,087 |
import six
if six.PY3:
import unittest
else:
import unittest2 as unittest
from datetime import date
from mock import Mock
from twilio.rest.resources import Conferences
DEFAULT = {
'DateUpdated<': None,
'DateUpdated>': None,
'DateUpdated': None,
'DateCreated<': None,
'DateCreated>': None,
... | clearcare/twilio-python | tests/test_conferences.py | Python | mit | 1,438 |
from django.views.generic import TemplateView, View
from django.utils import timezone
from django.http import JsonResponse
from django.core.exceptions import PermissionDenied
from django.core import urlresolvers
from base import ManagementUtility, ManagementExecutor
from models import Log
def has_permission(request):... | willandskill/django-executor | django_executor/views.py | Python | mit | 1,829 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-03 10:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | ShenJunNeo/LogsAnalysis | LogAnalysisTool/LogsHandler/migrations/0001_initial.py | Python | mpl-2.0 | 1,893 |
#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 o... | startcode/apollo | modules/data/warehouse/web_server/main.py | Python | apache-2.0 | 4,679 |
def circles(n):
'''have all pynguins move
to random locations and make
a small circle n times.
'''
for i in range(n):
agoto('random')
acircle(10)
| alcemirfernandes/pynguin | doc/examples_src/multi_pynd/00014.py | Python | gpl-3.0 | 182 |
# -*- coding: utf-8 -*-
""" Synchronization Controllers """
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
module_name = T("Synchronization")
response.title = module_name
return dict(module_name=module_name)
# ---... | madhurauti/Map-Polygon | controllers/sync.py | Python | mit | 5,400 |
from django import template
from django.conf import settings
register = template.Library()
SHORTNAME = getattr(settings, 'DISQUS_SHORTNAME', None)
def disqus_dev():
"""
Returns the HTML/js code to enable DISQUS comments on a local
development server if the settings.DEBUG is set to True.
"... | ajaxsys/dict-admin | disqus/templatetags/disqus_tags.py | Python | bsd-3-clause | 3,419 |
# Copyright 2006-2009 Scott Horowitz <stonecrest@gmail.com>
# Copyright 2009-2014 Jonathan Ballet <jon@multani.info>
#
# This file is part of Sonata.
#
# Sonata 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, ... | deprint/sonata | sonata/current.py | Python | gpl-3.0 | 29,355 |
# from stop_words import get_stop_words
#
# import os
# import string
# import re
#
# root_path = '/home/joao/Desktop/Twitter/ResumedStatus/'
# # stop_words = set(stopwords.words("english")) # load stopwords
# stop_words = get_stop_words('english')
#
#
# # Given a list of words, return a dictionary of
# # word-frequen... | jblupus/PyLoyaltyProject | old/project/tokens/tokens_utils.py | Python | bsd-2-clause | 2,424 |
# -*- coding: UTF-8 -*-
# Copyright 2009-2018 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
from builtins import str
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.utils.translation import... | lino-framework/xl | lino_xl/lib/notes/models.py | Python | bsd-2-clause | 7,642 |
#!/usr/bin/env python
import sys
import random
import pickle
start_mile = 3
end_mile = 3.2
data = []
for i in range(1, len(sys.argv)):
with open(sys.argv[i] + ".pickle", "rb") as f:
data.append(pickle.load(f))
print("Mileage Run1 Run2 Run3")
for i in range(len(data)):
for j in range(len(data[i])):
... | cpn18/track-chart | desktop/archive/compare_runs.py | Python | gpl-3.0 | 893 |
#!/usr/bin/env python
'''
Installs the code in ./robot to a FRC cRio-based Robot via FTP
Usage: run install.py, and it will upload
'''
import os
import ftplib
import socket
import sys
from optparse import OptionParser
def get_robot_host(team_number):
'''Given a team number, determine the address of the robot'... | grt192/2012rebound-rumble | utilities/installer/install.py | Python | mit | 11,622 |
#!/usr/bin/python2.7
import psycopg2
import sys
import os
import subprocess
from tiler_helpers import add_tippecanoe_config, check_environ_vars
def postgis2geojson(TABLE_NAME, DATABASE_VARS, LAYER_CONFIG=False, QUERY=False):
""" Take data from tables in PostGIS and export them to GeoJSON """
if not TABLE_NAME... | Geovation/tiler | tiler/tiler-scripts/postgis2geojson.py | Python | mit | 1,723 |
from .widgets import AceWidget
# adhere to PEP 386
__version__ = "0.3.1"
| bensternthal/snippets-service | vendor-local/lib/python/django_ace/__init__.py | Python | bsd-3-clause | 74 |
from __future__ import annotations
from datetime import (
datetime,
timedelta,
)
import operator
from typing import (
TYPE_CHECKING,
Any,
Callable,
Literal,
Sequence,
TypeVar,
Union,
cast,
overload,
)
import warnings
import numpy as np
from pandas._libs import (
algos,... | jorisvandenbossche/pandas | pandas/core/arrays/datetimelike.py | Python | bsd-3-clause | 64,400 |
# Copyright 2013 Brocade Communications System, 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
#
#... | samsu/neutron | plugins/brocade/nos/fake_nosdriver.py | Python | apache-2.0 | 3,457 |
from __future__ import absolute_import
from datetime import timedelta
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from sentry.db.models import FlexibleForeignKey, Model, sane_repr
from sentry.utils.http import absolute_ur... | beeftornado/sentry | src/sentry/models/lostpasswordhash.py | Python | bsd-3-clause | 3,024 |
# Django settings for forum project.
import os
from local import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ROOT_DIR = os.path.dirname(BASE_DIR)
# avatar
STORAGE_PATH = "/usr/share/userres/avatar/"
# url
USERRES_URLBASE = "http://res.myforum.com"
# H... | YangTe1/Forum | forum/settings.py | Python | gpl-2.0 | 6,966 |
from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
from django.utils.unittest import TestCase
from django.test.utils import override_settings
from django.utils import six
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}... | vsajip/django | tests/regressiontests/templates/nodelist.py | Python | bsd-3-clause | 2,594 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cg31/tensorflow | tensorflow/contrib/distributions/python/ops/operator_test_util.py | Python | apache-2.0 | 6,295 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with different interpolation modes,
# with the wrap-pad feature turned on and with a rotation
# Image pipeline
reader = vtk.vtkImageReader()
reader... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Imaging/Core/Testing/Python/ResliceWrapOblique.py | Python | gpl-3.0 | 3,383 |
# Copyright 2014 Intel Corp.
#
# 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, soft... | cwolferh/heat-scratch | heat/objects/watch_data.py | Python | apache-2.0 | 2,016 |
#!/usr/bin/env python
# encoding: utf-8
import os
from random import randint
from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EVAS_CALLBACK_MOUSE_DOWN
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.button import Button
from efl.... | maikodaraine/EnlightenmentUbuntu | bindings/python/python-efl/examples/elementary/test_map.py | Python | unlicense | 14,487 |
#!/usr/bin/env python
"""
The pythonic version of the example program as given in the GSL Reference
Document.
The output of this script is designed to be displayed by the GNU plotutils
'graph' program. e.g
$ python ./interpolation.py > interp.dat
$ graph -T ps < interp.dat > interp.ps
The result shows a sm... | juhnowski/FishingRod | production/pygsl-0.9.5/examples/interpolation.py | Python | mit | 1,449 |
##
# pytibrv/queue.py
# TIBRV Library for PYTHON
# tibrvQueue_XXX
#
# LAST MODIFIED : V1.1 20170220 ARIEN arien.chen@gmail.com
#
# DESCRIPTIONS
# -----------------------------------------------------------------------------
# 1. DEFAULT QUEUE
# (1) use TIBRV_DEFAULT_QUEUE in API, like as TIBRV C
# (2) TibrvQ... | arienchen/pytibrv | pytibrv/queue.py | Python | bsd-3-clause | 9,825 |
# Example for Simulation.
# Important to have it here. Otherwise error. CC3D uses a special module loader
# that cannot directly instantiate classes. (Wish I knew more on Python)
import sys
from os import environ
import CompuCellSetup
sys.path.append(environ["PYTHON_MODULE_PATH"])
sim, simthread = CompuCellSetup.get... | informatik-mannheim/Moduro-CC3D | Simulation/Temp.py | Python | apache-2.0 | 717 |
from __future__ import print_function
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import codecs
import os
import sys
import re
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
# intentionally *not* adding an encoding option to open
ret... | shaikatzir/xls-neo4j | setup.py | Python | apache-2.0 | 2,238 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.