src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python3
from setuptools import setup
setup(
name = 'python-mpv',
version = '0.5.1',
py_modules = ['mpv'],
description = 'A python interface to the mpv media player',
url = 'https://github.com/jaseg/python-mpv',
author = 'jaseg',
author_email = 'github@jaseg.net',
license ... |
'''strategy setting file, note: this is an important file. You should be careful when modifying the file.
Please keep the format.
The words is case sensitive.
You can modify parameters group order in 'param_order' and parameters group in 'param_group'.
'''
strategy={
"neutron_tof":{
# task type
... |
"""Config flow for ClimaCell integration."""
from __future__ import annotations
import logging
from typing import Any
from pyclimacell import ClimaCellV3
from pyclimacell.exceptions import (
CantConnectException,
InvalidAPIKeyException,
RateLimitedException,
)
from pyclimacell.pyclimacell import ClimaCell... |
import SocketServer
import struct
import datetime
import sys
import time
StructureID_rrCommands =0x0B03
StructureID_RRN_TCP_HeaderData_v3 = 0x0D03
Size_RRCommands = 1232
Size_RRN_TCP_HeaderData_v3 = 198
rrnData_commands = 7
log_command="print(' \\\'"
log_command_end="')"
log_command_intern_prestring=" "
log_... |
import os
import shutil
from datetime import datetime
class Records:
"""
* Collects and store sensors data + current garden state.
* sensors data log + current garden state
* web server
* light version of sensor data history
* current garden state (TODO)
* next planne... |
# Copyright 2017 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... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Viper analysis plugin."""
import unittest
import mock
from dfvfs.path import fake_path_spec
from plaso.analysis import viper
from plaso.lib import timelib
from plaso.parsers import pe
from tests.analysis import test_lib
class MockResponse(dict):
"""A mo... |
from collections import OrderedDict
from functools import lru_cache
import json
from jsonref import JsonRef
import re
import requests
import warnings
from civis import APIClient
from civis.base import CivisAPIError, Endpoint, tostr_urljoin
from civis.resources._resources import parse_method
from civis._utils import to... |
'''
Author: Matt Shaffer
Contact: matt@discovermatt.com
'''
import numpy as np
import matplotlib.pyplot as plt
'''
1. Build simulated data graph
'''
steps = 1001
period = 1000
amplitude = 2
timeline = np.linspace(0, period, steps, dtype=int) # steps
num_prev = np.random.rand(1)*10
num = np.random.rand(1)*10
def ran... |
"""Class definition to control Gnuplot from Python.
"""
# This file is part of ManipulateAggregates.
#
# Copyright (C) 2016 by Torsten Sachse
#
# ManipulateAggregates 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 Found... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("addressbase", "0005_auto_20170927_1128")]
operations = [
migrations.CreateModel(
name="Onsud",
fields=[
... |
'''Trains a simple deep NN on the MNIST dataset.
Gets to 98.40% test accuracy after 20 epochs
(there is *a lot* of margin for parameter tuning).
2 seconds per epoch on a K520 GPU.
'''
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist... |
#!/usr/bin/python
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
import sys
# path="/tools/Python/Python-2.7.3/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/pip-1.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/VTK-6.0-py2.7.egg:/tools/Python/Python-2.7.3/lib/python2.7/site-packages/distribute-0.6.... |
# Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... |
import textwrap # used for embellishing the Graphviz DOT file layout
class Node:
# since we will be using a lot of Node instances, optimise the memory use by relying on slots rather than a dict
__slots__ = ['problem', 'parent', 'action', 'effect', 'state', 'is_goal', 'children',
'visit... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pdb
import unittest
from datetime import date
from testing_utils import setupTestDB, fake_response_from_file
from scrapy.http import Response, Request, HtmlResponse
from sgfSpider.dbsgf import DBsgf, DBNewsItem
from sgfSpider.spiders.igokis... |
# Copyright 2013, 2015 IBM Corp.
#
#Copyright IBM Corporation 2015.
#LICENSE: Apache License 2.0 http://opensource.org/licenses/Apache-2.0
import json
import requests
from string import Template
import pdb
import sys
LIST_CONTAINER_URL = Template("http://$SERVER/cargo")
OPERATE_CONTAINER_URL = Template("http://$SERV... |
from bokeh.io import output_file, show
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from bokeh.transform import dodge
output_file("dodged_bars.html")
fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries']
years = ['2015', '2016', '2017']
data = {'fruits' : fruits... |
#!/usr/bin/env python
from nose.tools import *
from utilities import Todo
from utilities import execution_path
import tempfile
import os, sys, glob, mapnik2
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
de... |
# -*- coding: utf-8 -*-
"""
Display Github notifications and issue/pull requests for a repo.
To check notifications a Github `username` and `personal access token` are
required. You can create a personal access token at
https://github.com/settings/tokens The only `scope` needed is `notifications`,
which provides read... |
"""Module that defines indexed objects
The classes IndexedBase, Indexed and Idx would represent a matrix element
M[i, j] as in the following graph::
1) The Indexed class represents the entire indexed object.
|
___|___
' '
M[i, j]
... |
##############################################################################
## Calculates oxygen abundance (here called metalicity) based on strong emission lines,
## based on code originally written in IDL by Lisa Kewley (Kewley & Ellison 2008). Outputs
## oxygen abundance in many different diagnostics (see Bianc... |
from collections import defaultdict
class MostCommonHeuristic(object):
'''Heuristic that shares the most common command at any point'''
_slug = 'most-common'
def slug(self):
return MostCommonHeuristic._slug
def solve(self, problem, saver):
# Keep track of what hasn't been assigned and... |
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '{{ secret_key }}'
# SECURITY WARNING:... |
# -*- coding: utf-8 -*- <nbformat>3.0</nbformat>
# <headingcell level=1>
# Plotting with Matplotlib
# <headingcell level=2>
# Prepare for action
# <codecell>
import numpy as np
import scipy as sp
import sympy
# Pylab combines the pyplot functionality (for plotting) with the numpy
# functionality (for mathematics... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Comment'
db.create_table('comments_comment', (
('created', self.gf('django... |
# -*- coding: UTF-8 -*-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Copyright (C) 2015 - 2018 Simon Stuerz <simon.stuerz@guh.io> #
# ... |
import datetime
import pytest
from mock import patch
from treeherder.seta.job_priorities import (SetaError,
seta_job_scheduling)
@pytest.mark.django_db()
@patch('treeherder.seta.job_priorities.SETAJobPriorities._validate_request', return_value=None)
@patch('treeherder.set... |
# coding:utf-8
from flask import render_template, request, jsonify
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
if request.accept_mimetypes.accept_json and \
not request.accept_mimetypes.accept_html:
response = jsonify({'error': 'not found'})
response.status_c... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 19 15:29:27 2017
@author: bernier2
"""
import argparse
import numpy as np
import h5py
from matplotlib import pyplot as plt
"""
# UNCOMMENT IF YOU HAVE A SANE LATEX ENV AND WANT NICE FIG LABELS
#
# Options
params = {'text.usete... |
# Copyright 2011 Thierry Carrez <thierry@openstack.org>
# 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
... |
from fabric.api import local, warn_only
from config_pkg import all
def apt_update():
local('sudo apt update')
def apt_upgrade():
local('sudo apt dist-upgrade')
def config_all():
for script in all:
script()
def deploy(pkg_filepath=None):
if pkg_filepath is None:
pkg_filepath = 'p... |
# Copyright 2019 kubeflow.org.
#
# 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,... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('snisi_epidemiology', '0003_epidemiologyalertr'),
]
operations = [
migrations.AlterField(
model_name='aggepidemio... |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Worksheet Properties"""
from openpyxl.compat import safe_string
from openpyxl.descriptors import Strict, String, Bool, Typed
from openpyxl.styles.colors import ColorDescriptor
from openpyxl.xml.constants import SHEET_MAIN_NS
from openpyxl.xm... |
from unittest import mock, TestCase
from lxml import etree
import pcs.lib.booth.resource as booth_resource
def fixture_resources_with_booth(booth_config_file_path):
return etree.fromstring('''
<resources>
<primitive type="booth-site">
<instance_attributes>
... |
# Copyright 2016 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# Copyright (c) 2014 Artem Rozumenko (artyom.rozumenko@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
"""
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group Weblog by the shar... |
"""
Programa adquicion datos
"""
import os
import pprint
import random
import sys
import wx
# The recommended way to use wx with mpl is with the WXAgg
# backend.
#
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import \
FigureC... |
from __future__ import print_function
import os
import sys
import arcpy
import glob
import shutil
import zipfile
import inspect
def zipws(path, zip, keep):
path = os.path.normpath(path)
# os.walk visits every subdirectory, returning a 3-tuple
# of directory name, subdirectories in it, and file names
#... |
from setuptools import setup, find_packages
from distutils.cmd import Command
import codecs
import sys, os
import doctest
from glob import glob
sys.path.insert(0,'src/')
init_pyc = 'src/flatty/__init__.pyc'
if os.path.exists(init_pyc):
os.remove(init_pyc)
import flatty
if os.path.exists("doc/source/introduction... |
from threading import Timer
import chains.service
from chains.common import log
import time, datetime, re, copy
from Queue import Empty
from soco import SoCo, discover
from soco.events import event_listener
class SonosService(chains.service.Service):
def onInit(self):
# Discover Sonos players
sel... |
class TrackListView(QTreeView):
def __init__(self, parent):
super(TrackListView, self).__init__(parent)
self.setRootIsDecorated(False)
self.setSortingEnabled(True)
self.setAllColumnsShowFocus(True)
self.setSelectionBehavior(QTreeView.SelectRows)
#self.... |
#!/usr/bin/python3
from LanguageDepotAnalyze import getListOfCapabilities
from importlib import import_module
# in this file, we write a SQL script which will create the database.
# the script will take this format:
#
# -- create schemas
# CREATE SCHEMA project;
#
# -- set search path
# SET search_path TO project,publi... |
#!/usr/bin/python
import csv
import numpy as np
from six.moves import cPickle as pickle
# read in data
dataset = 'dataset/'
train_season_statis_filename = dataset + 'final_train_season_statis.pickle'
train_month_statis_filename = dataset + 'final_train_month_statis.pickle'
train_dwt_filename = dataset + 'final_train_d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import time
import termios
import tty
import socket
import threading
import tweepy
import json
import string
import re
import HTMLParser
import tempfile
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListen... |
from __future__ import unicode_literals
from django.db import models
from compounds.models import Compound
from targets.models import Target
from dds.base.models import *
class BalestraInteraction(TrackableModel):
"""Describes an interaction predicted by Balestra"""
class Meta:
unique_together = (('c... |
# -*- coding: utf8 -*-
from __future__ import absolute_import, unicode_literals
import json
from santaclaus import db
from santaclaus.models import Person
from santa_test_helper import SantaClausTestCase
class SantaClausV0Test(SantaClausTestCase):
def test_request_with_a_name(self):
r = self.app.get('/?n... |
from django.shortcuts import render
from django.template import RequestContext
from django.shortcuts import render, render_to_response
from django.views.generic import View
from django.http import HttpResponse
from customers.models import Users as users
from customers.models import Vendors as vendors
from customers.mod... |
"""
Copyright (c) 2017 Genome Research Ltd.
Author: Christopher Harrison <ch12@sanger.ac.uk>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any ... |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import numpy as np
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
exts = ['spmatfuncs', 'stochastic', 'sparse_utils', 'graph_utils', 'interpolate',
... |
# vim: set expandtab sw=4 ts=4:
'''
Dictionary based collection class.
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtime-trend
<https://github.com/ruleant/buildtime-trend/>
This program is free software: you can redistribute it and/or modify
it under the terms of t... |
# Generated by Django 2.2.9 on 2020-02-13 14:43
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("course_catalog", "0059_remove_deprecated_offered_by")]
operations = [
migrat... |
# Nix
# Copyright (c) 2017 Mark Biciunas.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distrib... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from six import StringIO
import pytest
import llnl.util.filesystem as fs
import spack.hash_types as ht
import... |
# -*- coding: ISO-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files... |
#coding=utf8
import tushare as ts;
import pymysql;
import time as dt
from datashape.coretypes import string
from pandas.io.sql import SQLDatabase
import sqlalchemy
import datetime
from sqlalchemy import create_engine
from pandas.io import sql
import threading
import pandas as pd;
import sys
sys.path.append('../') #添加配... |
import unittest
from yesaide import database, worker
class TestDatabase(unittest.TestCase):
class FakeDbSession(object):
def __init__(self):
self.has_been_committed = False
def commit(self):
self.has_been_committed = True
class TestedWorker(worker.RawWorker):
... |
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Wiktor Lawski <wiktor.lawski@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
# in the Software without restriction, including without limitation th... |
#!/usr/bin/env python
import wx
import wx.adv
#---------------------------------------------------------------------------
class TestSashWindow(wx.Panel):
def __init__(self, parent, log):
wx.Panel.__init__(self, parent, -1)
self.log = log
winids = []
# Create some layout window... |
# -*- coding:utf-8 -*-
import json
import requests
import urllib
import hashlib
from json import *
from xml.dom import minidom, Node
import WXBizMsgCrypt
from openerp.http import request
from wechat_sdk.messages import MESSAGE_TYPES, UnknownMessage
from wechat_sdk.exceptions import ParseError, NeedParseError, NeedParam... |
"""
Bindings for sending notifications to Python callbacks.
"""
from ..abc.configurations import Configurable
from ..abc.notifications import Notifier
from ..configurations import ConfigManager, load_global_function
from ..exceptions import verify_type
from ..plugins import config_loader
__author__ = 'Aaron Hosfor... |
from django import template
register = template.Library()
@register.inclusion_tag('admin/dragoman_blog/submit_line.html', takes_context=True)
def submit_row(context):
"""
Displays the row of buttons for delete and save.
"""
opts = context['opts']
change = context['change']
is_popup = context['... |
# topicmaps.tests.test_init
# Testing package for the DDL Logbook project.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Mon Jun 01 21:22:26 2015 -0400
#
# Copyright (C) 2015 District Data Labs
# For license information, see LICENSE.txt
#
# ID: test_init.py [] benjamin@bengfort.com $
"""... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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
#
# ... |
#!/usr/bin/env python3
import os
import argparse
import pickle
from lxml import etree
from sys import argv
from objects import *
## returns a list of ints
def to_index(s):
outlist = list()
spl1 = s.split(',')
try:
for item in spl1:
spl2 = item.split('..')
start = int(spl2... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool limiting together/eviction with the wallet."""
from decimal import Decimal
from test_fra... |
"""
Template tag for displaying user guides.
"""
import re
from django import template
from django.conf import settings
from django.template import loader
from django.template.defaulttags import CsrfTokenNode
from user_guide.models import GuideInfo
register = template.Library()
# The maximum number of guides to sh... |
from django.conf.urls import url
from django.contrib import admin
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^$', views.studies_view, name='index'),
url(r'^admin/', include(admin.site.urls), name='admin'),
url(r'^mystudies/$', views.my_studies_view, name='my_studi... |
import csv
from collections import defaultdict
from collections import namedtuple
class Pty(object):
def __init__(self, ynmp, name, rank=3, color="white"):
self.ynmp = ynmp
self.name = name.replace('"', '').replace("'", "")
self.rank = rank
self.color = color
self.code = "".join(x for x in self.ynmp if x.is... |
import pandas as pd
import numpy as np
data = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada', 'Nevada'],
'year': [2000, 2001, 2002, 2001, 2002, 2003],
'pop': [1.5, 1.7, 3.6, 2.4, 2.9, 3.2]}
frame = pd.DataFrame(data)
frame
frame.head()
frame = pd.DataFrame(data, columns=['year', 'state'])... |
# coding=utf-8
# Copyright 2018 The Conversation-AI.github.io 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 b... |
# -*- coding: utf-8 -*-
'''
Printmodel django module for dummy
@author: Laurent GAY
@organization: sd-libre.fr
@contact: info@sd-libre.fr
@copyright: 2016 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publi... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... |
#
# pythologic2.py
#
# Add logic programming (Prolog) syntax and *resolution* into Python.
#
# (c) 2004 Francisco Coelho
# after (c) 2004 Shai Berger
# and AIMA examples
#
import string
import copy
class Struct:
def __init__(self, database, head, subs):
"""
The head and subs are essential - what... |
#coding: utf-8
from fabtools import require, git, python, nginx, supervisor, service, files
from fabric.context_managers import cd, shell_env
from fabric.api import put, run, task, env
from os import environ, path
import time, re
from .dash import restart_stats_workers
@task
def test_uwsgi_is_started(now):
for i i... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A database of OWNERS files.
OWNERS files indicate who is allowed to approve changes in a specific directory
(or who is allowed to make changes withou... |
#
# $Id: alcm5crypt.py 539 2006-07-19 17:17:06Z Robert The Rebuilder $
#
# Copyright (C) 2005-2008 Alcugs PyPRP Project Team and 2008 GoW PyPRP Project Team
# See the file AUTHORS for more info about the team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of t... |
#Published symbols @7.0
#readelf -Ds /usr/lib/x86_64-linux-gnu/libcublas.so.7.0
from subprocess import Popen, PIPE
import pyperclip
libDir = '/usr/lib/x86_64-linux-gnu/'
c_types_reps = {'int' :'c_int',
'size_t' :'c_size_t',
'char' :'c_char',
... |
import os
import unittest
from vsg.rules import attribute_specification
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_101_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path... |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import socket
machine = socket.getfqdn()
print("MACHINE", machine)
if "bsccv" in machine:
PELE_EXECUTABLE = "/data/EAPM/PELE/PELE++/bin/rev12360/Pele_rev12360_mpi"
DATA_FOLDER = "/data/EAPM/PELE/PELE++/data/rev12360/Da... |
#a Imports
import PIL.Image
import PIL.ImageOps
import colorsys
import math
import array
import time
#a Classes
#c c_line_set
class c_line_set(object):
def __init__( self, w, h, min_distance=8 ):
self.w = w
self.h = h
self.distance_array = array.array('d',range(self.w*self.h))
for i... |
import unittest
from nanomsg import errors
from nanomsg.constants import Error
class ErrorsTest(unittest.TestCase):
def test_errors(self):
varz = vars(errors)
lookup_table = varz['_ERRORS']
for error in Error:
self.assertIn(error.name, errors.__all__)
self.asse... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import json
import sys
from numpy import *
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
color = {20:"r-", 40:"g-", 100:"b-", 30: "k--", 60:"m--", 50:"g--"}
def MagnetizationVsStep(savefile, filenames):
try:
data = []
for filename in filen... |
__author__ = "Lyudmyla Vynnytska and Marie E. Rognes"
__copyright__ = "Copyright (C) 2011 Simula Research Laboratory and %s" % __author__
__license__ = "GNU LGPL Version 3 or any later version"
# Last changed: 2012-02-14
import time
import numpy
import sys
import os
import math
sys.path.insert(0, '..')
from stokes... |
from os import pathsep
from os.path import basename
from os.path import dirname
from os.path import join
from mock import patch
from mock import Mock
from .. import TestCase
import findd.utils.path as sut
class Parents(TestCase):
def test_should_work_with_empty_paths(self):
self.assertEqual(list(sut.par... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import urllib
import urllib2
import cookielib
import xbmcplugin
import xbmcaddon
import xbmcgui
import json
import sys
import os
import re
addon = xbmcaddon.Addon()
socket.setdefaulttimeout(60)
pluginhandle = int(sys.argv[1])
addonID = addon.getAddonInfo('id')
cj... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# Hyper Parameters
TIME_STEP = 10 # rnn time step
INPUT_SIZE = 1 # rnn input size
CELL_SIZE = 32 # rnn cell size
LR = 0.02 # learning rate
# show data
steps = np.linspace(0, np.pi*2, 100, dtype=np.float32)
x_np = np.s... |
"""
This test module contains test cases for testing the conftest.py module,
at least those functions that can reasonably be tested in a standalone
manner.
"""
from __future__ import print_function, absolute_import
from lxml import etree
from ...functiontest.conftest import xml_embed, xml_unembed
class Test_EmbedU... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from hvad.models import TranslatableModel, TranslatedFields
from vertex.models import AbstractDatedModel
__author__ = 'Jonathan Senecal <jonathan@zap.coop>'
class ReplyTemplate(AbstractDatedModel, TranslatableModel):
"""
W... |
from django.db import models
# The kind of item we are estimating properties of
class Kind(models.Model):
name = models.TextField(unique=True)
def __str__(self):
return self.name
# Items whose properties we are estimating
class Item(models.Model):
kind = models.ForeignKey(Kind, related_name="item... |
####################################################################################################
#
# Bleau Database - A database of the bouldering area of Fontainebleau
# Copyright (C) Salvaire Fabrice 2016
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... |
#!/usr/bin/env python
#coding:utf-8
import urllib
import urllib.request
from queue import Queue
import time,re,threading
head = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'}
lock = threading.Lock()# lock to serialize console output
def do_work(item):
ti... |
########################################################################################################################
# mogli - molecular graph library #
# ... |
"""
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... |
import urllib.request
from os import path
import mutagen
import youtube_dl
from mutagen.easyid3 import EasyID3
from mutagen.id3 import APIC, ID3
from mutagen.mp3 import MP3
from spotify_dl.scaffold import log
from spotify_dl.utils import sanitize
def default_filename(song):
return sanitize(f"{song.get('artist')... |
class OAIPMHError(Exception):
def __init__(self, code, message):
self.code = code
self.message = message
def set_message(self, message):
self.message = message
def as_xml_dict(self):
return {'error': {'@code': self.code, '#text': self.message}}
def __repr__(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.