src stringlengths 721 1.04M |
|---|
"""TheEyeTribe plugin for drop."""
from drop.Sensor import Sensor
from threading import Thread
from Queue import Queue
import socket
from select import select
import json
import nudged
import glib
import os
import re
from datetime import datetime
import time
import csv
# Regular expression to match timestamp format ... |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012, Cloudscaling
# 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
#
# ... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import hashlib
from django.contrib import messages
from django.http import HttpResponsePermanentRedirect
from django.utils.encoding import force_bytes
from yepes.cache import MintCache
from yepes.conf import settings
from yepes.utils.minifier import min... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, 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... |
import datetime
import json
import unittest
import jsond
import six
class TestSimple(unittest.TestCase):
def test_same_as_json(self):
"""If no date objects exist, then we should be the same as json.
"""
to_encode = {
"a": 1,
"b": 2,
"c": 3
}
... |
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... |
# Generated by Django 2.2.10 on 2020-04-02 21:08
from django.db import migrations
from itertools import chain
from utils.data_migrations import stream_field_filter_map
def richtext_to_paragraph(block):
return {
'type': 'paragraph',
'value': {
'text': block['value'],
'align... |
from __future__ import absolute_import,unicode_literals
'''
A module to isolate python version compatibility filth.
'''
import sys
import time
import base64
import collections
major = sys.version_info.major
minor = sys.version_info.minor
micro = sys.version_info.micro
majmin = (major,minor)
version = (major,minor,mic... |
# -*- coding: utf-8 -*-
"""
Vector.py - Extension of QVector3D which adds a few missing methods.
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more information.
"""
from .Qt import QtGui, QtCore, QT_LIB
import numpy as np
class Vector(QtGui.QVector3D):
"""Extension of QVe... |
"""
Client
======
The embedly object that interacts with the service
"""
from __future__ import absolute_import, unicode_literals
import re
import httplib2
import json
from urllib import quote, urlencode
from .models import Url
def get_user_agent():
from . import __version__
return 'Mozilla/5.0 (compatible;... |
import re
from io import open
from setuptools import find_packages, setup
# Get the long description from the relevant file
with open("README.rst", encoding="utf-8") as f:
long_description = f.read()
with open("sentinelsat/__init__.py", encoding="utf-8") as f:
version = re.search(r'__version__\s*=\s*"(\S+)"'... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
# Copyright 2010 OpenStack LLC.
# 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 b... |
#!/usr/bin/python -tt
import gtk
import time
import gobject
import base64
class Dummy:
def __init__(self):
self.name = 'package'
self.ver = '1.0'
self.rel = '0.1.fc14'
self.arch = 'x86_64'
self.summary = "This is a packages"
def list_store(model, num=10):
for i in xra... |
from django.core.exceptions import PermissionDenied
from django.db.models import CharField
from django.db.models import Q
from rest_framework import serializers
from rest_framework.permissions import IsAuthenticated
from contentcuration.models import Channel
from contentcuration.models import ChannelSet
from contentcu... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
# This is a regression test for #1941.
from test_framework.test_framework import BitcoinTestFramework
from test_fr... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 19 21:23:22 2015
@author: htelg
"""
import warnings
import numpy as np
import pandas as pd
import pylab as plt
from scipy import stats
from atmPy.tools import array_tools, plt_tools
from atmPy.tools import math_linear_algebra as mla
# from scipy import integrate
from ... |
#! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... |
"""
Django settings for tddbin project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
import Globals
import logging
import os
log = logging.getLogger('zen.CPUCount')
from Products.ZenModel.ZenPack import ZenPackBase
from Products.ZenModel.ZenMenu import ZenMenu
from Products.ZenUtils.Utils import zenPath
from Products.ZenUtils.Utils import monkeypatch
class ZenPack(ZenPackBase):
def i... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.test import TestCase
import factory
from syard_main.board import BOARD
from syard_main.models import Detective, Game, MrX, Round, STARTING_NODES, UserProfile
"""Test UserProfile model."""
class UserFactory(factory.dja... |
#!/usr/bin/python
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
import re
import sys
from setuptools import setup, find_packages
data_files = {
"share/osbs": [
"inputs/image... |
# -*- coding: utf-8 -*-
#
# stsci.tools documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 7 13:09:39 2010.
#
# 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.
#
#... |
# -*- coding: UTF-8 -*-
import os
from flask import Flask, render_template, request, redirect, url_for
from flask.ext.principal import (identity_loaded, Principal, RoleNeed,
PermissionDenied)
from flask.ext.babel import gettext as _
from flask.ext.mail import Mail, Message
from sqlalche... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 o... |
# Copyright 2019 Verily Life Sciences LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Grammar for BigQuery statements."""
from .grammar import expression, query_expression
from .query_helper import separated_sequence
from .statements import CreateTable, Cr... |
# -*- coding: utf-8-*-
import os
import logging
import pipes
import tempfile
import subprocess
import psutil
import signal
import lib.appPath
from lib.baseClass import AbstractClass
class AbstractFM(AbstractClass):
"""
Generic parent class for FM class
"""
@classmethod
def is_available(cls):
... |
from gi.repository import Gtk, Gio
from .actuators import NeoPixelsActuator
__author__ = 'alfred'
class PreferencesDialog(Gtk.Dialog):
def __init__(self, settings):
Gtk.Dialog.__init__(self, "Preferences", None,
Gtk.DialogFlags.USE_HEADER_BAR | Gtk.DialogFlags.MODAL,
... |
# Copyright 2015: Mirantis 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/licenses/LICENSE-2.0
#
# Unless required b... |
# -*- coding: utf-8 -*-
"""
This is part of WebScout software
Docs EN: http://hack4sec.pro/wiki/index.php/WebScout_en
Docs RU: http://hack4sec.pro/wiki/index.php/WebScout
License: MIT
Copyright (c) Anton Kuzmin <http://anton-kuzmin.ru> (ru) <http://anton-kuzmin.pro> (en)
Common thread class for selenium threads
"""
im... |
# static_upnp responds to upnp search requests with statically configures responses.
# Copyright (C) 2016 NigelB
#
# 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 2 of the Licens... |
import requests
import json
from datetime import date
from datetime import datetime
from datetime import timedelta
#Application Details
# with open('config.json') as json_file:
# config_data = json.load(json_file)
# client_id = config_data['client_id']
# redirect_uri = config_data['redirect_uri']
# client_secret = c... |
# Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, m... |
#!/usr/bin/python
# odi-multiselect.py - continuously read cards and post numbers to defined REST endpoint
#
# Adapted from multiselect.py, pacakaged as part of the RFIDiot library. (c) Adam Laurie
#
# This code is copyright (c) David Tarrant, 2013, All rights reserved.
# The following terms apply:
#
# This c... |
# Copyright (c) 2013,Vienna University of Technology,
# Department of Geodesy and Geoinformation
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the... |
import time
import os
import subprocess as sp
from textwrap import dedent
from nbgrader.tests import start_subprocess, copy_coverage_files
# to add a new manager for the tests, you MUST add it to this list of classes
__all__ = [
"DefaultManager",
"HubAuthManager",
"HubAuthTokenManager",
"HubAuthCustom... |
# -----------------------------------------------------------------------------
#
# -*- coding: utf-8 -*-
#
# phlox-libdc1394/phloxar-dc1394/frame.py
#
# Copyright (C) 2016, by Matthias Yang Chen <matthias_cy@outlook.com>
# All rights reserved.
#
# phlox-libdc1394 is free software: you can redistribute it and/or modify... |
import shutil, zipfile, argparse, yaml, logging, os, slugify, datetime, dateutil.parser, sys
from juliet import configurator, loader, paths, defaults, version
from juliet.builder import Builder
from pkg_resources import resource_filename
from string import Template
def main():
""" Parse command line arguments and ... |
"""
Django settings for SGRS project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ins... |
#!/usr/bin/env python3
import argparse
import collections
import enum
import trueskill
from ladder import Ladder
DRAW_PROBABILITY = 0.001
OPPONENT_SIGMA = 0.1
Result = enum.Enum("Result", "win loss")
Game = collections.namedtuple("Game", "result mmr label")
def load_games(games_file):
games = []
with open... |
import re
from openelex.models import Contest, Candidate, Office, Result
import logging
import time
import os
# if not os.path.isdir("logs"):
# os.makedirs("logs")
# logging.basicConfig(filename=time.strftime("logs/%Y%m%d-%H%M%S-validate.log"),level=logging.DEBUG)
# Generic validation helpers
def _validate_can... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import piksemel
from bugspy.error import ParseError, BugzillaError
from bugspy.constants import Constants as constants
class BugStruct(object):
"""A container which can be accessed like class objects
f = BugStruct(foo="bar", baz="heh", bug=BugStruct("id": 1))
f.s... |
import wx
from controls.OutputPane import OutputPane
class CommandControlMediator(object):
"""The purpose of this class is to hold a binding between a command
and several UI controls. This class is responsible for enabling and
disabling UI controls depending on if commands are available or not.
Call the apropria... |
"""Problem 41: Pandigital primes"""
import unittest
from prob24 import next_perm
from utils.primes import is_prime
def is_n_pandigital(n):
"""Tests if n is 1-len(n) pandigital."""
if len(str(n)) > 9:
return False
if len(str(n)) != len(set(str(n))):
return False
m = len(str(n))
digit... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Subject.name'
db.alter_column(u'horarios_subject', 'na... |
# Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... |
#!/usr/bin/env python3
import speech_recognition as sr
import ksr10
import time
arm = ksr10.ksr10_class()
while 1:
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
try:
rn = r.recognize_google(audio)
except sr.UnknownValueError:
print("Goog... |
# encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2020 Christian Schulze
#
# 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 2 of the License, or
... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
"""Parse a Sycorax script into an annotated multi-author timeline."""
from datetime import datetime, timedelta
import json
import random
import re
import hashlib
import os
import pytz
# 10M: ~10 minutes later
# 4H: ~4 hours later
# 1D: the next day
# R: Reply to previous
# 10A: 10AM on the current day
# 9P: 9PM on th... |
"""
Performance tests based on tests/highlevel/high-in-low6-memory.py
See also auth-*py.
- Data overhead is now at ~6.5 ms / MB.
A lot of the data overhead comes from json.dumps. This is to build mixed cells.
The rest is from get_hash.
Pure Python version (with get_hash and dumps) is at 6.3 ms / MB,
so the res... |
"""Test the Bibliography class"""
from shutil import copyfile
from pkg_resources import resource_filename
import pytest
from citationweb.bibliography import Bibliography
# Fixtures --------------------------------------------------------------------
@pytest.fixture
def bib_minimal(tmpdir) -> str:
"""Returns th... |
#!/usr/bin/env python
''' Calculate the correlation between the artists. Intermediate datasets are
saved in the HDF5 file and the final dataset is saved in the database as
well. The artist correlation matrix is saved only for the single
selected artist, used in the final step for the similarity comparison.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
'''
svgconvert - Simple tool to convert svg to pdf and png
This tool converts svg to pdf and png using phantomjs. It handles mising fonts
correctly, so svgs with unicode text objects are handled gracefuly.
'''
import argparse
import os
import subprocess
import xml.etree... |
# coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... |
# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council).
# This software may be distributed under the terms of the
# Q Public License, version 1.0 or later.
# http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
#
"""
Controller for the 'View' tab - allowing the display of WMC map layers
@autho... |
"""test_t-test.py
Tests for the functions in the t-test.py
Run with:
nosetests test_t-test.py
"""
from __future__ import print_function
import os, sys
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_equal
#Append path to functions
sys.path.append(os.path.join(os.path.dirname(__file_... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos. All Rights Reserved
# $Alejandro Núñez Liz$
# $Omar Castiñeira Saavedra$
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# Th... |
# coding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility a... |
import pytest
from awx.main.access import (
WorkflowJobTemplateAccess,
WorkflowJobTemplateNodeAccess,
WorkflowJobAccess,
# WorkflowJobNodeAccess
)
from awx.main.models import InventorySource, JobLaunchConfig
@pytest.fixture
def wfjt(workflow_job_template_factory, organization):
objects = workflo... |
import re
import hashlib
import time
import StringIO
__version__ = '0.8'
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgor... |
from __future__ import unicode_literals
from frappe import _
import frappe
def get_data():
config = [
{
"label": _("Accounts Receivable"),
"items": [
{
"type": "doctype",
"name": "Sales Invoice",
"description": _("Bills raised to Customers."),
"onboard": 1,
},
{
"type": "... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import os
import uuid
import arating
import tagging
from alibrary.models import MigrationMixin, Relation, Profession
from alibrary.util.slug import unique_slugify
from alibrary.util.storage import get_dir_for_object, OverwriteStorage
from ... |
# -*- coding: utf-8 -*-
"""
matplotlib_package.py - 3 Data Analysis
The dominant plotting library in Python was constructed to
emulate the standard MATLAB plotting syntax and functionality,
hence the name 'matplotlib'.
There are several ways to interface with matplotlib. One can plot ... |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... |
# -*- coding: utf-8 -*-
"""
Created on 28.01.2011
@author: vda
"""
from PyQt4 import QtCore, QtGui
class VerticalLabel(QtGui.QWidget):
def __init__(self, text, parent=None):
QtGui.QLabel.__init__(self, parent)
self.text = text
fm = QtGui.QApplication.fontMetrics()
se... |
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be usef... |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import time
import datetime
import uuid
from devtools_testutils import (
AzureTestCase,
)
from azure_devtools.scenario_tests import (
R... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import os.path
from urllib.request import urlretrieve
from ligotimegps import __version__ as VERSION
# ... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014-2015 Anthony Minotti <anthony@minotti.cool>.
#
#
# This file is part of Yameo framework.
#
# Yameo framework is free software: you can redistribute it and/or modify
# it under the terms of the G... |
# -*- coding: utf-8 -*-
import sys
import os
DIR = os.path.abspath(os.path.normpath(os.path.join(
__file__, '..', '..', '..', '..', '..', 'trytond'
)))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
import unittest
import trytond.tests.test_tryton
from trytond.tests.test_tryton import test_vie... |
from graphene import InputObjectType, String, Int, Mutation, Boolean, Field
from graphene.types.datetime import DateTime
from tasks.models import Task, Category
from tasks.schemas import TaskNode, CategoryNode
class NameInput(InputObjectType):
name = String(required=True)
description = String()
class Creat... |
import os
import sys
import html
import plotly
import socket
from twython import Twython
from analyzer import Analyzer
from twython import TwythonAuthError, TwythonError, TwythonRateLimitError
def chart(positive, negative, neutral):
"""Return a pie chart for specified sentiments as HTML."""
# offline plot
... |
from bukkitrepo import CONFIG
import json
import requests
class Message(object):
def __init__(self, subject, content, from_email, from_name, to_email, to_name):
self.mandrill_send_endpoint = 'http://mandrillapp.com/api/1.0/messages/send.json'
self.mandrill_key = CONFIG['mandrill_api_key']
... |
# 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 field 'AdStatistic.reach'
db.add_column('facebook_ads_adstatistic', 'reach', self.gf('django.db.m... |
#!/usr/bin/env python
# A simple script to demonstrate the vtkCutter function
import vtk
def main():
colors = vtk.vtkNamedColors()
# Create a cube
cube = vtk.vtkCubeSource()
cube.SetXLength(40)
cube.SetYLength(30)
cube.SetZLength(20)
cubeMapper = vtk.vtkPolyDataMapper()
cubeMapper.S... |
from __future__ import unicode_literals
from sqlalchemy import ForeignKeyConstraint, text
from applications.users.models import *
from django.conf import settings
from graphspace.mixins import *
Base = settings.BASE
# ================== Table Definitions =================== #
class UniprotAlias(IDMixin, TimeStamp... |
from flask import current_app
from urllib.parse import urljoin
# nomenclatures fields
counting_nomenclatures = [
"id_nomenclature_life_stage",
"id_nomenclature_sex",
"id_nomenclature_obj_count",
"id_nomenclature_type_count",
"id_nomenclature_valid_status",
]
occ_nomenclatures = [
"id_nomenclat... |
import numpy
from grm import GeneralizedRegressor, BinomialLossFunction, LogitLink
import scipy.stats
from pyearth.earth import Earth
numpy.seterr(all='raise')
m = 1000
n = 10
p = 10
def earth_basis(X, vars, parents, knots, signs):
p = vars.shape[0]
B = numpy.empty(shape=(m,p+1))
B[:,0] = 1.0
for i in ... |
# -* encoding: utf-8 *-
# 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/.
from typing import Any, cast
from unittest.case import TestCase
import requests
import requests... |
from datetime import date, datetime, timedelta
from functools import wraps
import re
import subprocess
import threading
from unicodedata import normalize as unicodedata_normalize
from PyPDF4.pdf import PdfFileReader
from asn1crypto import cms
from django.apps import apps
from django.conf import settings
from django.co... |
#!/usr/bin/python3
# Copyright 2015-2021 Joel Allen Luellwitz and Emily Frost
#
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import random
import string
updatespath = "../src/storages/updates/"
fileslist = [f for f in os.listdir(updatespath) if os.path.isfile(os.path.join(updatespath, f))]
pattern = r'.*StorageUpdateBase.*\(.*"([a-zA-Z0-9]*)".*,.*"([a-zA-Z0-9]*)".*,.*\).*'
... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
RUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************************... |
# Copyright 2018 Fujitsu.
#
# 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... |
"""
hightemp.txtは,日本の最高気温の記録を「都道府県」「地点」「℃」「日」のタブ区切り形式で
格納したファイルである.以下の処理を行うプログラムを作成し,hightemp.txtを入力ファイルとして
実行せよ.さらに,同様の処理をUNIXコマンドでも実行し,プログラムの実行結果を確認せよ.
13. col1.txtとcol2.txtをマージ
12で作ったcol1.txtとcol2.txtを結合し,元のファイルの1列目と2列目をタブ区切りで並べたテキスト
ファイルを作成せよ.確認にはpasteコマンドを用いよ
"""
# -*- coding: utf-8 -*-
import codecs
... |
###############################################################################
# Name: ed_style.py #
# Purpose: Editra's style management system. Implements the interpretation of #
# Editra Style Sheets to the StyledTextCtrl. #
... |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
Attribute data transfer testing module
... |
'''The script identifies mutually exclusive exons from a BED file.
Output is written in GFF format suitable for differential
exon usage analysis using MISO.
'''
import sys
import csv
import networkx as nx
from bx.intervals import IntervalTree
class Exon(object):
def __init__(self, chrom, start, end, transcript... |
# Generated by Django 2.2.4 on 2019-08-06 19:59
import taggit.managers
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("taggit", "0003_taggeditem_add_unique_index"),
("peering", "0049_auto_20190731_1946"),
]
operations = [
migrations.Add... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# Copyright (C) 2005-2006 Emmanuel Blot <emmanuel.blot@free.fr>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have recei... |
#!/usr/bin/env python
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#
# Name: generate_gaussian_samples.py
#
# Author: Constantin Weisser (weisser@mit.edu)
#
# Purpose: This is a python script to write a file containing 10000 data points
# sampled from a 2D Gaussian
#
#-#-... |
#! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... |
import numpy as np
import matplotlib.pyplot as plt
import os
from os.path import join
import cv2
from skimage.transform import resize
from tqdm import tqdm
from datetime import datetime
import functools
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from keras import optimizers
fro... |
"""Test depth buffer save.
A scene consisting of a single coloured triangle will be rendered. The
depth buffer will then be saved to a stream and loaded as a texture.
You will see the original scene first for up to several seconds before the
depth buffer image appears (because retrieving and saving the image is
a sl... |
#!/usr/bin/python
# Written by Andrea Kahn
# Last updated Aug. 29, 2014
'''
This script takes as input:
1) A path to a file containing patients' clinic notes, each line having the format: MRN [tab] date [tab] description [tab] note (one note per line; date must be in format YYYY-MM-DD, YYYY-MM, or YYYY)
2) A path to... |
#!/usr/bin/env python
# rffe functional test
# Author: TaiWen Ko
import xpf6020
import bk8500
import math
import os
from time import sleep
from blessings import Terminal
t = Terminal()
print "Accessing the Power Supply"
ps_path = '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A403OT39-if00-port0'
ps = xpf6020.Xpf602... |
#!/usr/bin/env python
from __future__ import print_function
import errno
import os
import signal
import time
from functools import wraps
import requests
class TimeoutError(Exception):
pass
def timeout(seconds=10, error_message=os.strerror(errno.ETIME)):
def decorator(func):
def _handle_timeout(sig... |
import tensorflow as tf
from tensorflow.python.ops import rnn, rnn_cell, seq2seq
from utils import get_seq_length, _add_gradient_noise, _position_encoding, _xavier_weight_init, _last_relevant, batch_norm
#from https://github.com/DeNeutoy/act-rte-inference/blob/master/AdaptiveIAAModel.py
class Adaptive_Episodes_Con... |
import libglfw
import ctypes
## MACROS
GLFW_VERSION_MAJOR = 3
GLFW_VERSION_MINOR = 0
GLFW_VERSION_REVISION = 1
GLFW_RELEASE = 0
GLFW_PRESS = 1
GLFW_REPEAT = 2
GLFW_KEY_UNKNOWN = -1
GLFW_KEY_SPACE = 32
GLFW_KEY_APOSTROPHE = 39
GLFW_KEY_COMMA = 44
GLFW_KEY_MINUS = 45
GLFW_KEY_PERIOD = 46
GLFW_KEY_SLASH = 47
GLFW_KEY_0 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.