text stringlengths 17 737k |
|---|
# libusb-1.0 python wrapper
from ctypes import Structure, LittleEndianStructure, \
CFUNCTYPE, POINTER, addressof, sizeof, cast, \
c_short, c_int, c_uint, c_size_t, c_long, \
c_uint8, c_uint16, c_uint32, \
c_void_p, c_char_p, py_object, string_a... |
#!/usr/bin/env python
"""
Classes for plugin download, installation, and registration.
"""
import ConfigParser
import os
import platform
import urllib
import urllib2
from optparse import OptionParser
from zipfile import ZipFile
BASE_URL = 'http://plugins.serverdensity.com/'
python_version = platform.python_version... |
# -*- coding: utf-8 -*-
"""Linters process files or lists of files for correctness."""
import itertools
import json
import logging
import os
import re
import signal
import subprocess
import sys
import lint_util
import six
import six.moves
from six.moves import cStringIO as StringIO
# Add vendor path so we can find ... |
# coding=utf-8
"""Test cases for Zinnia's views"""
from datetime import date
from django.test import TestCase
from django.utils import timezone
from django.contrib import comments
from django.contrib.sites.models import Site
from django.test.utils import override_settings
from django.test.utils import restore_template... |
import json
from functools import wraps
from django.http import Http404, HttpResponse
from django.shortcuts import get_object_or_404, render, redirect as _redirect
from django.views.generic import ListView, DetailView, FormView, TemplateView
from django.contrib import messages
from django.contrib.auth import login, a... |
#!/usr/bin/python
import time
import datetime
import random
timestr = time.strftime("%Y%m%d-%H%M%S")
otime = datetime.datetime(2014, 10, 10, 01, 30, 27)
timestr = time.strftime("%Y%m%d-%H%M%S", otime.timetuple())
f = open('access_log_'+timestr+'.log','w')
ips=["123.221.14.56","16.180.70.237","10.182.189.79","218.19... |
#http://pypi.python.org/pypi/cql/1.0.4
#http://code.google.com/a/apache-extras.org/p/cassandra-dbapi2 /
#http://cassandra.apache.org/doc/cql/CQL.html
from collections import namedtuple
from cassandra.cluster import Cluster
from cassandra.query import SimpleStatement, Statement
try:
import Queue as queue
except Im... |
from __future__ import absolute_import
import ast
import os
import sys
import threading
from collections import defaultdict
from itertools import chain
from colorama import AnsiToWin32
from colorama import Back
from colorama import Fore
from colorama import Style
from six import string_types
from .util import rudime... |
from datetime import date, datetime
from django.template.defaultfilters import slugify
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
from rapidsms.contrib.locations.models ... |
import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum
from electrum.bitcoin import TYPE_ADDRESS
from electrum import WalletStorage, Wallet
from electrum_gui.kivy.i18n import _
from electrum.paymentrequest import InvoiceStore
from electr... |
# coding= utf8
"""
This module contains the main functions used to parse URDF files.
"""
import xml.etree.ElementTree as ET
import json
import numpy as np
import itertools
import warnings
# Ikpy imports
from ikpy import link as lib_link
from ikpy import logs
def _find_next_joint(root, current_link, next_joint_name)... |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# -*- coding: utf-8 -*-
"""
flask.ext.admin._compat
~~~~~~~~~~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details... |
from flask import current_app
from dominate import tags
from visitor import Visitor
class BaseRenderer(Visitor):
def visit_object(self, node):
if current_app.debug:
return tags.comment(
'no implementation in {} to render {}'.format(
self.__class__.__name__,... |
# Copyright (c) 2014-2015, Jeremy Ehrhardt <jeremy@bat-country.us>
# Copyright (c) 2016, Patrick Uiterwijk <patrick@puiterwijk.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistribu... |
def is_digit(ch):
return "0" <= ch <= "9"
def is_hex_digit(ch):
return is_digit(ch) or "A" <= ch <= "F" or "a" <= ch <= "f"
def is_uppercase_letter(ch):
return "A" <= ch <= "Z"
def is_lowercase_letter(ch):
return "a" <= ch <= "z"
def is_letter(ch):
return is_uppercase_letter(ch) or is_lowerc... |
import json
import logging
import sys
from dnstrails import APIError
from dnstrails import DnsTrails
log = logging.getLogger('dnstrails')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
... |
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
# pylint: disable=too-many-locals
# pylint: disable=too-many-branches
"""Processes statistics from HAProxy and pushes them to Graphite
Usage:
haproxystats-process [-f <file> ] [-p | -P]
Options:
-f, --file <file> configuration file with settings
... |
# Copyright 2015 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 root_numpy
import numpy as np
import pandas as pd
import ROOT
from PyAnalysisTools.ROOTUtils.FileHandle import FileHandle
from PyAnalysisTools.PlottingUtils.PlotConfig import find_process_config, parse_and_build_process_config
from PyAnalysisTools.PlottingUtils.PlotConfig import PlotConfig as pc
import PyAnalysi... |
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import platform
from UM.Qt.QtApplication import QtApplication
from UM.Scene.SceneNode import SceneNode
from UM.Scene.Camera import Camera
from UM.Scene.Platform import Platform
from UM.Math.Vector import Vector
from UM.Mat... |
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
# Copyright (c) OpenMMLab. All rights reserved.
from abc import ABCMeta, abstractmethod
import torch
from mmcv.cnn.utils.weight_init import constant_init
from mmcv.ops import batched_nms
from mmcv.runner import BaseModule, force_fp32
from mmdet.core.utils import filter_scores_and_topk, select_single_mlvl
class Base... |
class Solution(object):
def lengthOfLastWord(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
res=0
tlen=0
for i in xrange(len(s)):
if s[i]==' ':
tlen=0
else:
tle... |
# 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... |
# -*- coding: utf-8 -*-
#
# HappyBase documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 20 17:40:16 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... |
__author__ = 'Patrick Liu and Olga Botvinnik'
import pandas as pd
import string
import glob
import numpy as np
import sys
class Collector(object):
def __init__(self, base_name=None):
self.base_name = base_name
self.tool_name = ''
self.version = 0
return
def parse(self, file_pat... |
print(" reset python interpreter ...")
import os
clear = lambda: os.system('clear')
clear()
import time
import random
# import plot_history as ph
import image_loader as il
import tensorflow as tf
# import matplotlib.pyplot as plt
import numpy as np
# computation time tick
start_clock = time.clock()
start_time = ti... |
from glob import glob
import json
import os
preproc_inputs = {'fieldmaps': [], 'fieldmaps_meta': [], 'epi': '', 'epi_meta': '', 'sbref': '',
'sbref_meta': '', 't1': ''}
def _walk_dir_for_prefix(target_dir, prefix):
return [x for x in next(os.walk(target_dir))[1]
if x.startswith(prefi... |
#!/opt/local/bin/python2.5
#=============================================================================================
# Render a replica trajectory in PyMOL
#=============================================================================================
#=============================================================... |
# -*- coding: utf-8 -*-
#
# goless documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 16 15:12:38 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
#!/usr/bin/env python3
# Biligrab
#
# Author: Beining@ACICFG https://github.com/cnbeining
# Author: StarBrilliant https://github.com/m13253
#
# Biligrab is licensed under MIT licence
# Permission has been granted for the use of Danmaku2ASS in Biligrab
#
# Copyright (c) 2014
#
# Permission is hereby granted, free o... |
# encoding=utf8
import datetime
from distutils.version import StrictVersion
import hashlib
import os.path
import random
from seesaw.config import realize, NumberConfigValue
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.task import SimpleTask, LimitConcurrent
from seesaw.tracker import GetItemFromTrac... |
# Copyright 2013 Donald Stufft
#
# 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, so... |
import csv
from threading import currentThread
from django import forms
from django.conf import settings
from django.contrib import admin
from django.shortcuts import get_object_or_404
from django.http import HttpResponse
from django.conf.urls.defaults import patterns, url
from django.db.models import Model
from djang... |
import numpy as np
from ctypes import byref, c_size_t
from numba.cuda.cudadrv.driver import device_memset, driver
from numba import cuda
from numba.cuda.testing import unittest, ContextResettingTestCase
from numba.cuda.testing import skip_on_cudasim, skip_on_arm
from numba.tests.support import linux_only
@skip_on_cud... |
# -*- coding: utf-8 -*-
#
# NSLS2 documentation build configuration file, created by
# sphinx-quickstart on Wed May 7 15:11:18 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
'''
@ Harris Christiansen (Harris@HarrisChristiansen.com)
January 2016
Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot
Bot_blob: Creates a blob of troops.
'''
import logging
from base import bot_base
# Show all logging
logging.basicConfig(level=logging.DEBUG)
##################... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pygeoutil documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 14 10:29:06 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... |
#!/usr/bin/env python2
# Copyright 2016 The Fontbakery Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
#
# SimpleCV documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 8 16:38:59 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pySMAC documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 13 09:53:58 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... |
# -*- coding: utf-8 -*-
# pylint: disable=C0103,W0622
'''
Sphinx documentation for Salt
'''
import functools
import sys
import os
import types
from sphinx.directives import TocTree
# pylint: disable=R0903
class Mock(object):
'''
Mock out specified imports
This allows autodoc to do its thing without havi... |
import openpathsampling.engines.openmm as omm_engine
import openpathsampling as paths
from nose.tools import assert_equal, assert_almost_equal
from test_helpers import data_filename, assert_close_unit
import openmmtools as omt
import simtk.unit as u
import numpy as np
import logging
logging.getLogger('openpathsampli... |
import mock
import unittest
import tempfile
from openquake.commonlib.oqvalidation import OqParam
TMP = tempfile.gettempdir()
class OqParamTestCase(unittest.TestCase):
def test_unknown_parameter(self):
# if the job.ini file contains an unknown parameter, print a warning
with mock.patch('logging.w... |
#!/usr/bin/env python
# @@@ START COPYRIGHT @@@
#
# 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 Li... |
"""
A collection of Algos used to create Strategy logic.
"""
from __future__ import division
import abc
import random
import re
import numpy as np
import pandas as pd
import sklearn.covariance
from future.utils import iteritems
import bt
from bt.core import Algo, AlgoStack, SecurityBase, is_zero
def run_always(f):... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# main.py file is part of spman
# Copyright 2016 MyRequiem <mrvladislavovich@gmail.com>
# All rights reserved
# spman - Slackware package manager
# Home page: https://github.com/MyRequiem/spman
# Spman is free software: you can redistribute it and/or modify
# it under... |
#!/usr/bin/python
#
# buildNBI.py - A tool to automate (or not) the building and modifying
# of Apple NetBoot NBI bundles
#
# Requirements: OS X 10.9 Mavericks - This tool relies on the 'imagetool'
# which AFAIK didn't ship prior to OS X 10.9
#
# This tool allows the user to bypass System Image Utility for creating a... |
#!/usr/bin/env python
# encoding: utf-8
import os
import sys
import json
import shutil
import subprocess
from datetime import datetime
project_name = 'petro'
def run_command(args):
print("Running: {}".format(args))
sys.stdout.flush()
subprocess.check_call(args)
def get_tool_options(properties):
op... |
import sys
CONFIG = {
'color': True,
'color_tasks': 4,
}
LOCALE = {
'execute': 'execute\t{}',
'abort': 'abort \t{} - {}',
'abort_bad_require': 'abort \t{} - {} require failed',
'abort_no_buildfile': 'abort \t- no build.py found',
'require': 'require\t{}',
'help_command': '{}\t- {}',
'help_creates': '\t- c... |
#!/usr/bin/python3
import sys
import csv
import os.path
import urllib.request
helpmessage = """Usage:
install <package name>
remove <package name>
update
upgrade"""
if len(sys.argv) >= 2 and len(sys.argv) <= 3:
if sys.argv[1] == "install":
print("Installing...")
if os.path.isfile("pkglist.csv") == True:
p... |
# -*- coding: utf-8 -*-
"""Integration test cases.
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
from testproj.app import views
from djangoflash.context_processors import CONTEXT_VAR
from djangoflash.middleware import _SESSION_KEY, FlashScope
class IntegrationTestCase(TestCase)... |
# -*- coding: utf-8 -*-
T_YEAR = 104
C_TERM = 1
week_dict = {'M': 'a', 'T': 'b', 'W': 'c', 'R': 'd', 'F': 'e', 'S': 'f', 'U': 'g'}
course_dict = {'1': 'a','2': 'b','3': 'c','4': 'd','N': 'e','5': 'f','6': 'g','7': 'h','8': 'i','9': 'j','A': 'k','B': 'l','C': 'm', 'D': 'n'}
DEPT_CHOICE = (('', '開課單位 Choose the course... |
import math
from message import AppendEntries, AppendEntriesResponse, RequestVote, RequestVoteResponse
class DownNode:
def receive(self,sender,message):
pass
def timer_trip(self):
pass
class Node:
def __init__(self,node_id,conf,rng,broker):
self.node_id = node_id
self.con... |
import os
import unicodedata
import grequests
import numpy as np
import pandas as pd
from serenata_toolbox.datasets import Datasets
def normalize_string(string):
if isinstance(string, str):
nfkd_form = unicodedata.normalize('NFKD', string.lower())
return nfkd_form.encode('ASCII', 'ignore').decod... |
from Tkinter import *
from nltk.tree import Tree, TreeToken
from nltk.token import Token, Location
class TreeView:
_X_SPACING = 20
_Y_SPACING = 25
def __init__(self, tree):
"""
Construct a new view of a Tree or a TreeToken.
"""
self._tree = tree
... |
#!/usr/bin/env python
import sys
import copy, re
import urllib
from pprint import pprint
import locale
from datetime import datetime
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, UnicodeDammit, Tag
from utils import fetch_html_content, fetch_rss_content
import chardet
# for datetime conversions
locale... |
import sys
import requests
DARK_VISION_BASE = "https://openwhisk-darkvisionapp-ics.mybluemix.net/"
DARK_VISION_UPLOAD = "upload"
DARK_VISION_VIDEO = "#!/videos/"
BM_NOTIFICATION = "https://iot-platform-ics.mybluemix.net/notification"
def postDarkVision(videofile):
multipart_form_data = {
"file": (videofi... |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# 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... |
"""
sentry.web.views
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import traceback
from datetime import timedelta
from django.conf import settings
fro... |
"""Defines control interfaces between a ROS application and Klamp't robot.
- :class:`RosRobotBlock` is a Klampt
:class:`~klampt.control.blocks.robotcontroller.RobotControlBlock` that accepts
inputs from a ROS application. This can be used to drive a simulation.
This also implements the make() protocol for use in... |
""" Information about platform and python version and compilers
This information is manly used to build directory names that
keep the object files and shared libaries straight when
multiple platforms share the same file system.
"""
import os, sys
import distutils
from distutils.sysconfig import customize... |
from sqlalchemy import create_engine, Column, Integer, String, Sequence, Table, ForeignKey, Float, DateTime, ForeignKeyConstraint, Boolean
from sqlalchemy.orm import backref, relationship, sessionmaker, validates
from os import path
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
gen... |
#!/usr/bin/python
# encoding: utf-8
"""
dssp.py
Wrapper functions for the DSSP program designed by Wolfgang Kabsch and Chris Sander.
Created by Shane O'Connor 2014.
DSSP is described here:
A series of PDB related databases for everyday needs.
Robbie P. Joosten, Tim A.H. te Beek, Elmar Krieger, Maarten L. Hekkelman, ... |
# -*- coding: utf-8 -*-
import datetime
import furl
import httplib as http
import urllib
import markupsafe
from flask import request
import uuid
from modularodm import Q
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationError
from modularodm.exceptions import ValidationValue... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import simple_audit
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class BaseModel(models.Model):
"""Base model class"""
created_at = models.DateTimeField(verbos... |
from mtools.util.logevent import LogEvent
from mtools.util.pattern import json2pattern
import re
from base_filter import BaseFilter
def custom_parse_array(value):
return list(set(value.split()))
class LogLineFilter(BaseFilter):
"""
"""
filterArgs = [
('--component', {
'nargs':'*',... |
"""
COMAPtriathlon.py
"""
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, LineAsset
from ggame import ImageAsset, PolygonAsset, Frame, Sound, SoundAsset, TextAsset
import time
import random
"""
sl=int(input("Length of swim (in kilometers)"))
bl=int(input("Length of bike (in ... |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
# -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""
frappe.utils.autodoc
~~~~~~~~~~~~~~~~~~~~
Inspect elements of a given module and return its objects
"""
import inspect, importlib, re, frappe
from frappe.model.document import get_controller
def automodule(name)... |
"""
This is the TreeView that is most common (for example: it is used
in Rational Rose). This is a tree based on namespace relationships. As
a result only classifiers are shown here.
"""
import logging
from typing import Optional
from gi.repository import GLib, Gio, GObject, Gdk, Gtk
from gaphor import UML
from gap... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import requests
import dateutil.parser
from HTMLParser import HTMLParser
from django.contrib.gis.geos import Polygon
from django.conf import settings
from apps.bigcz.models import Res... |
'''
setup dataset for ATLAS
'''
import re
import sys
import time
import uuid
import datetime
import commands
import traceback
import ErrorCode
from DDM import rucioAPI
from taskbuffer.DatasetSpec import DatasetSpec
from taskbuffer import EventServiceUtils
from taskbuffer import JobUtils
from brokerage.SiteMapper impo... |
# -*- coding: utf-8 -*-
import sys, os
import re
import glob
import datetime
import subprocess
from optparse import make_option
from termcolor import colored
from pymongo import MongoClient
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.conf import settings
... |
#!/usr/bin/env python
## @file
#
# Automation of instructions from:
# http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-doc/
# howto-build/mingw-w64-howto-build.txt?revision=216&view=markup
#
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accom... |
# Copyright (C) 2011 Governo do Estado do Rio Grande do Sul
#
# Author: Lincoln de Sousa <lincoln@gg.rs.gov.br>
# Author: Rodrigo Sebastiao da Rosa <rodrigo-rosa@procergs.rs.gov.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... |
###############################################################################
# Default settings for gdc-client
###############################################################################
####################
# API defaults
####################
# The base url for the tcp (http) client
tcp_url = 'https://gdc-api... |
import os
import subprocess
import sys
import time
from calendar import monthrange
from csv import DictReader, DictWriter
from datetime import datetime, date, timedelta
from fuzzywuzzy import fuzz
def run(option):
if option is None or option == 0:
prepare_database()
if option == 0:
return
... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
link_template="""\
<ul>
<li><a href="{lang_code:}/overview/tokenization.html">Tokenization</a></li>
<li>Morphology
<ul>
<li><a href="{lang_code:}/overview/morphology.html">General principles</a></li>
<li><a href="{lang_code:}/pos/index.html">{lang_name:} POS tags</a> (<a href=... |
"""
.. module:: compatibility
:platform: Unix, Windows
:synopsis: Contains compatibility functions for CAD interoperability
.. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com>
"""
def change_ctrlpts_row_order(ctrlpts, size_u, size_v):
""" Converts a u-row order 1-D control points list to a v-row ord... |
from __future__ import unicode_literals, print_function, division, absolute_import
import argparse
import warnings
import sys
from openfisca_core.scripts import add_tax_benefit_system_arguments
"""
Define the `openfisca` command line interface.
"""
def get_parser():
parser = argparse.ArgumentParser()
su... |
"""
Back-end for the vote page.
"""
__authors__ = ['Waseem Ahmad <waseem@rice.edu>',
'Andrew Capshaw <capshaw@rice.edu>']
import authentication
import database
import datetime
import logging
import webapp2
from authentication import require_login
from main import render_page
class VoteHandler(webapp2... |
import math
import numpy as np
import action as a
from action import Category
from action import ActionResults
import field_info as field
import potential_field as pf
from naoth import math2d as m2d
good_threshold_percentage = 0.85
minGoalLikelihood = 0.3
# minGoalParticles = 9
def simulate_consequences(action, ... |
"""
combines image.logs and game.log files such that the resulting log contains images, frameinfo and camera matrix data
TODO implement a faster method that does not parse the logs but combines the binary blocks directly
"""
import struct
from argparse import ArgumentParser
from pathlib import Path
from naoth... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2012, GEM Foundation.
#
# OpenQuake 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.... |
#!/usr/bin/env python
#
# (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Public Lic... |
#!/usr/bin/python
import glob
import grp
import hashlib
import json
import os
import pwd
import re
import shutil
import subprocess
import tarfile
import threading
import time
import urlparse
import uuid
from itertools import chain
from base64 import b64encode
from collections import OrderedDict
from copy import deepco... |
# Copyright 2011-2021 James McCauley
#
# 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 ... |
#
# rpclib - Copyright (C) Rpclib contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This lib... |
"""
This module is the Matplotlib server, Python side. It sits around waiting for Python code to come over the port, executes it, and returns
the result to the sender wrapped up in JSON.
"""
import numpy as np
import os
import socket
import sys
import traceback
import matplotlib
if "Display" not in os.environ:
mat... |
from __future__ import absolute_import
import textwrap
import pkgutil
import copy
import os
import json
from functools import reduce
from six import string_types
try:
from math import gcd
except ImportError:
# Python 2
from fractions import gcd
# Create Lazy sentinal object to indicate that a template ... |
from nose.plugins.attrib import attr
from numpy.testing import assert_array_less
from numpy import array, hstack
from numpy.random import rand
import singleModelSpike as sms
from hopkinsTesting import runOnManyExtraNoise, findBalancedSets, manyNames, rest
import alternatingAlgorithms
import utility
import weightedMode... |
# Copyright (C) 2015-2016 Regents of the University of California
#
# 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... |
import requests
from django import forms
from django.core.exceptions import ValidationError
from django.db.models import Count
from busstops.models import Operator
from .models import VehicleType, VehicleFeature, Livery
def get_livery_choices(operator):
choices = {}
liveries = Livery.objects.filter(vehicle__o... |
import os, sys
import stat
from subprocess import call
import shutil
NPATH = os.path.expanduser("~/.local/share/nautilus")
SPATH = os.path.join(NPATH, "scripts")
PATH = "%s/bin"%sys.exec_prefix
script = \
"""#!/usr/bin/python
import sys
import os.path
import subprocess
folders = [path for path in sys.argv[1:] i... |
import numpy as np
from scipy import optimize, stats
from statsmodels.base.data import handle_data
from statsmodels.tools.tools import recipr
from statsmodels.stats.contrast import ContrastResults
from statsmodels.tools.decorators import (resettable_cache,
cache_readonl... |
# coding: utf-8
""" Core functionality for doing stream inference """
from __future__ import division, print_function
__author__ = "adrn <adrn@astro.columbia.edu>"
# Standard library
import os, sys
import logging
from collections import OrderedDict
# Third-party
from emcee import EnsembleSampler, PTSampler
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.