code stringlengths 1 199k |
|---|
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import nukebox2000
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'NukeBox2000'
copyright = u"2016, Darren Dowdal... |
import platform
import socket
import sys
import os
from mule_local.JobGeneration import *
from mule.JobPlatformResources import *
from . import JobPlatformAutodetect
_job_id = None
def get_platform_autodetect():
"""
Returns
-------
bool
True if current platform matches, otherwise False
"""
... |
from org.jfree.data.xy import XYSeries, XYSeriesCollection
from org.jfree.chart.plot import PlotOrientation
from org.jfree.chart import ChartFactory
from geoscript.plot.chart import Chart
from org.jfree.chart.renderer.xy import XYSplineRenderer, XYLine3DRenderer
def curve(data, name="", smooth=True, trid=True):
"""
... |
"""
syslog2irc.main
~~~~~~~~~~~~~~~
:Copyright: 2007-2015 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""
from itertools import chain
from .announcer import create_announcer
from .processor import Processor
from .router import replace_channels_with_channel_names, Router
from .signals import irc_channel... |
from __future__ import print_function
from __future__ import unicode_literals
import re
import poetryutils2
def sample_words():
lines = poetryutils2.utils.debug_lines()
words = list()
for l in lines:
words.extend(w.lower() for w in l.split())
# words = [w[:-1] for w in words if w[-1] in {'.',','... |
from __future__ import unicode_literals
from collections import OrderedDict
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify
from django.db import models
from decimal import Decimal
@python_2_unicode_compatible
class Installation(models... |
__version__ = '0.70a1'
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Manager', 'Pipe', 'cpu_count', 'log_to_stderr', 'get_logger',
'allow_connection_pickling', 'BufferTooShort', 'TimeoutError',
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
'Event', ... |
__revision__ = "test/toolpath/VariantDir.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
"""
Verify that toolpath works with VariantDir() for an SConscript.
"""
import TestSCons
test = TestSCons.TestSCons()
test.subdir('subdir', ['subdir', 'src'], ['subdir', 'src', 'tools'])
test.write('SConstruct', """\
V... |
"""
Description: This lookup takes an AWS region and an RDS instance
name and returns the endpoint port.
Example Usage:
{{ lookup('aws_rds_endpoint_port_from_instance_name', ('eu-west-1', 'mydb')) }}
"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import *... |
from pylons_common.lib.log import create_logger
from pylons_common.lib.utils import pluralize
logger = create_logger('pylons_common.lib.datetime')
from datetime import datetime, timedelta
DATE_FORMAT_ACCEPT = [u'%Y-%m-%d %H:%M:%S', u'%Y-%m-%d %H:%M:%SZ', u'%Y-%m-%d', u'%m-%d-%Y', u'%m/%d/%Y', u'%m.%d.%Y', u'%b %d, %Y']... |
from etvnet_service import EtvnetService
from plex_config import PlexConfig
class PlexVideoService(EtvnetService):
def __init__(self):
config_name = Core.storage.abs_path(Core.storage.join_path(Core.bundle_path, 'Contents', 'etvnet.config'))
config = PlexConfig(config_name)
EtvnetService.__i... |
from hgraph import Hgraph
import amr_graph_description_parser
import re
import sys
import string
from collections import defaultdict as ddict
def format_tagged(s):
#return [tuple(p.split('/')) for p in s.split()]
return [p.rsplit('-',1)[0] for p in s.split()]
def format_amr(l):
amr_s = ' '.join(l)
amr_g = Hgrap... |
import hypertrack
hypertrack.secret_key = 'c237rtyfeo9893u2t4ghoevslsd'
customer = hypertrack.Customer.create(
name='John Doe',
email='john@customer.com',
phone='+15555555555',
)
print(customer) |
from datetime import date, datetime, timedelta
from itertools import chain
from operator import attrgetter
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.db.models import Q, get_app
from django.http im... |
"""
__MT_post__Par.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sun Feb 15 10:31:27 2015
______________________________________________________________________
"""
from ASGNode import *
from ATOM3Type import *
fro... |
"""DICOM Upper Layer Protocol Data Units (PDUs).
There are seven different PDUs:
- A_ASSOCIATE_RQ
- A_ASSOCIATE_AC
- A_ASSOCIATE_RJ
- P_DATA_TF
- A_RELEASE_RQ
- A_RELEASE_RP
- A_ABORT_RQ
::
from_primitive encode
+----------------+ ------> +------------+ -----> +-------------+
| D... |
from lib import script
import random
rand = random.randint
def warp_uptown_east(pc):
result = script.select(pc, ("enter", "north", "south", "west", "cancel"), "warp")
if result == 1:
script.warp(pc, 10023000, rand(217, 218), rand(126, 129)) #アップタウン
elif result == 2:
script.warp(pc, 10023400, rand(126, 129), rand... |
"""
This module simply sends request to the Digital Ocean API,
and returns their response as a dict.
"""
import requests
API_ENDPOINT = 'https://api.digitalocean.com'
class DoError(RuntimeError):
pass
class DoManager(object):
def __init__(self, client_id, api_key):
self.client_id = client_id
sel... |
from prov.model import ProvBundle, Namespace, Literal, PROV, XSD, Identifier
import datetime
def primer_example():
# https://github.com/lucmoreau/ProvToolbox/blob/master/prov-n/src/test/resources/prov/primer.pn
#===========================================================================
# document
g = P... |
raise NotImplementedError("markupbase is not yet implemented in Skulpt") |
"""
:Copyright: 2007-2015 `Jochen Kupperschmidt <http://homework.nwsnet.de/>`_
:License: MIT, see LICENSE for details.
"""
from __future__ import unicode_literals
from unittest import TestCase
from nose2.tools import params
from syslog2irc.irc import Channel
class IrcChannelTestCase(TestCase):
@params(
(Cha... |
'''
网易云音乐 Ui
'''
import hashlib
import re
import curses
import terminalsize
from api import NetEase
from scrollstring import scrollstring, truelen
from storage import Storage
from config import Config
import logger
from utils import notify
log = logger.getLogger(__name__)
try:
import dbus
dbus_activity = True
e... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iamhhb.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is reall... |
from smserver import models
from smserver import smutils
from smserver.chathelper import with_color
from smserver.chatplugin import ChatPlugin
from smserver.models import ranked_chart
from smserver.models.ranked_chart import Diffs
class ChatHelp(ChatPlugin):
command = "help"
helper = "Show help"
def __call_... |
__author__ = 'brandon.corfman'
AVERAGED_OVER_ALL_AZIMUTHS = -1
AVERAGED_ON_NON_ZERO_AVS = 0
BY_AZIMUTH = 1
GYPSY_PINK = (0.6745, 0.196, 0.3882) # color coveted by JJS; used for blast volumes
WHITE = (1.0, 1.0, 1.0)
CMPID, R1, R2, R3, Z1, Z2 = range(6) |
"""
:class:`RulerCtrl` implements a ruler window that can be placed on top, bottom, left or right
to any wxPython widget.
Description
===========
:class:`RulerCtrl` implements a ruler window that can be placed on top, bottom, left or right
to any wxPython widget. It is somewhat similar to the rulers you can find in tex... |
from __future__ import absolute_import
from __future__ import division
from builtins import object
from past.utils import old_div
from proteus import *
from proteus.default_p import *
import os
try:
from .parameters_for_poisson import *
except:
from parameters_for_poisson import *
name = "poisson"
assert ct.nd=... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('edegal', '0025_photographer_flickr_handle'),
]
operations = [
migrations.CreateModel(
name='LarppikuvatPhotographerProfile',
... |
import pickle
import sqlite3
import threading
from abc import ABCMeta, abstractmethod
from collections import namedtuple
InternalEvent = namedtuple(
'InternalEvent',
('identifier', 'state_change_id', 'block_number', 'event_object'),
)
class StateChangeLogSerializer(object):
""" StateChangeLogSerializer
... |
import contextlib
from uuss.server import model
from lolapps.common import uums
from lolapps.util import json
import os
import simplejson
import struct
import time
try:
# Try importing the C++ extension version
import uuss_pb
except:
# The dynamic python version will automatically be used
pass
from uuss... |
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
import profiles.urls
import accounts.urls
from . import views
urlpatterns = [
url(r'^$', views.HomePage.as_view(), name='home'),
url(r'^users/', include(profiles... |
import graph
from depth_first_search import depth_first_search
from breadth_first_search import breadth_first_search
edges = [(0, 1), (0, 2), (0, 3), (1, 4), (1, 5), (2, 6),
(2, 7), (3, 8), (3, 9), (4, 10), (4, 11)]
G, _ = graph.create_graph(edges)
start_vertex = G.get_vertex(0)
breadth = breadth_first_search(... |
import pdb
class TimingDiagram:
def print_diagram(self, xtsm_object):
pdb.set_trace()
seq = xtsm_object.XTSM.getActiveSequence()
cMap=seq.getOwnerXTSM().getDescendentsByType("ChannelMap")[0]
#channelHeir=cMap.createTimingGroupHeirarchy()
#channelRes=cMap.findTimingGroupResolu... |
from rest_framework import status
from rest_framework.authtoken.models import Token
from django.utils.translation import ugettext_lazy as _
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from drfpasswordless.settings import api_settings, DEFAUL... |
from __future__ import division
import matplotlib.pyplot as plt
import random
import numpy as np
class Player:
def __init__(self, state, q):
self.state = state
self.gain_matrix = np.array([[q, 0], [0, 1-q]])
def action_distribution(self, N, m, players):
adj_matrix = np.zeros((N, N)) ... |
from test_framework.authproxy import JSONRPCException
from test_framework.util import check_json_precision, initialize_chain, \
start_nodes, start_node, stop_nodes, wait_litecoinzds, litecoinzd_processes
import os
import sys
import shutil
import tempfile
import traceback
def check_array_result(object_array, to_matc... |
import randomcolor
import random
def main():
hues = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'pink',
'monochrome', 'random']
luminosities = ['bright', 'light', 'dark', 'random']
formats = ['rgb', 'hex']
colors = []
rand_color = randomcolor.RandomColor(42)
rand = random.... |
from utils import instrument
from azove.utils import recursive_int_to_big_endian
import mock
@given(u'a packet') # noqa
def step_impl(context):
context.packet = context.packeter.dump_packet('this is a test packet')
@when(u'peer.send_packet is called') # noqa
def step_impl(context):
context.peer.send_packet(co... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smarturl.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... |
'''
Copyleft Oct 24, 2015 Arya Iranmehr, PhD Student, Bafna's Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import pandas as pd
import pylab as plt
import matplotlib as mpl
from matplotlib.cm import *
import os,sys;home=os.path.expanduser('~') +'/'
mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'],... |
"""
The MIT License (MIT)
Copyright (c)2013 Rich Friedel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pu... |
import urllib2, urllib
import math
import time
import traceback
ServerAddr="http://<enter WebSpark IP address here>:8001"
RegisterURL=ServerAddr + "/addapi?"
RespondURL=ServerAddr + "/respond?"
errwaitseconds = 3
element = '<li class="list-group-item">first prime above %d is %d</li>'
with open('template.html') as f:
t... |
import types
from sikwidgets.region_group import RegionGroup
from sikwidgets.util import to_snakecase
from sikwidgets.widgets import *
def gen_widget_method(widget_class):
def widget(self, *args, **kwargs):
return self.create_widget(widget_class, *args, **kwargs)
return widget
class Window(RegionGroup):... |
def b():
print("hooora!")
dic1 = {1: 2, 1: 4}
for i in dic1.items():
if 'a' == i:
b()
else:
break
print ":(" |
"""
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
"""
import sys
from problembaseclass import ProblemBaseClass
class Problem5(ProblemBaseClass):
"""
@cla... |
import quickfix
import copy
import uuid
import random
import datetime
import yaml
from twisted.internet import task
from sim import (FixSimError, FixSimApplication, create_fix_version,
instance_safe_call, create_logger, IncrementID, load_yaml)
class Subscription(object):
def __init__(self, symbol):... |
import logging
import socket
import struct
import ipaddress
def is_ipv4_belongs_to_network(ipv4, network):
# netmask -> CIDR
network, netmask = network
network_address = socket.inet_pton(socket.AF_INET, netmask)
cidr_value = bin(struct.unpack('!L', network_address)[0])[2:].index('0')
cidr = "{networ... |
from sklearn.utils import resample
from darts.api.dataset import Subset
def dummy_indices(dataset):
""" Get indexes for the dataset """
return [x for x in range(len(dataset))]
def sample(dataset, num_samples, replace=True):
""" Sample the dataset """
data_idx = dummy_indices(dataset)
sample_idx = re... |
__author__ = 'Meemaw'
import math
def isPrime(stevilo):
if stevilo == 1:
return 0
meja = int(math.sqrt(stevilo)+1)
if(stevilo > 2 and stevilo % 2 == 0):
return 0
for i in range(3,meja,2):
if stevilo % i == 0:
return 0
return 1
def izLeve(stevilo):
for i in ran... |
import subprocess
from pkg_resources import resource_filename
def playit(file):
"""
Function used to play a sound file
"""
filepath = resource_filename(__name__, 'sound/' + file)
subprocess.Popen(["paplay", filepath]) |
from os import getenv
from time import time, sleep
from core import Platform, Instance
from SoftLayer import Client
from SoftLayer.CCI import CCIManager
from paramiko import SSHClient
class _SuppressPolicy(object):
def missing_host_key(self, client, hostname, key):
pass
class CCIPlatform(Platform):
_req... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "news_project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is... |
"""Code to implement Seaborn graphics output for ANI analyses."""
import warnings
import matplotlib # pylint: disable=C0411
import pandas as pd
import seaborn as sns
matplotlib.use("Agg")
import matplotlib.pyplot as plt # noqa: E402,E501 # pylint: disable=wrong-import-position,wrong-import-order,ungrouped-imports
def... |
"""goto_cloud URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... |
from __future__ import with_statement
import sys
from collections import deque
from charpos import CharposStream
from bindings import bindings
import printervars
__all__ = ["PrettyPrinter", "pprint"]
class PrintLevelExceeded(StopIteration):
pass
class Token(object):
"""Base class for prettyprinter tokens.
T... |
from django.core import serializers
from django.http import HttpResponse, JsonResponse
from Course.models import *
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST, require_GET
import json
@csrf_exempt
@require_POST
def addCourseCurriculum(request):
response... |
import logging
import requests
import slacksocket.errors as errors
log = logging.getLogger('slacksocket')
class WebClient(requests.Session):
""" Minimal client for connecting to Slack web API """
def __init__(self, token):
self._token = token
super(WebClient, self).__init__()
def get(self, u... |
'''Tests for the ValidateHash object'''
from __future__ import absolute_import
import unittest
from nose.tools import assert_true, assert_false
from hashit.core.hash_data import HashData
from hashit.core.hash_type import HashType
from hashit.service.validate_hash import ValidateHash
from hashit.utils.data_encap import ... |
"""
usage: gidget add data <filename>
gidget add reference <filename>
"""
from docopt import docopt
if __name__ == '__main__':
print(docopt(__doc__)) |
from re import match
from mapi.exceptions import (
MapiNetworkException,
MapiNotFoundException,
MapiProviderException,
)
from mapi.utils import clean_dict, request_json
__all__ = [
"omdb_search",
"omdb_title",
"tmdb_find",
"tmdb_movies",
"tmdb_search_movies",
"tvdb_episodes_id",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'CustomUser.email_on_new_foller'
db.delete_column('auth_user', 'email_on_new_foller')
# Adding field 'CustomUs... |
"""Add user table to support doorman and oauth authentication.
Revision ID: 0bc0a93ac867
Revises: fd28e46e46a6
Create Date: 2016-05-11 11:01:40.472139
"""
revision = '0bc0a93ac867'
down_revision = 'fd28e46e46a6'
from alembic import op
import sqlalchemy as sa
import doorman.database
def upgrade():
### commands auto ... |
"""This module contains the ``list_user`` command."""
import click
from ovmm.handlers.postgres import PostgreSQLDatabaseHandler
@click.command()
def list_user():
"""List users managed by ovmm."""
click.echo('\n{:-^60}'.format(' Process: List Users '))
postgres = PostgreSQLDatabaseHandler()
user_list = p... |
"""
.. module:: ellipse_fitting
:platform: Unix, Windows
:synopsis: Ellipse fitting algorithms and handling of ellipse information.
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2013-05-05, 23:22
"""
from __future__ import division
from __future__ import print_function
from __future__ import uni... |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import eppy
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"nbsphinx",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "eppy"
copyright = "2020, Santosh Philip"
auth... |
"""
This script sends confirmation messages to recently registered users.
It should be run periodically so that users receive a registration
confirmation link soon after they have registered.
rbp@isnomore.net
"""
import smtplib
from email.message import Message
from . db import Connection
from . config import options
d... |
version = '1.0' |
a = "python"
print(a*2)
try:
print(a[-10])
except IndexError as e:
print("인덱스 범위를 초과 했습니다.")
print(e)
print(a[0:4])
print(a[1:-2])
print("%-10sjane." % "hi")
b = "Python is best choice."
print(b.find("b"))
print(b.find("B"))
try:
print(b.index("B"))
except ValueError as e:
print(e)
c = "hi"
print(c.... |
from unittest import TestCase
from mwclient import Site
from bookhelper import ExistingBook
from . import PageMock, SiteMock, TESTBOOK1_TXT
class TestInit(TestCase):
def setUp(self):
self.site = SiteMock()
def test_book(self):
book = ExistingBook(self.site, "Testbook1", "live")
self.asse... |
"""All forms for the extension."""
from django.forms import ModelForm
from .models import WebResource
class WebResourceForm(ModelForm):
"""Form for a single web resource."""
class Meta:
"""Form meta."""
model = WebResource
fields = ('name', 'description', 'url', 'colour', 'symbol') |
import logging
from django.conf import settings
from mock_api.http_utils import make_request
logger = logging.getLogger(__name__)
def run_api_endpoint_callbacks(api_endpoint):
responses = []
for api_callback in api_endpoint.callbacks.all():
logger.debug("Make callback: %s", api_callback)
respons... |
"""
Classes::
VASPData -- A collection of functions that wrap bash code to extract
data from VASP output into managable .dat (.txt) files.
"""
import numpy as np
from subprocess import call, check_output
from ast import literal_eval
class VASPData(object):
"""
A collection of functions that wrap bash code... |
import unittest
from GUI.PopUps.FileHandlerPopUp import FileHandlerPopUp
from Constants.FileHandlingMode import *
class TestFileHandlingPopUp(unittest.TestCase):
def setUp(self):
self.title = "test"
self.callbackbuttontext = "button"
self.path = "test_path"
self.filters = ["*.jpg", "... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('registration', '0003_limbomember_mother_tongue'),
]
operations = [
migrations.RenameModel(
old_name='LimboMember',
new_name='Applicant',
),
] |
import os
import pytest
@pytest.fixture(scope='session')
def testdata():
"""
Simple fixture to return reference data
:return:
"""
class TestData():
def __init__(self):
self.datadir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data')
def fn(self, fn):
... |
"""
test_protein_motif_encoder
----------------------------------
Tests for `protein_motif_encoder` module.
"""
import pandas as pd
import pytest
from click.testing import CliRunner
import cli
def test_command_line_interface():
runner = CliRunner()
result = runner.invoke(cli.main)
assert result.exit_code ==... |
from __future__ import unicode_literals
import re
import socket
import time
from netmiko.cisco_base_connection import CiscoSSHConnection
from netmiko.ssh_exception import NetMikoTimeoutException
class LinuxSSH(CiscoSSHConnection):
def disable_paging(self, *args, **kwargs):
"""Linux doesn't have paging by de... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="scatter.unselected.textfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... |
from flask import (Blueprint, current_app as app,
g, request, make_response,
jsonify, session)
from ..models import ModelError, Session
from ..models.post import Post, Draft, PostOperator
from .helpers import (require_int, JumpDirectly)
api_bp = Blueprint('api', __name__)
post_op =... |
"""
Represents protected content
"""
from django.conf.urls import url
from django.http import HttpResponse
def testview(request):
return HttpResponse()
urlpatterns = [url(r"^$", testview, name="test_url_content")] |
from flask import current_app, redirect, url_for, request, session, flash, send_file
from flask.ext import restful
from flask.ext.login import login_required, current_user, login_user, logout_user
import twitter
from request_parsers import *
from datetime import datetime
from models import *
from rauth.service import O... |
""" README
This script is deprecated. Please use https://github.com/device42/servicenow_device42_mapping
This script reads CIs from Servicenow and uploads them to Device42.
It has 2 modes:
1. Full migration - when the TIMEFRAME is set to 0
2. Synchronization - when the TIMEFRAME is set to anything ... |
import os
import ntpath
import glob
from pyhammer.tasks.taskbase import TaskBase
from pyhammer.utils import execProg
class MakeNugetPackageTask(TaskBase):
"""Make Nuget Package Task"""
def __init__( self, csProjectPath, solutionDir, tempDir, publishDir, visualStudioVersion = "12.0" ):
super(MakeNugetPac... |
"""add-hikes
Revision ID: f7888bd46c75
Revises: 820bb005f2c5
Create Date: 2017-02-16 07:36:06.108806
"""
revision = 'f7888bd46c75'
down_revision = 'fc92ba2ffd7f'
from alembic import op
import sqlalchemy as sa
import geoalchemy2
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create... |
import sys
import os
import unittest
class OpenCCTest(unittest.TestCase):
def setUp(self):
self.openCC = OpenCC()
def test_hk2s(self):
self.openCC.set_conversion('hk2s')
words = '香煙(英語:Cigarette),為煙草製品的一種。滑鼠是一種很常見及常用的電腦輸入設備。'
self.assertEqual(self.openCC.convert(words), '香烟(英语:Ci... |
from django.contrib import admin
from .models import Lesson, Series
class LessonAdmin(admin.ModelAdmin):
pass
class SeriesAdmin(admin.ModelAdmin):
pass
admin.site.register(Lesson, LessonAdmin)
admin.site.register(Series, SeriesAdmin) |
name = 'Zed A. Shaw'
ages = 35 # not a lie
height = 74 # inched
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
print "Let's talk about %s." % name
print "He's %d inched tall." % height
print "He's %d pounds heavy." % weight
print "Actually that's not too heavy."
print "He's got %s eyes and %s hair." % ... |
import sys
import argparse
import os
import csv
import tabix
import gzip
import io
from collections import Counter
def chromosom_sizes(hg19_size_file):
''' Return chromosom size range ex: size["chr13"] = 234324 '''
results = {}
with open(hg19_size_file) as file:
reader = csv.reader(file, delimiter="\t")
for line... |
class Campus(object):
def __init__(self,dados=None):
if dados is not None:
self.id = dados ['id']
self.nome = dados ['nome']
def getId(self):
return self.id
def setNome(self,nome):
self.nome = nome
def getNome(self):
return self.nome |
SAMPLES_YAML = {
'a': """\
- a1-a: [pk]
- [A1]
- [A2]
- [B1]
- [C1]
- [C2]
- [D1]
- [E1]
- [P1]
""",
'b': """\
- a1-a: [pk]
- [B1]
- [C1]
- [C2]
- [D1]
- [E1]
- a1-b: [pk]
... |
TWITTER = {
'AUTH': {
'consumer_key': 'XXXX',
'consumer_secret': 'XXXX',
'token': 'XXXX',
'token_secret': 'XXXX',
}
}
UPTIME = {
'root_uri': 'http://graphite.balancedpayments.com/render/?',
'username': 'username',
'password': 'password',
'services': {
'DA... |
from pybrain.datasets import SequentialDataSet
from itertools import cycle
from pybrain.tools.shortcuts import buildNetwork
from pybrain.structure.modules import LSTMLayer
from pybrain.supervised import RPropMinusTrainer
from pybrain.tools.customxml.networkwriter import NetworkWriter
from pybrain.tools.customxml.networ... |
from seleniumbase import BaseCase
from seleniumbase import MasterQA
class CasoDiProva(BaseCase):
def __init__(self, *args, **kwargs):
super(CasoDiProva, self).__init__(*args, **kwargs)
self._language = "Italian"
def apri(self, *args, **kwargs):
# open(url)
return self.open(*args,... |
import os
import inspect
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
TRACEBACK_INSPECTOR = inspect.currentframe
DEBUG = logging.DEBUG
INFO = logging.INFO
ERROR = logging.ERROR
WARNING = logging.WARN
CRITICAL = logging.CRITICAL
def debugCaller(traceback=None):
""" Function who re... |
import pygame
import sys
from pygame.locals import *
from gui import *
from conexao import *
from jogador import *
from Queue import Queue
from threading import Thread
"""
Cliente
Tp de Redes - Truco
UFSJ
Carlos Magno
Lucas Geraldo
Requisitos:
*python 2.7
*pygame
Modulo Principal.
"""
class Principal(Gui):
"""
... |
import os
import dj_database_url
import re
from django.conf import settings
from cabot.celeryconfig import *
from cabot.cabot_config import *
settings_dir = os.path.dirname(__file__)
PROJECT_ROOT = os.path.abspath(settings_dir)
TEMPLATE_DEBUG = DEBUG = os.environ.get("DEBUG", False)
ADMINS = (
('Admin', os.environ.... |
from m2core.m2core import M2Core, logger
from m2core import bases
from m2core import data_schemes
from m2core import db
from m2core import utils
from m2core import common |
class UndirectedGraphNode:
def __init__(self, x):
self.label = x
self.neighbors = []
class Solution:
# @param node, a undirected graph node
# @return a undirected graph node
def cloneGraph(self, node):
seen={}
visited=[]
seen[None] = None
head = Undirected... |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name =... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:52398")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.