code stringlengths 1 199k |
|---|
"""
MathApp classes for representing geometric points
"""
from abc import ABCMeta, abstractmethod
from ggame.mathapp import _MathVisual, MathApp
from ggame.asset import Color, LineStyle, CircleAsset, ImageAsset
class _Point(_MathVisual, metaclass=ABCMeta):
"""
Abstract base class for all point classes.
:par... |
'''
Makes HTTP requests to each of our Data API functions to ensure there are
no templating/etc errors on the pages.
'''
import json
from tests import ApiTestCase
class DataApiV1KeyTests( ApiTestCase ):
AUTH_DETAILS = { 'format': 'json',
'user': 'admin',
'key': ... |
from babel import Locale
from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE
from django.utils import translation
from django.forms import Select, TextInput
from django.forms.widgets import MultiWidget
from phonenumber_field.phonenumber import to_python
class PhonePrefixSelect(Select):
initial = None
def... |
from voxel_globe.common_tasks import shared_task, VipTask
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
import logging
import os
@shared_task(base=VipTask, bind=True, routing_key="gpu")
def run_build_voxel_model(self, image_set_id, camera_set_id, scene_id, bbox,
... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_sharnaff_bull.iff"
result.attribute_template_id = 9
result.stfName("monster_name","sharnaff")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
"""
pygments.lexers.installers
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for installer/packager DSLs and formats.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from ..lexer import RegexLexer, include, bygroups, using, this, default
f... |
import AppKit
import vanilla
from fontTools.pens.pointPen import ReverseContourPointPen
from mojo.events import BaseEventTool, installTool
from mojo.extensions import ExtensionBundle
shapeBundle = ExtensionBundle("ShapeTool")
_cursorOval = CreateCursor(shapeBundle.get("cursorOval"), hotSpot=(6, 6))
_cursorRect = Create... |
if __name__ == '__main__':
import os
print(os.path.isdir(r'/home/ivan'), os.path.isfile(r'/home/ivan'))
print(os.path.isdir(r'/etc/network/interfaces'),
os.path.isfile(r'/etc/network/interfaces'))
print(os.path.isdir('nonesuch'), os.path.isfile('nonesuch'))
print(os.path.exists(r'/ho... |
import unittest
from datetime import date
import holidays
class TestNigeria(unittest.TestCase):
def setUp(self):
self.holidays = holidays.Nigeria()
def test_not_holiday(self):
self.assertNotIn(date(1966, 1, 1), self.holidays)
def test_fixed_holidays(self):
self.assertIn(date(2015, 5,... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/armor/marine/shared_armor_marine_leggings.iff"
result.attribute_template_id = 0
result.stfName("wearables_name","armor_marine_leggings")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retu... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/structure/shared_corellia_house_player_small_style_02.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... |
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""
def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
**_params):
"""Cr... |
from django.contrib.auth.backends import ModelBackend
class CaseInsensitiveUsernameFieldBackendMixin(object):
def authenticate(self, username=None, password=None, **kwargs):
"""
This authentication backend assumes that usernames are email addresses and simply
lowercases a username before an ... |
"""Binary classification"""
from math import log,e
from ..preprocess.util import *
from .lr import LR
class LogisticRegression():
def fit(self,X,Y):
LR.fit(self,X,Y)
self.classes=set(Y)
if len(self.classes)>2:
raise ValueError("This problem is for binary classification expected only 2 classes but given %d"%(l... |
import json
import re
import sys
import shutil
from pprint import pprint
import markdown
import mdx_linkify
def parse_to_markdown(markdown_text):
"""Parse Markdown text to HTML
Arguments:
markdown_text -- String to be parsed into HTML format
"""
extensions_list = ['linkify','markdown.extensions.tabl... |
import sublime
import sublime_plugin
import os
import time
from .rust import (messages, rust_proc, rust_thread, util, target_detect,
cargo_settings, semver, log)
"""On-save syntax checking.
This contains the code for displaying message phantoms for errors/warnings
whenever you save a Rust file.
"""
c... |
from os import environ
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.wamp.types import SubscribeOptions
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class Component(ApplicationSession):
"""
An application component that subscribe... |
import demistomock as demisto
from CommonServerPython import *
import os
import ast
import json
import jwt
from datetime import datetime, timedelta
import requests
from typing import List
from signal import signal, SIGPIPE, SIG_DFL # type: ignore[no-redef]
signal(SIGPIPE, SIG_DFL) # type: ignore[operator]
requests.pa... |
import json
import os
import sys
import stripe
from django.conf import settings
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseServerError, HttpResponseRedirect, HttpResponseNotAllowed
from django.template.loader import render_to_string... |
from fdc.round import Round
from fdc.report import Report
import commons_cat_metrics
from indicators import Indicators
import _mysql_exceptions
template_photo_start = """
== Report ==
{{Suivi FDC/En-tête}}
{{Suivi FDC/Groupe|groupe=Category analysis}}
"""
nb_files_tmpl = """{{Suivi FDC/Indicateur|indicateur=Number of ... |
import numpy
'''
mu : coefficient of restitution set to 1
m1, m2 : masses
initial
r1_i, r2_i : initial positions
v1_i, v2_i : initial velocities , right as +ve
p1_i, p2_i : initial momentums
colliding
r1_c, r2_c : initial positions
final
r1_f, r2_f : final positions
v1_f, v2_f : final velocities , right as +ve
p1_f, p2... |
from __future__ import print_function, division
import numpy as np
import sys
from nilmtk.electric import activation_series_for_chunk
def rectangularise(data, n_segments, format='proportional'):
if data.ndim == 1:
return _rectangularise(data, n_segments=n_segments, format=format)
else:
n_seq_per... |
import numpy as np
import timeit
def benchmark_numpy(dim=30):
A = np.random.randn(dim,dim)
B = np.random.randn(dim,dim)
C = np.random.randn(dim,dim)
D = np.random.randn(dim,dim)
E = np.random.randn(dim,dim)
return np.einsum('ra,rb,rc,rd,re->abcde',A,B,C,D,E);
times = timeit.Timer(benchmark_numpy).timeit(number=1)... |
from datetime import timedelta, date
from django import forms
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.datetime_safe import datetime
from hordak.models import Account
from mptt.forms import TreeNodeChoiceField
from hordak.utilities.currency import Balance
fr... |
import os
import csv
import bson
import argparse
from datetime import datetime
from pymongo import MongoClient
def main(args):
# Connect to the Database
conn = MongoClient()
db = conn.baleen
posts = db.posts
# Create a hook to the CSV file
writer = csv.DictWriter(args.outpath, fieldnames=["_id", "pubd... |
def latest_block(conn):
"""Give us the lastest block number."""
query = "SELECT Count(*) FROM block_table"
cur = conn.execute(query)
return int(cur.fetchone()[0])
def latest_hash(conn):
"""Give us the lastest hash id from db."""
query = "SELECT id FROM hash_table ORDER BY id DESC"
cur = conn... |
from otp.ai.AIBaseGlobal import *
from pandac.PandaModules import *
from DistributedNPCToonBaseAI import *
import ToonDNA
from direct.task.Task import Task
from toontown.ai import DatabaseObject
from toontown.estate import ClosetGlobals
def isClosetAlmostFull(av):
return False
class DistributedNPCTailorAI(Distribut... |
import logging
from django.core.management.base import BaseCommand
from dynamic_fixtures.fixtures.runner import LoadFixtureRunner
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help_text = "Load fixtures while keeping dependencies in mind."
args = "[app_label] [fixture_name]"
def add_argum... |
import collections
from itertools import izip
from Queue import PriorityQueue
import numpy
from chainer import Function
class TreeParser(object):
def __init__(self):
self.next_id = 0
def size(self):
return self.next_id
def get_paths(self):
return self.paths
def get_codes(self):
... |
"""Test NotebookApp"""
import logging
import os
import re
from tempfile import NamedTemporaryFile
import nose.tools as nt
from traitlets.tests.utils import check_help_all_output
from jupyter_core.application import NoStart
from ipython_genutils.tempdir import TemporaryDirectory
from traitlets import TraitError
from not... |
from pyramid.view import (
view_config,
view_defaults
)
@view_defaults(renderer='home.pt')
class TutorialViews:
def __init__(self, request):
self.request = request
@view_config(route_name='home')
def home(self):
return {'name': 'Home View'}
@view_config(route_name='hello')
... |
import os
from pymongo import MongoClient
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans
from sklearn.metrics import adjusted_rand_score
from sklearn.feature_extraction import text
stop_words = text.ENGLISH_STOP_WORDS.union([
"carpediem", "Carpediem", "olin", "lists",... |
from flask import Flask, url_for,render_template
app = Flask(__name__)
@app.route('/')
def helloWorld():
return 'Hello World!'
@app.route('/dashboard', methods=['GET'])
def showDashboard():
return render_template('index.html')
if __name__ == '__main__':
app.run() |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class VirtualNetworksOperations(object):
"""VirtualNetworksOperations operations.
:param client: Client for service req... |
import urllib2;
import re;
import string;
import sys;
from BeautifulSoup import BeautifulSoup
month_num = {
'Jan' : '01',
'Feb' : '02',
'Mar' : '03',
'Apr' : '04',
'May' : '05',
'Jun' : '06',
'Jul' : '07',
'Aug' : '08',
'Sep' : '09',
'Oct' : '10',
'Nov' : '11',
'Dec' : '12'
''
};
def process_d... |
import sys
import pcapy
from scapy import *
from impacket.ImpactDecoder import *
try:
conf.verb=0
except NameError:
# Scapy v2
from scapy.all import *
conf.verb=0
if len(sys.argv) != 2:
print("Usage: ./replay.py <iface>")
sys.exit(1)
interface=sys.argv[1]
max_bytes = 2048
promiscuous = False
rea... |
TEST1 = """
Test of basic array creation and arithmetic.
>>> x=Numeric.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.])
>>> y=Numeric.array([5.,0.,3., 2., -1., -4., 0., -10., 10., 1., 0., 3.])
>>> a10 = 10.
>>> m1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
>>> m2 = [0, 0, 1, 0, 0, 1, 1, 0, 0, 0 ,0, 1]
>>> xm = ... |
import operator
import pinyin
from pinyintable import get_chewing, get_shengmu_chewing
from specialtable import *
pinyin_list = sorted(pinyin.PINYIN_LIST)
shengmu_list = sorted(pinyin.SHENGMU_LIST)
divided_list = []
resplit_list = []
def sort_all():
global divided_list, resplit_list
divided_list = sorted(divide... |
def cmp_state_equiv(r):
if r["service_has_been_checked"] == 0:
return -1
s = r["service_state"]
if s <= 1:
return s
else:
return 5 - s # swap crit and unknown
def cmp_host_state_equiv(r):
if r["host_has_been_checked"] == 0:
return -1
s = r["host_state"]
if s =... |
"""
* Interactive Toroid
* PDE by Ira Greenberg, rewritten in Python by Jonathan Feinberg
*
* Illustrates the geometric relationship between Toroid, Sphere, and Helix
* 3D primitives, as well as lathing principal.
*
* Instructions:
* UP arrow key pts++
* DOWN arrow key pts--
* LEFT arrow key segments--
* RIG... |
__all__ = []
import sys, math
from pysollib.gamedb import registerGame, GameInfo, GI
from pysollib.util import *
from pysollib.mfxutil import kwdefault
from pysollib.stack import *
from pysollib.game import Game
from pysollib.layout import Layout
from pysollib.hint import FreeCellType_Hint
from pysollib.pysoltk import ... |
import os
import sys
import time
import argparse
import logging
from libs.colorama import init
from libs.colorama import Fore, Back, Style
Program = 'Pro0beScan'
Version = 'Beta 4.0'
Author = 'bstaint'
Blog = 'http://www.bstaint.net/'
def print_logo():
print(Fore.YELLOW + '''
______ _____ _ _____
| _... |
"""Tests body rules."""
from __future__ import absolute_import
import unittest
import tests.util
from tests.util import GTUBE
class TestBodyRules(tests.util.TestBase):
def test_gtube_rule(self):
"""Check the GTUBE matched rule."""
self.check_symbols("Subject: test\n\n%s" % GTUBE,
... |
import sys
import os
import shutil
from optparse import Option, OptionParser
from spacewalk.common.rhnLog import initLOG, rhnLog
from spacewalk.common.rhnConfig import CFG, initCFG
from spacewalk.common import rhn_rpm
from spacewalk.server.rhnLib import parseRPMFilename, get_package_path
from spacewalk.server import rh... |
import os
import shutil
from StringIO import StringIO
import tarfile
import pmpkg
import tap
import util
def _getsection(fd):
i = []
while 1:
line = fd.readline().strip("\n")
if not line:
break
i.append(line)
return i
def make_section(data, title, values):
if not valu... |
from datetime import timedelta
from pywws.Process import WindFilter
class Calib(object):
"""Weather station calibration class with wind direction filter."""
def __init__(self, params, raw_data):
self.pressure_offset = eval(params.get('config', 'pressure offset'))
self.raw_data = raw_data
... |
""" Misc utility classes and helper functions for pynag
This module contains misc classes and conveninence functions
that are used throughout the pynag library.
"""
import os
import re
import subprocess
from pynag import errors
class UtilsError(errors.PynagError):
"""Base class for errors in this module."""
class C... |
import re
from threading import Lock
class SoSMap():
"""Standardized way to store items with their obfuscated counterparts.
Each type of sanitization that SoSCleaner supports should have a
corresponding SoSMap() object, to allow for easy retrieval of obfuscated
items.
"""
# used for regex skips ... |
import argparse
from collections import defaultdict
import glob
import itertools
import os
import re
import subprocess # nosec: B404
import sys
ALIASES = {
'abhi-ohri': 'Abhinav Ohri',
'Antonio Larrosa <alarrosa@suse.com>': 'Antonio Larrosa',
'Lukas Lalinsky <lalinsky@gmail.com>': 'Lukáš Lalinský',
'pe... |
import gc
from twisted.internet import defer
from twisted.trial import unittest
from buildbot.process.properties import Interpolate
from buildbot.secrets.manager import SecretManager
from buildbot.test.fake import fakemaster
from buildbot.test.fake.fakebuild import FakeBuild
from buildbot.test.fake.secrets import FakeS... |
from AWSScout2.finding import *
class CloudTrailFinding(Finding):
def __init__(self, description, entity, callback, callback_args, level, questions):
self.keyword_prefix = 'cloudtrail'
Finding.__init__(self, description, entity, callback, callback_args, level, questions)
def checkLoggingIsEnable... |
'''
Created on Dec 24, 2011
@author: ajju
'''
from common.DataObjects import VideoHostingInfo, VideoInfo, VIDEO_QUAL_SD
from common import HttpUtils, AddonUtils
import re
def getVideoHostingInfo():
video_hosting_info = VideoHostingInfo()
video_hosting_info.set_video_hosting_image('')
video_hosting_info.set_... |
import os
import heapq
import traceback
try:
import autotest.common as common
except ImportError:
import common
import logging
from autotest.client.shared import error, mail
from autotest.client.shared.settings import settings
from autotest.scheduler import drone_utility, drones
from autotest.scheduler import s... |
"""
Simple MalZoo module to search samples to VirusTotal and print the results of samples.
*** WARNING *** Watch your API Calls! *** WARNING ***
"""
from malzoo.common.abstract import CustomModule
import requests
import json
class VirusTotal(CustomModule):
# Malzoo required fields
name = 'virustotal'
versio... |
from urbansim.datasets.interactions import InteractionDataset
class HouseholdXNeighborhoodDataset(InteractionDataset):
pass |
c = get_config() |
LANG_TEXT = {'de_DE': {'T1': 'F\xc3\xbcr Sprachauswahl Hoch/Runter-Tasten nutzen. Danach OK dr\xc3\xbccken.',
'T2': 'Sprachauswahl',
'T3': 'Abbrechen',
'T4': 'Speichern'},
'ar_AE': {'T1': '\xd9\x85\xd9\x86 \xd9\x81\xd8\xb6\xd9\x84\xd9\x83 \xd8\xa3\xd8\xb3\xd8\xaa\xd8\xae\xd8\xaf\xd9\x8... |
"""enhance_backend.py - Image enhancement handler and dialog (e.g. contrast,
brightness etc.)
"""
from mcomix.preferences import prefs
from mcomix import image_tools
class ImageEnhancer:
"""The ImageEnhancer keeps track of the "enhancement" values and performs
these enhancements on pixbufs. Changes to the Image... |
import os
from opus_core.model import Model
class AbstractEmme2TravelModel(Model):
"""Basic functionality used by all of the emme/2 models.
Must be subclassed before use.
"""
def __init__(self, config):
self.config = config
self.emme_cmd = config['travel_model_configuration'].get('emme_c... |
import unittest
import mock
from tests.mock import mock_factory
from xcrawler.core.crawler.page_scraper import PageScraper
from xcrawler.core.crawler.page import Page
from xcrawler.pythonutils.converters.object_converter import ObjectConverter
class TestPageScraper(unittest.TestCase):
def setUp(self):
objec... |
import mock
class MPathTestCase(mock.TestCase):
# creating devices, user_friendly_names set to yes
output1 = """\
create: mpathb (1ATA ST3120026AS 5M) undef ATA,ST3120026AS
size=112G features='0' hwhandler='0' wp=undef
`-+- policy='round-robin 0' prio=1 status=undef
... |
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.com/COPYRIGHT for license and copyright information
"""
import UserList
from xml.dom import NoModificationAllowedErr
class NodeList(UserList.UserList):
def __init__(... |
import apt_pkg
import sys
def main():
apt_pkg.init()
cache = apt_pkg.Cache()
depcache = apt_pkg.DepCache(cache)
depcache.Init()
i=0
all=cache.PackageCount
print "Running DepCache test on all packages"
print "(trying to install each and then mark it keep again):"
# first, get all pkgs... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('terminal', '0026_auto_20201027_1905'),
]
operations = [
migrations.AlterField(
model_name='session',
name='terminal',
field=... |
import psycopg
from DBManager import DBManager
class Psycopg(DBManager):
# exceptions
ProgrammingError = psycopg.ProgrammingError
# interface
def connect(self, **kwds):
return psycopg.connect(**kwds)
__id__ = "$Id: Psycopg.py,v 1.2 2005/04/05 23:31:15 aivazis Exp $" |
from pyasn1.type import constraint, namedval
( Integer, ObjectIdentifier, OctetString, ) = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
( Bits, Integer32, ModuleIdentity, MibIdentifier, ObjectIdentity, TimeTicks, mib_2, ) = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Integer32", "M... |
from urbansim.abstract_variables.abstract_travel_time_variable_for_non_interaction_dataset import abstract_travel_time_variable_for_non_interaction_dataset
class am_total_transit_time_walk_from_home_to_work(abstract_travel_time_variable_for_non_interaction_dataset):
"""Travel time from home zone to work zone.
T... |
import os
class DevError(RuntimeError):
def __init__(self, msg):
RuntimeError.__init__(self, "programming error: %s" % msg)
def listify(l):
if l is None:
return []
elif not isinstance(l, list):
return [l]
else:
return l
def xml_escape(xml):
"""
Replaces chars ' " ... |
execfile('r.py')
import os, sys, gzip, numpy, random
import lsst.afw.detection as afwDetection
import lsst.afw.image as afwImage
import lsst.afw.display.ds9 as ds9
import lsst.meas.astrom.sip as sip
import simplePlot, pyCommon, matchTrimToDet
from lsst.sims.catalogs.measures.astrometry.Astrometry import *
refMagThresh ... |
""" Python KNX framework
License
=======
- B{PyKNyX} (U{https://github.com/knxd/pyknyx}) is Copyright:
- © 2016-2017 Matthias Urlichs
- PyKNyX is a fork of pKNyX
- © 2013-2015 Frédéric Mantegazza
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
'''Unit tests for the DataRegion class.'''
import sys
sys.path.append('../lib')
sys.path.append('lib')
import unittest
import tsumufs
import os_mock as os
class InstanceCheck(unittest.TestCase):
def testInstanciation(self):
tsumufs.cachePoint = '/'
tsumufs.CacheManager()
class CacheOpcodeCheck(unittest.TestCa... |
from __future__ import print_function, unicode_literals
import re
from bs4 import BeautifulSoup
from requests.compat import quote_plus
from requests.utils import dict_from_cookiejar
from sickbeard import logger, tvcache
from sickchill.helper.common import convert_size, try_int
from sickchill.providers.torrent.TorrentPr... |
from unittest import TestCase
from artictools.pictograms.arasaac import find_pictograms
class TestArasaac(TestCase):
def test_find_pictograms_unique(self):
result = []
page1 = find_pictograms("food", 0)
self.assertGreater(len(page1.result), 0)
result += page1.result
max_pages... |
import numpy as np
import os
import argparse
import espressomd
from espressomd.observables import ParticlePositions, ParticleVelocities, ParticleAngularVelocities
from espressomd.accumulators import Correlator
espressomd.assert_features(
["ENGINE", "ROTATION", "MASS", "ROTATIONAL_INERTIA"])
outdir = "./RESULTS_ENHA... |
import sys
import random
import tensorflow as tf
from tensorflow.models.rnn.translate import data_utils
import numpy as np
_buckets = [(5, 10), (10, 15), (20, 25), (40, 50)]
DATA_DIR = '/data/ntm/'
TRAIN_FN = 'training-giga-fren.tar'
DEV_FN = 'dev-v2.tgz'
def read_data(source_path, target_path, max_size=None):
'''
... |
"""Command for creating disks."""
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import constants
from googlecloudsdk.compute.lib import image_utils
from googlecloudsdk.compute.lib import utils
from googlecloudsdk.compute.lib import zo... |
import praw
from reddit import message
def authenticate():
"""
Logs into reddit, using credentials from praw.ini file
:return: Instance of Reddit
"""
print('Authenticating')
reddit = praw.Reddit('TsubasaRedditBot')
print("Authenticated as {}".format(reddit.user.me()))
return reddit
def p... |
from math import sqrt
from .data import Data
class Slope(Data):
name = 'mod:plot:slope'
DNA = Data.DNA + [('m', ('f', ('x', 'y')), 'x + y'), ('dx', 'float', 1), ('dy', 'float', 1), ('pill_width', 'float', 1), ('pill_length', 'float', 5), ('color', 'rgba', '#ff0085')]
def compact(self, system, height):
... |
import bpy
from math import pi, sqrt, degrees, atan
from functools import reduce
from fashion_project.modules.draw.curves.intersection_beziers_curve_and_axis import IntersectionBeziersCurveAndAxis
from fashion_project.modules.utils import mouse, get_point_abs_location, fp_expression
from fashion_project.modules.operato... |
import numpy as np
import matplotlib.transforms as transforms
from hyperspy.drawing.widgets import Widget1DBase
class LabelWidget(Widget1DBase):
"""A draggable text widget. Adds the attributes 'string' and 'bbox'.
These are all arguments for matplotlib's Text artist. The default
y-coordinate of the label is... |
from django.core.management import call_command
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "writeit.settings")
call_command('test', 'nuntium', 'contactos', 'mailit', verbosity=1) |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from ansible.plugins.terminal import TerminalBase
from ansible.errors import AnsibleConnectionFailure
class TerminalModule(TerminalBase):
terminal_stdout_re = [
re.compile(br"[\r\n]?(?:\([^\)]+\)){,5}(?:>|#)\s*... |
"""Tests that SimpleTable works just like PrettyTable for cloud-init.
Not all possible PrettyTable cases are tested because we're not trying to
reimplement the entire library, only the minimal parts we actually use.
"""
from cloudinit.simpletable import SimpleTable
from cloudinit.tests.helpers import CiTestCase
NET_DEV... |
import roslib
import sys
import rospy
import geomag
from geometry_msgs.msg import Vector3, Vector3Stamped
import numpy as np
from uav_utils import getMag, ThermalRise
from mathutils import saturation, quat2Reb, Vector2Array, quat2euler
from math import floor, exp, atan2, pi
from last_letter.msg import SimStates, SimSen... |
import os
import warnings
from views.main_network_view import MainNetworkView
from views.site_view import SiteView
from objects.objects import *
from objects.properties import property_classes
try:
import xlrd
import xlwt
from yaml import dump, load
except ImportError:
warnings.warn('Excel/YAML librarie... |
'''
Created on Feb 19, 2014
@author: Jing
'''
from pymaxwell import Cvector as CVector |
import samba.getopt as options
import ldb
import pwd
import os
import sys
import fcntl
import signal
import errno
import time
import base64
import binascii
from subprocess import Popen, PIPE, STDOUT
from getpass import getpass
from samba.auth import system_session
from samba.samdb import SamDB
from samba.dcerpc import ... |
import bpy
def load_font(font_path):
""" Load a new TTF font into Blender, and return the font object """
# get the original list of fonts (before we add a new one)
original_fonts = bpy.data.fonts.keys()
# load new font
bpy.ops.font.open(filepath=font_path)
# get the new list of fonts (after we added a new one)
... |
import re
import functools
from diffoscope.tools import tool_required
from diffoscope.difference import Difference
from .utils.file import File
from .utils.command import Command
class Sng(Command):
@tool_required('sng')
def cmdline(self):
return ['sng']
def feed_stdin(self, stdin):
with ope... |
"""DoJSON rules for Institutions."""
from __future__ import absolute_import, division, print_function
import re
from dojson import utils
from inspire_utils.helpers import force_list, maybe_float, maybe_int
from .model import institutions
from ..utils import force_single_element, get_record_ref
from ..utils.geo import p... |
"""
Get/Set Example
+++++++++++++++
Get/Set functions can be used for boolean, int, float, string and enum properties.
If these callbacks are defined the property will not be stored in the ID properties
automatically, instead the get/set functions will be called when the property is
read or written from the API.
"""
im... |
from __future__ import absolute_import, division, print_function
import os
import pkg_resources
from inspire_schemas.api import load_schema, validate
from inspirehep.modules.workflows.tasks.refextract import (
extract_journal_info,
extract_references_from_pdf,
extract_references_from_text,
extract_refer... |
"""InaSAFE Disaster risk tool by Australian Aid - Earthquake Impact Function
on Building.
Contact : ole.moller.nielsen@gmail.com
.. 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; eit... |
from __future__ import print_function, unicode_literals
import os
import os.path
import re
import time
from collections import OrderedDict
from threading import Lock
import dateutil
import sickbeard
import six
from sickbeard import common, db, helpers, logger, scene_exceptions, scene_numbering
from sickbeard.name_parse... |
"""this module will act as an intermediate through which other classes will get the data from"""
from . import data_location
from . import user_dataset, item_dataset, rating_dataset
from .user import User
from .item import Item
from .matrix import Matrix
class Data:
"""
Loads the data from the dataset and puts ... |
from django.conf.urls import url
from leaderboard.leaders.views import (
LeaderProfileView,
LeadersCountryListView,
LeadersGlobalListView,
)
urlpatterns = [
url('^profile/(?P<uid>\w+)/$',
LeaderProfileView.as_view(),
name='leaders-profile'),
url('^global/$',
LeadersGlobalList... |
import os
import shutil
import tempfile
import unittest
from manifestparser import convert
from manifestparser import ManifestParser
from StringIO import StringIO
here = os.path.dirname(os.path.abspath(__file__))
class TestDirectoryConversion(unittest.TestCase):
"""test conversion of a directory tree to a manifest ... |
from selenium.webdriver.common.by import By
from pages.base import BasePage
from pages.regions.download_button import DownloadButton
class HomePage(BasePage):
_download_button_locator = (By.ID, 'download-intro')
@property
def download_button(self):
el = self.find_element(*self._download_button_locat... |
from __future__ import absolute_import
from flask import make_response
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import tornad... |
from types import ClassType
import warnings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import OneToOneField
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
class InheritanceQuerySet(QuerySet):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.