src stringlengths 721 1.04M |
|---|
from marrow.schema.testing import TransformTest
from marrow.schema.transform.type import Boolean, boolean, WebBoolean, web_boolean
class TestBooleanNative(TransformTest):
transform = boolean.native
invalid = ('x', )
@property
def valid(self):
yield None, None
if boolean.none:
yield '', None
for ... |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.utils.translat... |
#!/data/project/nullzerobot/python/bin/python
from functools import wraps
from flask import redirect, url_for
import c
def normalize_url_title(dic):
title = dic.get('title', None)
if not title:
return False
new_title = (title.replace(' ', '_'))
if new_title != title:
dic['title'] = new... |
#!/usr/bin/env python
import rospy
import math
import actionlib
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyActionClient
from vigir_footstep_planning_msgs.msg import *
from std_msgs.msg import String, Header
'''
Created on 02/24/2015
@author: Philipp Schillinger and Spyros Maniato... |
# https://github.com/morpav/zceq_solver--bin
from cffi import FFI
import os.path
import inspect
ffi = None
library = None
library_header = """
typedef struct {
char data[1344];
} Solution;
typedef struct {
unsigned int data[512];
} ExpandedSolution;
typedef struct HeaderAndNonce {
char data[140];
} HeaderAnd... |
#######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... |
import os
from collections import defaultdict
import numpy as np
try:
import matplotlib
if not os.environ.get('DISPLAY'):
# Use non-interactive Agg backend
matplotlib.use('Agg')
import matplotlib.pyplot as plt
except ImportError:
import platform
if platform.python_implementation() =... |
import os
from goose3 import Goose
from selenium import webdriver
from selenium.common.exceptions import UnexpectedAlertPresentException, SessionNotCreatedException, WebDriverException
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummar... |
import click
import docker
from wheezy.template.engine import Engine
from wheezy.template.ext.core import CoreExtension
from wheezy.template.ext.code import CodeExtension
from wheezy.template.loader import DictLoader
from . import templates
import logging
LOG = logging.getLogger(__name__)
LOG_LEVELS = {
"info... |
import os
import sys
import zipfile
import subprocess
if __name__ == '__main__':
jsFile = "bin/g.js"
jsFileMin = "bin/g_min.js"
indexFile = "bin/index.html"
indexFileMin = "bin/index_min.html"
#minify javascript
subprocess.call([
"uglifyjs",
"--compress",
"--mangle",
"--o", jsFileMin,
jsFile
], shel... |
#!/usr/bin/env python
# Script to build windows installer packages for LAMMPS
# (c) 2017,2018,2019,2020 Axel Kohlmeyer <akohlmey@gmail.com>
from __future__ import print_function
import sys,os,shutil,glob,re,subprocess,tarfile,gzip,time,inspect
try: from urllib.request import urlretrieve as geturl
except: from urllib ... |
"""'
Script for download and installation of data and required programs
Some functions requires rsync
@see {transformWig} - another script for transformations
''"""
import argparse
import ftplib
from multiprocessing import Pool
import os
import urllib
import time
from config import DATA_DIR, BIN_DIR, OTHER_DATA, SI... |
#!/usr/bin/env python
"""
./app.py --dbpedia-data-dir /home/roman/dbpedia --ner-host diufpc54.unifr.ch --types-table typogram --hbase-host diufpc304
"""
import argparse
import os.path
from flask import Flask, jsonify, request
import kilogram
from kilogram.dataset.entity_linking.gerbil import DataSet
from kilogram.ent... |
# coding=utf-8
#from threading import Thread
import Queue
import sys
import time
import logging
import re
import os
import psutil
class PrintService(object):
def __init__(self, profile, serialInfo):
# super(PrintService, self).__init__(name="PrintService")
self.profile = profile
... |
from flask import Blueprint
import platform
import sys
import os
import site
import pkg_resources
from hoplite.api.helpers import jsonify
bp = Blueprint('site', __name__)
def reload_site_packages():
# TODO: Can probably be replaced with reload(pkg_resources)
opsys = platform.system().lower()
python_exe_... |
#!/usr/bin/env python
# Copyright 2013 Marc-Antoine Ruel. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Generates the test data for generator_test.go in generator.json.
The data is base64 encoded.
"""
import json
import os... |
from datetime import datetime
from django.utils import timezone
from django.contrib import admin
import django.db.models
import django.forms
from django.utils.timezone import template_localtime
from . import models
@admin.register(models.config)
class configAdmin(admin.ModelAdmin):
list_display = ("enabled","dom... |
# Copyright 2009-2014 Ram Rachum.
# This program is distributed under the MIT license.
from __future__ import with_statement
import os.path, sys
sys.path += [
os.path.dirname(__file__),
os.path.join(os.path.dirname(__file__), 'third_party.zip'),
]
from python_toolbox import string_tools
import wingapi
im... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Fco. Javier Lucena Lucena (https://forja.rediris.es/users/franlu/)
Copyright (C) 2012 Serafín Vélez Barrera (https://forja.rediris.es/users/seravb/)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Affero General Public Li... |
#!/usr/bin/python
import matplotlib.pyplot as plt
def prepare_figure_for_publication(ax=None,
width_cm=None,
width_inches=None,
height_cm=None,
height_inches=None,
fontsize=None,
fontsize_labels=None,
fontsiz... |
# -*- coding: utf-8 -*-
# Copyright 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 requi... |
"""
The test_database module contains tests for the Database object.
"""
from __future__ import print_function
from pyparsing import ParseException
from pycalphad import Database, Model
from pycalphad.io.tdb import expand_keyword
from pycalphad.tests.datasets import ALCRNI_TDB, ALFE_TDB, ALNIPT_TDB, ROSE_TDB, DIFFUSION... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-20 03:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('maps'... |
from flask import Flask
from .view_classes import DecoratedView
from .view_classes import DecoratedBoldListView
from .view_classes import DecoratedBoldItalicsListView
from .view_classes import DecoratedListMemberView
from .view_classes import DecoratedListFunctionAttributesView
from .view_classes import DecoratedListMe... |
from google.appengine.ext import ndb
from entities import BaseEntity
class Purchase(BaseEntity):
goods_id = ndb.IntegerProperty(required=True)
version = ndb.StringProperty(required=True)
date = ndb.DateTimeProperty(required=True)
@classmethod
def get_last(cls, user_key):
return cls.query(... |
# coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from builtins import str
from textwrap import dedent
import mock
from pex.inte... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 21 12:49:06 2015
@author: Steve Elston
"""
## The main function with a single argument, a Pandas data frame
## from the first input port of the Execute Python Script module.
def azureml_main(BikeShare):
import pandas as pd
from sklearn import preprocessing
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__version__ = '0.9.2rc-1'
__copyright__ = """
k_os (Konnex Operating-System based on the OSEK/VDX-Standard).
(C) 2007-2013 by Christoph Schueler <github.com/Christoph2,
cpu12.gems@googlemail.com>
All Rights Reserved
This p... |
import numpy as np
from scipy.sparse import kron,identity
from copy import copy,deepcopy
from ops import Z,Zs
from utils import index_map
class HGen(object):
def __init__(self,terms,L,d=2,part='left',fermi=False,sfermi=False,sectors=np.array([0.5,-0.5])):
self.l=1;self.d=d;self.D=self.d
self.H=np.zeros([self.d,s... |
import logging
import zmq
import datetime
import dateutil.parser
import numpy as np
def recv_array(socket, flags=0, copy=False, track=False):
"""recv a numpy array"""
md = socket.recv_json(flags=flags)
msg = socket.recv(flags=flags, copy=copy, track=track)
buf = buffer(msg)
A = np.frombuffer(buf,... |
"""
Methods of constructing word embeddings
Idea: Learn to pick by gating that's learnable (and would ignore unknown words)
Idea: Then start tarining gate late?
"""
from blocks.bricks import Initializable, Linear, MLP, Tanh, Rectifier
from blocks.bricks.base import application, _variable_name
from blocks.bricks.looku... |
#encoding> utf-8
from core.models import Maps, Routes
from core.serializers import MapsSerializer, RoutesSerializer
from django.http import Http404
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from django.http import HttpResponse
import json
fr... |
"""Common Classes for App."""
class Database(object):
def __init__(self, connection=None):
self.connection = connection
self.connection.set_session(autocommit=True)
@property
def cursor(self):
return self.connection.cursor()
def set(self, connection=None):
self.connec... |
from urlparse import urlparse, urlunparse
import re
from bs4 import BeautifulSoup
import requests
import logging
from .base import BaseCrawler
from ...models import Entity, Author, AuthorType
class TheCitizenTZCrawler(BaseCrawler):
TCTZ = re.compile('(www\.)?thecitizen.co.tz')
log = logging.getLogger(__name_... |
from django.db import models
from django.conf import settings
from django.utils import simplejson as json
from django.db import connections
from django.core.exceptions import ValidationError
from django.db.utils import ConnectionDoesNotExist
import managers
from signals import db_pre_load, db_post_load, db_pre_unload,... |
import re
from django.template import Template, Context, get_library
from django.test import TestCase, Client
from django.conf import settings as django_settings
from markitup.templatetags.markitup_tags import _get_markitup_context
from django.core import serializers
from django.forms.models import modelform_factory
f... |
from django.contrib import admin
from membros.models import Cargo, HistoricoEclesiastico, Contato
from membros.models import Membro, Endereco
from membros.models import HistoricoFamiliar
from membros.models import Teologia
from ieps.admin import admin_site
class ContatoInline(admin.StackedInline):
model = Contato... |
import pytest
from cobbler.template_api import CobblerTemplate
class TestCobblerTemplate:
def test_compile(self):
# Arrange
# Act
compiled_template = CobblerTemplate(searchList=[{"autoinstall_snippets_dir": "/var/lib/cobbler/snippets"}]) \
.compile(source="$test")
res... |
# 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... |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.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/lice... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from pants.backend.jvm.artifact import Artifact
from pants.backend.jvm.reposit... |
import json
import logging
import os.path
import time
import zyn_util.errors
import zyn_util.exception
import zyn_util.util
import zyn_util.connection
from zyn_util.client_data import (
Element,
OpenLocalFile,
LocalFilesystemManager,
ZynClientException,
)
class ServerInfo:
def __init__(
... |
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
class Test_cli(unittest.TestCase):
def setUp(self):
conda = os.path.join(os.path.dirname(sys.executable), 'conda')
self.environ = os.environ.copy()
self.tmpdir = tempfile.mkdtemp('conda_setup')
co... |
from tests.baseclass import *
class FC3_TestCase(CommandTest):
command = "clearpart"
def runTest(self):
# pass
self.assert_parse("clearpart")
self.assert_parse("clearpart --all", "clearpart --all\n")
self.assert_parse("clearpart --none", "clearpart --none\n")
# Passing ... |
#!/usr/bin/env python
import cairo
from math import pi, cos, sin
WIDTH, HEIGHT = 20, 20
background = "knob1_bg.png"
output = "knob1.png"
x, y = WIDTH / 2, HEIGHT / 2
lwidth = WIDTH / 10
radius = WIDTH / 2 - lwidth
radiusplus = radius + lwidth / 2
radiusminus = radius - lwidth / 2
radiusminus2 = radius - lwidth
radius... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-17 23:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournament', '0004_auto_20160717_2229'),
]
operations = [
migrations.CreateModel(
... |
# Copyright (c) 2008, Stefano Taschini <taschini@ieee.org>
# All rights reserved.
# See LICENSE for details.
class app(object):
def __init__(self, doctests = None, docfiles = None):
self.doctests = doctests or []
self.docfiles = docfiles or []
def _import(self, name):
m = __import__(n... |
# coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RemovedCustomerRe... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
from __future__ import division
from nose.tools import assert_almost_equal
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_true
from nose.tools import assert_raises
from nose.tools import ok_
from nose.tools import raises
import networkx as nx
def validate_grid_... |
import copy
from fs.errors import ResourceNotFoundError
import logging
import os
import sys
from lxml import etree
from path import path
from pkg_resources import resource_string
from xblock.fields import Scope, String, Boolean, List
from xmodule.editing_module import EditingDescriptor
from xmodule.html_checker import... |
"""
Support for Z-Wave.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zwave/
"""
import asyncio
import copy
import logging
from pprint import pprint
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import call... |
import httplib
from pyamf import AMF0, AMF3
from pyamf import remoting
from pyamf.remoting.client import RemotingService
height = 1080
def build_amf_request(const, playerID, videoPlayer, publisherID):
env = remoting.Envelope(amfVersion=3)
env.bodies.append(
(
"/1",
remotin... |
#!/bin/python
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Script to generate Th... |
# -*- coding: UTF-8 -*-
# **********************************************************************************#
# File: Display rewards
# **********************************************************************************#
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import r... |
import pygame
import ConfigParser
from events.eventlog import logger
from events.dispatch import EventDispatcher
from events.event import QuitEvent
from events.event import TickEvent
from events.command import Command
from events.event import MVCChangeEvent
from controllers.tick_controller import TickController
from mo... |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
import pulsar as psr
def run_test():
tester = psr.PyTester("Testing the BasisSet and BasisSetShell")
cGTO = psr.ShellType.CartesianGaussian
sGTO = psr.ShellType.SphericalGaussian
alpha=[3.42525091, 0.62391373, 0.16885540]
c=[0.15432897, 0.53532814, 0.44463454]
FakeD=psr.BasisShellInfo(cGTO,2,3... |
import divide_and_conquer.binary_search as binary_search
import divide_and_conquer.inversions as inversions
import divide_and_conquer.majority_element as majority_element
import divide_and_conquer.points_and_segments as points_and_segments
import divide_and_conquer.sorting as sorting
import pytest
@pytest.mark.timeou... |
import unittest
from django.conf import settings
from django.test import TestCase
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from openedx.core.djangoapps.course_global.models import CourseGlobalSetting
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class Course... |
#!/usr/bin/env python
#
# Python-bindings support functions test script
#
# Copyright (C) 2013-2021, Joachim Metz <joachim.metz@gmail.com>
#
# Refer to AUTHORS for acknowledgements.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as ... |
# -*- coding: utf-8 -*-
"""
If logging is on, utool will overwrite the print function with a logging function
This is a special module which will not get injected into (should it be internal?)
References:
# maybe we can do something like this Queue to try fixing error when
# when using injected print statment... |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www... |
# encoding: utf-8
import paste.fixture
from ckan.common import config
import ckan.model as model
import ckan.tests.legacy as tests
import ckan.plugins as p
import ckan.lib.helpers as h
import ckanext.reclineview.plugin as plugin
import ckan.lib.create_test_data as create_test_data
import ckan.config.middleware as mid... |
#!/usr/bin/env python
"""
Lists triggers visible to the supplied Pachube user API key
To use this script you must create a text file containing your API key
and pass it to this script using the --keyfile argument as follows:
List all triggers visible to supplied key:
$ trigger_view.py --keyfile=/path/to/apikey/file... |
# -*- coding: utf-8 -*-
# doctest: +ELLIPSIS
import collections
from . import default_expire_time
def _parse_values(values):
(_values,) = values if len(values) == 1 else (None,)
if _values and type(_values) == type([]):
return _values
return values
class Container(object):
"""
Base clas... |
#!/usr/bin/env python
#
# Licensed by "The MIT License". See file LICENSE.
#
# Script to simulate fault injections on AES-128.
# Prints correct and corresponding faulty ciphertext.
#
# Usage: ./inject nr_of_example fault_location
#
# fault_location must be in {0,...,15}.
#
import sys
from aes import *
# (plaintext,key... |
from setuptools import setup
install_requires = ['six']
def get_version(string):
""" Parse the version number variable __version__ from a script. """
import re
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
version_str = re.search(version_re, string, re.M).group(1)
return version_str
setup(
... |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
basedir = os.path.dirname(os.path.abspath(__file__))
os.chdir(basedir)
def f(*path):
return open(os.path.join(basedir, *path))
setup(
name='pyspark_elastic',
maintainer='Frens Jan Rumph',
maintainer_email='frens.jan.rumph@target-holdi... |
#!/usr/bin/env python3
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
import json
import os
import uuid
import unittest
import tempfile
import shutil
from datetime import datetime
import zmq.green as zmq
import beeswarm
from beeswarm.server.misc.config_actor import ConfigActor
import beeswarm.server.db.database_setup as database
from beeswarm.server.db.entities import Client, Honeypot, ... |
#!/usr/bin/env python
'''used as webhook'''
import os
from flask import (
Flask,
request,
make_response,
jsonify
)
app = Flask(__name__)
log = app.logger
def index_getter(letter):
index = 0
index_list = []
for i in 'kitten'.upper():
if i == letter:
index_list.append(index)
index+=1
return index_list... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://github.com/CSTR-Edinburgh/merlin
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... |
#!/usr/bin/env python
#
# Copyright 2019 Espressif Systems (Shanghai) PTE LTD
#
# 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 req... |
#-*- coding: utf-8 -*-
'''
python-libtorrent for Kodi (script.module.libtorrent)
Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman
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 t... |
# Django settings for confer project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'confer', # Or path to database fil... |
import os
import re
import xbmc
import xbmcgui
import xbmcaddon
import xbmcvfs
from rpc import RPC
ADDON = xbmcaddon.Addon(id='script.tvguide.fullscreen')
file_name = 'special://profile/addon_data/script.tvguide.fullscreen/folders.list'
f = xbmcvfs.File(file_name)
items = f.read().splitlines()
f.close()
unique = set(... |
"""
WSGI config for cryptochat project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... |
import os
gettext = lambda s: s
DATA_DIR = os.path.dirname(os.path.dirname(__file__))
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.17.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and ... |
from mock import Mock
import zeit.cms.content.interfaces
import zeit.cms.testing
import zeit.edit.browser.form
import zeit.edit.browser.view
import zeit.edit.testing
import zope.formlib.form
import zope.interface
import zope.publisher.browser
import zope.schema
class IExample(zope.interface.Interface):
foo = zop... |
import _suffix_tree
def postOrderNodes(node):
'''Iterator through all nodes in the sub-tree rooted in node in
post-order.'''
def dfs(n):
c = n.firstChild
while c is not None:
for m in dfs(c):
yield m
c = c.next
yield n
for n in dfs(node):... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num
# Hits/month, pages, and gigabytes served.
# To get the Google analytics data:
# .) Go to analytics.google.com.
# .) There should be (as o... |
#-*- coding:Utf-8 -*-
r"""
Class Cone
==========
The following conventions are adopted
+ A cone has an **apex** which is a point in the plane.
+ A cone has two vectors which define the cone aperture. The order of those two vectors
matters (u) is the starting vector (u) and (v) the ending vector.
The cone region is... |
''' Single subject analysis script for SPM / FIAC '''
import sys
from os.path import join as pjoin
from glob import glob
import numpy as np
from nipy.interfaces.spm import spm_info, make_job, scans_for_fnames, \
run_jobdef, fnames_presuffix, fname_presuffix, fltcols
def get_data(data_path, subj_id):
data_def... |
# -*- coding: utf-8 -*-
import sys
from lxml.html import parse
from lxml.html import tostring
from urllib2 import urlopen
from constants import SPOJ_URLS
from crawler.dataExtractor.extractor import extract_problem_data, extract_user_data, extract_submissions_data
from crawler.dataExtractor.signedlistParser import pars... |
import json
import unittest
from pyramid import testing
from mock import Mock, MagicMock, patch, mock_open
from .. deploy.deploy_status import DeploymentStatus
from .. deploy.package import Package
from .. logger import getLogger
logger = getLogger(__name__)
class DeployStatusTests(unittest.TestCase):
def setUp... |
# 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... |
from rest_framework.renderers import JSONRenderer
from fennec.apps.metamodel.serializers import ColumnSerializer, BasicSchemaSerializer, BasicTableSerializer, BasicIndexSerializer, \
ForeignKeyBasicSerializer
from fennec.apps.repository.models import BranchRevisionChange
from fennec.apps.metamodel.models import Ch... |
"""Functions for performing simulations, mostly using ``pyvolve``.
Written by Jesse Bloom and Sarah Hilton.
"""
import os
import sys
import math
import phydmslib.models
from phydmslib.constants import (NT_TO_INDEX, AA_TO_INDEX, ALMOST_ZERO)
import pyvolve
import numpy
from tempfile import mkstemp
import random
import... |
#!/usr/bin/env python
import argparse
import datetime
import json
import logging
import multiprocessing
import os
import subprocess
import threading
import time
import traceback
import uuid
import boto
import _mysql_exceptions
import psutil
import safe_uploader
import mysql_backup_status
from lib import backup
from l... |
import numpy as np
'''
벡터, 행렬의 생성, 차원수, 형상
'''
# A=np.array([1,2,3,4])
# print(A)
# print(np.ndim(A)) # ndim() : 차원 반환
# print(A.shape) # shape : 튜플 형태로 형상 반환. 벡터의 경우 반환된 튜플이 한개의 원소만 갖음. (4,)
# print(A.shape[0])
# B=np.array([[1,2],[3,4],[5,6]])
# print(B)
# print(np.ndim(B)) # 2
# print(B.shape) # (3,2)
'''
행... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import iodata
class Core:
def __init__(self):
# Liste des Tabs
# self.tablist = [[tab], [tab], ..., [tab]]
# Avec:
# [tab] = ["title", [fond d'écran],
# [iconsList]]
# [fond d'écran] = ["color", "pathname image"]
# [iconsList] = [[icon], [icon], ... [i... |
import unittest
from queue import Queue
from threading import Thread
from time import sleep
from satella.coding import Monitor
class MonitorTest(unittest.TestCase):
def test_synchronize_on(self):
class TestedMasterClass(Monitor):
def __init__(self):
self.value = 0
... |
#
# Copyright (c) 2009-2012 Joshua Hughes <kivhift@gmail.com>
#
import atexit
import os
import tempfile
import urllib
import webbrowser
import qmk
class HelpCommand(qmk.Command):
'''
View help for all available commands. A new tab will be opened in the
default web browser that contains the help for all o... |
#!/usr/bin/python
# ----------------------------------------------------------------------
# Copyright (2010) Aram Davtyan and Garegin Papoian
# Papoian's Group, University of Maryland at Collage Park
# http://papoian.chem.umd.edu/
# Last Update: 03/04/2011
# ---------------------------------------------------------... |
import logging
from typing import Any, Callable, Union
from .conditions import render
from .exceptions import (
InvalidModel,
InvalidStream,
InvalidTemplate,
MissingObjects,
)
from .models import BaseModel, Index, subclassof, unpack_from_dynamodb
from .search import Search
from .session import SessionW... |
#!/usr/bin/env python2.7
'''
AFL crash analyzer, crash triage for the American Fuzzy Lop fuzzer
Copyright (C) 2015 floyd
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 ve... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
imp... |
# Copyright 2015-2019 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `Filesystem`."""
from copy import copy
from itertools import chain, combinations
import re
from uuid import uuid4
from django.core.exceptions import Validation... |
"""
LWR job manager that uses a CLI interface to a job queue (e.g. Torque's qsub,
qstat, etc...).
"""
from .base.external import ExternalBaseManager
from .util.external import parse_external_id
from .util.cli import CliInterface, split_params
from .util.job_script import job_script
from logging import getLogger
log =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.