src stringlengths 721 1.04M |
|---|
"""Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
__all__ = [
'get_config_h_filename',
'get_config_var',
'get_config_vars',
'get_makefile_filename',
'get_path',
'get_path_names',
'get_paths',
'get_platform',
'get_... |
import os, linecache, re, json
work_directory_path = os.path.dirname(os.path.realpath(__file__))
eng_words_file = open(work_directory_path + "/eng_words.txt", "rU")
eng_words = set()
for word in eng_words_file:
eng_words |= {word.rstrip()}
data_directory_path = work_directory_path + "/ICDAR2017_datasetPostOCR_Eval... |
"""
Functions and classes used for logging into guests and transferring files.
"""
import logging
import time
import re
import os
import shutil
import tempfile
import aexpect
import utils_misc
import rss_client
import base64
from remote_commander import remote_master
from remote_commander import messenger
from autote... |
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import spline
from lib.geo.util import get_range
from lib.geo.util import get_weight_ratio
from lib.geo.util import project_segment
from lib.geo.util import get_hookoff
def run():
alpha = .13 # Fo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
'''
admin.py
Andy Freeland and Dan Levy
5 June 2010
Provides administrative functions, such as retraining characters and deleting
objects and characters. Accessed at the /admin url. Laughably insecure.
'''
import web
import config, model
imp... |
import pymongo
import backend
def clear_db():
connect = pymongo.MongoClient(backend.global_db_url)
db = connect.get_database(backend.global_db_name)
l = [backend.global_db_origin_collection,
backend.global_db_user_collection,
backend.global_db_device_collection,
backend.... |
"""
PyGoogleChart - A complete Python wrapper for the Google Chart API
http://pygooglechart.slowchop.com/
Copyright 2007 Gerald Kaszuba
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 versio... |
# Copyright 2015 Rackspace Inc.
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from numpy import arange, dtype # array module from http:/
#from matplotlib.toolkits.basemap import Basemap, shiftgrid
from mpl_toolkits.basemap import Basemap, shiftgrid
from pylab import *
import matplotlib.colors as colors
from optparse import OptionParser
import sys, o... |
"""
Copyright 2015 Andrew Lin.
All rights reserved.
Licensed under the BSD 3-clause License. See LICENSE.txt or
<http://opensource.org/licenses/BSD-3-Clause>.
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from lib.albatross import log
_log = log.get_logger(__name__)
class BeamFormerError(Exception... |
#
# This file is part of Bakefile (http://bakefile.org)
#
# Copyright (C) 2008-2013 Vaclav Slavik
#
# 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... |
#!/usr/bin/env python3
# vim: set et sw=4 sts=4 fileencoding=utf-8:
# Copyright 2013 Dave Hughes.
#
# This file is part of picroscopy.
#
# picroscopy 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 ver... |
###############################################################################
# Copyright 2011-2014 The University of Texas at Austin #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #... |
"""
A module for printing "nice" messages from assertion statements.
"""
import tokenize, parser
class _Wrap:
def __init__(self, *lines):
self.lines = list(lines)
def __call__(self):
if not self.lines:
raise StopIteration
else:
return self.lines.pop(0)
cla... |
# This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... |
from helper import unittest, PillowTestCase, hopper
from PIL import Image, SgiImagePlugin
class TestFileSgi(PillowTestCase):
def test_rgb(self):
# Created with ImageMagick then renamed:
# convert hopper.ppm -compress None sgi:hopper.rgb
test_file = "Tests/images/hopper.rgb"
im =... |
from __future__ import unicode_literals
import sys
from unittest import skipIf
from django.test import TestCase
from pipeline.collector import default_collector
from pipeline.compilers import Compiler, CompilerBase, SubProcessCompiler
from pipeline.exceptions import CompilerError
from tests.utils import _, pipeline... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Mehmet Dursun Ince
from argparse import ArgumentParser
from random import choice, randint
import locale
locale.setlocale(locale.LC_ALL, "tr_TR")
class Akgulyzer(object):
def __init__(self, args):
"""
Kurucu Akgulyzer
:param args:
:re... |
def draw_matches(img1, kp1, img2, kp2, matches, color=None):
"""Draws lines between matching keypoints of two images.
Keypoints not in a matching pair are not drawn.
Places the images side by side in a new image and draws circles
around each keypoint, with line segments connecting matching pairs.
... |
import unittest
import requests
import time
from . import utils
class AuthBase (object):
def test_authentication (self):
self.exp.get_auth()
def test_token_refresh (self):
self.exp._sdk.authenticator._login()
self.exp._sdk.authenticator._refresh()
def test_refresh_401 (self):
auth = self.ex... |
def fullJustify(strings_list, number):
result = []
if not strings_list or number <= 0:
return result
current_length, idx, firstWord = 0, 0, True
for word in strings_list:
if firstWord:
result.append(word)
current_length += len(result[-1])
firstWord = F... |
"""The tests for the Canary component."""
import unittest
from unittest.mock import patch, MagicMock, PropertyMock
import homeassistant.components.canary as canary
from homeassistant import setup
from tests.common import (
get_test_home_assistant)
def mock_device(device_id, name, is_online=True):
"""Mock Can... |
# -*- coding: utf-8 -*-
print 'argument values'
def ask_ok(prompt, retries=4, complaint='yes or no, please!'):
while True:
ok = raw_input(prompt)
if ok in ('y', 'ye','yes'): # in
return True # return
if ok in ('n', 'no', 'nop', 'nope'):
return False
retries = retries - 1
if retries < 0:
rais... |
#!python
import random, time
class RandomGenerator:
def __init__(self):
random.seed(time.clock())
def generate_uniform(self, min_v, max_v):
return random.uniform(min_v, max_v)
def generate_int(self, min_v, max_v):
return random.randint(min_v, max_v)
d... |
# Copyright (C) 2018 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribu... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-26 14:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import isi_mip.climatemodels.models
class Migration(migrations.Migration):
dependencies = [
('climatemodels', '0087_... |
# Copyright (c) 2013 Mirantis 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 writ... |
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... |
# coding=utf-8
"""Dialog test.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = 'p.p... |
# -*- coding: utf-8 -*-
from django.core.exceptions import ValidationError
from django.test import TestCase
from django_extensions.validators import NoControlCharactersValidator, NoWhitespaceValidator
class NoControlCharactersValidatorTests(TestCase):
"""Tests for NoControlCharactersValidator."""
def test_s... |
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
class StockWarehouse(models.Model):
_inherit = "stock.warehouse"
production_rm_type_id... |
#!/usr/bin/python
#$ -S /usr/bin/python
#$ -e error
#$ -cwd
#$ -r y
#$ -j y
#$ -l mem_free=2G
#$ -l arch=linux-x64
#$ -l netapp=1G,scratch=180G
#$ -l h_rt=336:00:00
import sys
import os
import itertools
def make_dic_of_all_gene_names(gene_name_input_filepaths, evalue_input_filepaths, evalue_cutoff, drop_allele_info):... |
#!/usr/bin/env python
#coding=utf-8
'''
Definition of BufToken class. It represents a token in the buffer of the transition system.
MWEs are stored in a single token (taken care during preprocessing). 'nodes' is the list of
objects of class Nodes that this token is aligned to; it contains 'None' if alignments are not
... |
#!/usr/bin/env python2.7
"""
Author : Arjun Arkal Rao
Affiliation : UCSC BME, UCSC Genomics Institute
File : docker_scripts/run_mutect.py
Program info can be found in the docstring of the main function.
Details can also be obtained by running the script with -h .
"""
from __future__ import division, print_function
fro... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import migasfree.server.models.common
class Migration(migrations.Migration):
dependencies = [
('server', '0022_4_14_computers'),
('catalog', '0002_4_14_versi... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
# coding=utf-8
import unittest
"""872. Leaf-Similar Trees
https://leetcode.com/problems/leaf-similar-trees/description/
Consider all the leaves of a binary tree. From left to right order, the
values of those leaves form a _leaf value sequence._

... |
# ----------------------------------------------------------------------
# Copyright (C) 2015 by Rafael Gonzalez
#
# 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, includ... |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...table import Table
from ...worksheet impor... |
#!/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... |
import pytest
from markupsafe import escape
from jinja2 import Environment
from jinja2.exceptions import SecurityError
from jinja2.exceptions import TemplateRuntimeError
from jinja2.exceptions import TemplateSyntaxError
from jinja2.nodes import EvalContext
from jinja2.sandbox import ImmutableSandboxedEnvironment
from ... |
from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from mock import ANY, Mock, patch
from nose.tools import eq_, ok_, raises
from amo.tests import app_factory, TestCase
from mkt.constants.payments import (PROVIDER_BANGO, PROVIDER_BOKU,
PROVIDER_REFEREN... |
import logging
import time
import thread
import urllib2
import sys
import datetime
from django_longliving.base import LonglivingThread
from datastage.dataset import SUBMISSION_QUEUE
from datastage.web.dataset.models import DatasetSubmission
from datastage.web.dataset import openers
from sword2 import Connection, Url... |
# context.py - changeset and file context objects for mercurial
#
# Copyright 2006, 2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
from node import nullid, nullrev, short
from i18n import _
... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe
import os, base64, re, json
import hashlib
import mimetypes
import io
from frappe.utils import get_hook_method, get_files_path, random_string, encode, cstr, call_hook_method, cint
from frappe import _
from... |
#
# Copyright (c) 2020 SUNET
# 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
# notice, this list of conditi... |
from django import forms
from django.utils import timezone
from django.utils.module_loading import import_string
from . import models as picker
from . import utils
_picker_widget = None
encoded_game_key = 'game_{}'.format
TIE_KEY = '__TIE__'
def decoded_game_key(value):
return int(value.replace('game_', ''))
... |
# Copyright 2020 PerfKitBenchmarker 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 appli... |
#
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... |
from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from django.core.context_processors import csrf
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required, permission_required
f... |
# -*- coding: utf-8 -*-
"""
python-aop is part of LemonFramework.
python-aop is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
python-aop is ... |
"""
Mock kinect support
"""
from logging import getLogger
import time
log = getLogger(__name__)
import streamkinect2.mock as mock
from streamkinect2.compress import DepthFrameCompressor
from .util import AsyncTestCase
# This is intentionally low to not be too hard on the test server. Use a
# benchmark script if yo... |
import os
import ast
import requests, gspread
import numpy as np
import matplotlib.pyplot as plt
from oauth2client.client import SignedJwtAssertionCredentials
from mpl_toolkits.basemap import Basemap
#Google Authorisation section and getting a worksheet from Google Spreadsheet
def authenticate_google_docs():
f =... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
#... |
'''
Author: Julian van Eyken Date: Jul 9 2013
Test code for per-pixel effective exposure time weighting.
'''
import os.path
import photonlist.photlist as pl
import photonlist.RADecImage as rdi
from util.FileName import FileName
def getSimpleImage(fileName=FileName(run='PAL2012',date='20121211',tstamp='20121212... |
"""
Python implementation of the io module.
"""
import os
import abc
import codecs
import errno
import stat
import sys
# Import _thread instead of threading to reduce startup cost
from _thread import allocate_lock as Lock
if sys.platform in {'win32', 'cygwin'}:
from msvcrt import setmode as _setmode
else:
_set... |
"""
This contains the TRPO class. Following John's code, this will contain the bulk
of the Tensorflow construction and related code. Call this from the `main.py`
script.
(c) April 2017 by Daniel Seita, based upon `starter code` by John Schulman, who
used a Theano version.
"""
import gym
import numpy as np
import tens... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, re, time, sys
from bs4 import BeautifulSoup
import common
import requests
reload(sys)
#print sys.getdefaultencoding()
sys.setdefaultencoding('utf-8')
print sys.getdefaultencoding()
def download_html(url):
headers = {'Accept': 'text/html,application/... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 09:48:26 2013
@author: mbereda
"""
from openerp.osv import osv,fields
from openerp.tools.translate import _
import pdb
import datetime
class jp_recruiter2deal(osv.Model):
_name = 'jp.recruiter2deal'
_columns = {
'deal_id': fields.many2one('jp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import tencentyun
appid = "111"
secret_id = "secret_id"
secret_key = "secret_key"
sample_image_path = "test_image.jpg"
sample_video_path = "test_video.mp4"
image = tencentyun.Image(appid,secret_id,secret_key)
# upload an image from local file
#obj = image... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
import maasserver.models.cleansave
class Migration(migrations.Migration):
dependencies = [("maasserver", "0106_testing_status")]
operations = [
migrations.... |
#
# Script to generate VTKUnstructuredGrid objects from CitcomS hdf files
#
# author: Martin Weier
# Copyright (C) 2006 California Institue of Technology
#
# 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
# t... |
from pyramid.view import view_config
import pyexcel.ext.xls
import pyexcel.ext.xlsx
import pyexcel.ext.ods3 # noqa
import pyramid_excel as excel
from .models import (
DBSession,
Category,
Post
)
@view_config(route_name='home', renderer='templates/mytemplate.pt')
def my_view(request):
return {'p... |
# flake8: noqa
# SKIP this file when reformatting.
# The rest of this file was generated by South.
# encoding: utf-8
import datetime
from django.db import models
from maasserver.enum import NODE_STATUS
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(s... |
# -*- coding: utf-8 -*-
# Copyright 2011 Fanficdownloader team, 2015 FanFicFare team
#
# 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
#
# Un... |
# -*- coding: utf-8 -*-
#
# scoreeditor.py
#
# This is a plugin for Zim, which allows to insert music score in zim using
# GNU Lilypond.
#
#
# Author: Shoban Preeth <shoban.preeth@gmail.com>
# Date: 2012-07-05
# Copyright (c) 2012, released under the GNU GPL v2 or higher
#
#
import glob
from zim.plugins.base.imagegen... |
"""
Support for MQTT switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.mqtt/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.mqtt import (
CONF_STATE_TOP... |
from rest_framework import serializers
from yawn.task.models import Task, Execution
from yawn.worker.serializers import MessageSerializer, WorkerSerializer
from yawn.workflow.models import Workflow
class SimpleWorkflowSerializer(serializers.ModelSerializer):
name = serializers.CharField(source='name.name', read_... |
#!/usr/bin/env python
# Copyright (c) 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.
"""Tests for jni_generator.py.
This test suite contains various tests for the JNI generator.
It exercises the low-level parser all... |
# Copyright (C) 2016 Igalia S.L. 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 source code must retain the above copyright
# notice, this list of conditions and the ... |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free ... |
# Copyright 2012 OpenStack Foundation
#
# 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... |
import os
import operator
import itertools
from datetime import datetime, timedelta
from models import Paths, PathRow, UserJob, RenderCache
from pyramid.view import view_config, notfound_view_config
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from sqs import make_SQS_connection, get_queue, build_job_mess... |
# -*- coding: utf-8 -*-
import os
import sys
from ..test_managercli import TestCliCommand
from subscription_manager import managercli
from mock import patch, Mock
class TestImportCertCommand(TestCliCommand):
command_class = managercli.ImportCertCommand
def setUp(self):
super(TestImportCertCommand,... |
"""
05-strange-attractors.py - Non-linear ordinary differential equations.
Oscilloscope part of the tutorial
---------------------------------
A strange attractor is a system of three non-linear ordinary
differential equations. These differential equations define a
continuous-time dynamical system that exhibits chaot... |
"""
https://codelab.interviewbit.com/problems/listcycle/
"""
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param A ... |
ndata = []
with open('data/winddir_20160202.dat') as f:
for line in f:
ndata.append(line.split(" "))
flist = []
for l in ndata:
if l[4].endswith('00') or l[4].endswith('15') or l[4].endswith('30') or l[4].endswith('45'):
if float(l[-1].strip()) == 0 or float(l[-1].strip()) == 360:
f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
####################################################################################################################################################################################################################################
############################################... |
# -*- coding: utf-8 -*-
"""Task related attribute container definitions."""
import time
import uuid
from plaso.containers import interface
from plaso.containers import manager
from plaso.lib import definitions
class Task(interface.AttributeContainer):
"""Task attribute container.
A task describes a piece of wo... |
"""
Piston Motion Animation using Matplotlib.
Animation designed to run on Raspberry Pi 2
Author: Peter D. Kazarinoff, 2016
Tribilium Engineering Solutions www.tribilium.com
"""
#import necessary packages
import numpy as np
from numpy import pi, sin, cos, sqrt
import matplotlib.pyplot as plt
import matplotlib.animat... |
# 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... |
import pyxb_114.binding.generate
import pyxb_114.binding.datatypes as xs
import pyxb_114.binding.basis
import pyxb_114.utils.domutils
import gc
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="instance">
<xs:complexType>
... |
"""
Django settings for superlists project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... |
# Carl is free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
import numpy as np
from numpy.testing import assert_array_almost_equal
from carl.distributions import Join
from carl.distributions import Normal
from carl.distributions... |
#FLM: Convert PFA/UFO/TXT to TTF/VFB
# coding: utf-8
__copyright__ = __license__ = """
Copyright (c) 2015-2016 Adobe Systems Incorporated. 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 ... |
########################################
## Adventure Bot "Dennis" ##
## commands/join.py ##
## Copyright 2012-2013 PariahSoft LLC ##
########################################
## **********
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/context.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _sy... |
import sys
import pygame
from excitingbike.screens.main_menu_screen import MainMenuScreen
from excitingbike.controller.controller import Controller
from excitingbike.locals import *
# Runs the main loop of the program
class Runner(object):
def __init__(self, initial_screen):
self.clock = pygame.time.... |
from mock import call, patch
from nose.tools import istest
from .fixtures import (
FOO_DB_WITH_JOHN_GRANTS,
FOO_DB_WITHOUT_JOHN_GRANTS,
FOO_DB_WITH_JOHN_GRANTS_AND_GRANT_OPTION,
HOSTS_FOR_USER,
DATABASES,
)
from provy.more.centos import YumRole, MySQLRole
from tests.unit.tools.helpers import ProvyT... |
# -*- coding: utf-8 -*-
#
# Author: Johan Reitan <johan.reitan@gmail.com>
# Date: Sat Jan 18 2014, 17:03:40
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2, or
# (at y... |
"""
Create a multi-label image list file according to
http://myungjun-youn-demo.readthedocs.org/en/latest/python/io.html
"""
__author__ = 'bshang'
import numpy as np
import pandas as pd
from sklearn import preprocessing
def convert_label_to_array(str_label):
str_label = str_label.split(' ')
return [int(x) fo... |
# coding: utf-8
import numpy as np
import chainer.links as L
import chainer.functions as F
from chainer import serializers, Variable
import policy
from AlphaLineupPuzzle.preprocessing import preprocessing
def load_policy_network(name):
in_dim = preprocessing.state_to_tensor.features
out_dim = preprocessing.a... |
#!/usr/bin/python
import matplotlib as MPL
MPL.use('agg') # no X (so show won't work)
from matplotlib.figure import Figure
from matplotlib.patches import Rectangle
#from matplotlib import rc #for adding italics. Via latex style
#rc('text', usetex=True)
import pylab as P
import math
import numpy
import commands
impo... |
# Copyright 2015 Isotoma Limited
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/math/bernstein.py
# Module with some useful utilities for dealing with Bernstein polynomials:
# - control_polygon : get a control polygon for Bernstein polynomial
# - upper_co... |
#!/usr/bin/env python
# Copyright (c) 2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND T... |
#!/usr/bin/env python
"""main.py: Script to download links using mega-debrid.eu."""
__author__ = "eoutin"
import argparse
import ast
import urllib
from urllib2 import *
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("link", help="link to download", type=str)
parser.add_argument("path", hel... |
"""
This is an example plugin to give you an idea of how to use Clojure in your
plugins, should you wish to.
We don't really expect anyone to use this, but we've included it to show that
it's actually possible. If you like Lisps, take a look at Clojure and also
ClojurePy, which is what we're using here.
"""
__author_... |
'''
Created on Sep 28, 2016
@author: jrm
'''
from atom.api import (
Instance, ForwardInstance, Typed, ForwardTyped, ContainerList, Enum, Float, Bool, Coerced, observe
)
from enaml.core.declarative import d_
from .shape import ProxyShape, Shape
def WireFactory():
#: Deferred import of wire
from .draw imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.