src stringlengths 721 1.04M |
|---|
# zwei 04/24/2014
# micro benchmark: method call polymorphic inspired by richards
import time
iteration = 50000
class Task(object):
def __init__(self, p, w, h):
self.packet_pending = p
self.task_waiting = w
self.task_holding = h
self.link = None
def isTaskHoldingOrWaiting(self... |
# -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: V1.2
@author: muyeby
@contact: bxf_hit@163.com
@site: http://muyeby.github.io
@software: PyCharm
@file: assignment2.py
@time: 16-7-7 下午8:44
"""
from __future__ import print_function
from copy import copy
import time
class PerceptronClassifier(object):
# The per... |
"""A sphnix-doc plugin to build mxnet docs"""
import subprocess
import re
import os
import json
from recommonmark import transform
import pypandoc
# start or end of a code block
_CODE_MARK = re.compile('^([ ]*)```([\w]*)')
# language names and the according file extensions and comment symbol
_LANGS = {'python' : ('py... |
#!/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open("README.md", "r") as readme:
long_description = readme.read()
setup(
name="obd",
version="0.7.1",
description=("Serial module for handling live sensor data from a vehicle's OBD-II port"),
long_descript... |
#!/usr/bin/env python
import time
import json
from datetime import datetime
class Log:
fileName = "/home/pi/.greenPi/relays/log.json"
#fileName = os.environ['HOME'] + "/.greenPi/relays/log.json"
@staticmethod
def writeLog(key, cycleName, numRelays, mode, seconds=None):
log = Log.getLog()
... |
import unittest
from pyramid import testing
EXAMPLE_IDENTIFIER = 'S000003131'
class SGDViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
self.config.include('pyramid_jinja2')
def tearDown(self):
testing.tearDown()
def test_locus_summary_page(self):
... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial import distance
from numpy import sqrt
from numpy import pi
def load_vectorcoordinates_from_txt(inputfile):
coords = np.loadtxt(inputfile)
n,i = coords.shape
return coords.reshape((n,int(i/2),2))
def generate_centercoords(vectorcoords):
# a... |
import mailcap
import os
import shutil
import copy
import test.support
import unittest
# Location of mailcap file
MAILCAPFILE = test.support.findfile("mailcap.txt")
# Dict to act as mock mailcap entry for this test
# The keys and values should match the contents of MAILCAPFILE
MAILCAPDICT = {
'application/x-movie... |
#!/usr/bin/python2.5
#
# Copyright 2010 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... |
# simple trading strategy simulator
import pandas as pd
from pandas.tools.plotting import autocorrelation_plot
from pandas.tools.plotting import scatter_matrix
import numpy as np
from scipy import stats
import sklearn
from sklearn import preprocessing as pp
import matplotlib as mpl
import matplotlib.pyplot as plt
f... |
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.core import core_select_lib
__all__ = ('NFCBase', 'NFCScanner')
class NFCBase(Widget):
''' This is the base Abstract definition class that the actual hardware dependent
implementations would be based on. If you want to def... |
# Copyright 2013 VMware, 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 by a... |
# -*- coding: utf-8 -*-
#
# OIOIOI documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 26 22:38:45 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.
#
# All ... |
# -*- coding: utf-8 -*-
# pylint: disable=bad-continuation
""" Shell command calls.
"""
# Copyright ⓒ 2015 Jürgen Hermann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This pr... |
#!/usr/bin/python
import sys
from nwb import nwb_file
from nwb import nwb_utils as utils
"""
Example using extension to add metadata to group /general
Group /general contains general metadata, i.e. metadata that
applies to the entire session.
This example uses the extension defined in extensions/e-general.py
to add ... |
import configuration_service_client as conf_client
def test_basic_get():
amqp_settings = conf_client.getSystemSettings('amqp')
print amqp_settings
assert amqp_settings is not None
assert len(amqp_settings) > 0
print 'test basic get passed'
def test_setAndDrop():
system = 'test'
settings = ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import time, os, calendar , datetime, recordatorio
#Generico
hostname = os.uname()[1]
if hostname == "server1":
prepath = "/opt"
elif hostname == "octopussy":
prepath = "/home/xir/dev"
path = prepath + "/menu/"
tpath = path + "tmp/"
datapath = path + "data/"
db... |
from __future__ import print_function, unicode_literals
from aspen import json
from gratipay.testing import Harness
from gratipay.models.participant import Participant
class Tests(Harness):
def setUp(self):
Harness.setUp(self)
self.make_participant('alice', claimed_time='now')
def hit_privac... |
#!/usr/bin/env python
# Copyright 2015 Bryce Schroeder, www.bryce.pw, bryce.schroeder@gmail.com
# Wiki: http://www.ferazelhosting.net/wiki/delv
#
# 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 Fo... |
__version__ = "0.4"
import argparse
import cgi
import datetime
import errno
import io
import logging
import multiprocessing
import os
import re
import signal
import socket
import sys
import time
import traceback
import urllib
# Python2/3 module disambiguation
if sys.version[0] == '3':
import configparser
impo... |
import datetime
import stripe
from django.urls import reverse
from django.utils import timezone
from django.test import TestCase, Client
from findyour3d.users.models import User
from findyour3d.company.models import Company
from findyour3d.customer.models import Customer
STRIPE_API_KEY = 'sk_test_BS2t9JImRsscT1vyWN... |
# This file is part of Py6S.
#
# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.
#
# Py6S is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... |
from __future__ import absolute_import, unicode_literals
from drf_toolbox import routers, serializers
from drf_toolbox.compat import models, django_pgfields_installed
from drf_toolbox.decorators import base_action
from rest_framework import viewsets
from tests.compat import mock
from tests.views import NormalViewSet
im... |
# -*- coding:utf-8 -*-
import os
import psycopg2
from pprint import pprint
from delver import Crawler
def scraping_movies_table():
c = Crawler()
c.logging = True
c.useragent = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
c.open("http://www.boxofficemojo.com/daily/")
... |
# -*- coding: utf-8 -*-
#
# Torweb documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 3 13:37:43 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
from markymark.fields import MarkdownField, MarkdownFormField
from markymark.widgets import MarkdownTextarea
class CustomMarkdownTextarea(MarkdownTextarea):
pass
def test_markdownfield_formfield():
field = MarkdownField()
form_field = field.formfield()
assert isinstance(form_field, MarkdownFormField... |
import logging
import os
import sys
import StringIO
import stat
import yaml
import zookeeper
from twisted.internet.defer import inlineCallbacks, Deferred, fail, returnValue
from juju.unit.lifecycle import (
UnitLifecycle, UnitRelationLifecycle, RelationInvoker)
from juju.unit.workflow import RelationWorkflowSta... |
class KEY(object):
def __init__(self, internal_name, external_name):
self.internalName = internal_name
self.externalName = external_name
class REQUEST(object):
def __init__(self, internal_name, external_name):
self.internalName = internal_name
self.externalName = external_name
... |
import itertools
import re
import pytest
from logstapo import util
@pytest.mark.parametrize(('regexps', 'string', 'expected'), (
('foo', 'bar', False),
('f.o', 'foo', True),
(['foo', 'bar'], 'bar', True),
(['foo', 'baz'], 'bar', False),
(['foo', '(b)ar', 'b(a)r'], 'bar', 'b'),
))
def test_try_ma... |
import glob
import os
import os.path
import json
from jsonselect import jsonselect
from unittest import TestCase, skip
import logging
import sys
log = logging.getLogger(__name__)
class TestConformance(TestCase):
pass
def get_ctests(test_path):
inputs = {}
for selector_path in glob.iglob(os.path.join(... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import sys
import functools
from collections import namedtuple
from contextlib import contextmanager
from grako.util import notnone, ustr, prune_dict, is_list, info, safe_name
from grak... |
# Copyright (C) 2021 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 agreed to in writing, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The experiment with 10 Hz/5Hz, wisp, attention, 70, cA 4, delta, theta, alpha low, alpha high, beta low, batch size = 5 and
multiclass data set (BALANCED) with signal only data
@author: yaric
"""
import experiment as ex
import config
from time import time
n_hidden ... |
"""
This is wrapper for pandas.DataFrame, which allows you to define dataset for estimator in a simple way.
"""
from __future__ import division, print_function, absolute_import
import numbers
from numpy.random.mtrand import RandomState
import pandas
import numpy
from sklearn.utils import check_random_state
from ..uti... |
# Copyright (c) 2014 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 required by applicable law or agreed to in writ... |
# coding=utf-8
# Copyright 2019 DeepMind Technologies Limited.
#
# 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 applic... |
"""
sentry.testutils.cases
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = (
'TestCase', 'TransactionTestCase', 'APITestCase', 'AuthProviderTestCase',
'RuleTest... |
from datetime import date, datetime, timedelta
from canari.maltego.message import Entity, Field, StringEntityField, IntegerEntityField, FloatEntityField, \
BooleanEntityField, EnumEntityField, LongEntityField, DateTimeEntityField, DateEntityField, TimeSpan, \
TimeSpanEntityField, RegexEntityField, ColorEntityFi... |
import json
import os
import shutil
from datetime import datetime
from dateutil.tz import gettz
from contextlib import contextmanager
from six.moves.urllib.parse import urlparse
from conans import load
from conans.client import tools
from conans.client.cache.remote_registry import load_registry_txt, migrate_registry... |
import datetime
import time
import boto
import redis
import requests
import random
import zlib
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.template.loader import render_to_string
from django.db import IntegrityE... |
"""
Django settings for jobs_portal project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... |
from oauth2client.client import flow_from_clientsecrets, credentials_from_clientsecrets_and_code
from apiclient.discovery import build
import json, httplib2, sys
from oauth2client.file import Storage
import setting, os
target_calendar_name = "debug"
credentials = None
storage = Storage(setting.STORAGE_FILE)
if os.pa... |
# -*- coding: utf-8 -*-
"""
Output Plugin for Helix MP3 encoder
Copyright (c) 2006-2008 by Nyaochi
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
(at yo... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import calendar
import codecs
import datetime
import io
import os.path
import re
import sqlite3
import subprocess
import sys
from .dump import dump_tx
from pycoin.coins.exceptions import BadSpendableError
from pycoin.convention import tx_fe... |
# Copyright 2009-2016, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Top panel for every page, containing basic system and tor related information.
This expands the information it presents to two columns if there's room
available.
"""
import os
import time
import stem
import stem.con... |
"""
.. module:: artist_gid_redirect
The **Artist Gid Redirect** Model.
PostgreSQL Definition
---------------------
The :code:`artist_gid_redirect` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE artist_gid_redirect ( -- replicate (verbose)
gid UUID NOT NU... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
#!/usr/bin/env python
# check Python's version
import sys
if sys.version < '2.4':
sys.stderr.write('This module requires at least Python 2.5\n')
sys.exit(1)
# import statements
import platform
from setuptools import setup, Command
# debug
DISTUTILS_DEBUG = False
# check linux platform
if not platform.system... |
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
# --------------------------------------------------------
import xml.etree.ElementTree as ET
import os
import cPickle
import numpy as np
from voc_eval im... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from mock import Mock, patch, call
from email_backup.core.connector import (
get_email_content,
Email,
EmailConnectorInterface
)
from email.parser import Parser
from datetime import date, datetime
import binascii
... |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('transhette.views',
url(r'^$', 'home', name='transhette-home'),
url(r'^restart/$', 'restart_server', name='transhette-restart-server'),
url(r'^apply_changes/$', 'do_restart', name='apply_changes'),
url(r'^pick/$', 'list_language... |
""" Testing debugging of a binary with "mixed" dwarf (with/without fission). """
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestMixedDwarfBinary(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... |
#!/usr/bin/env python
import os
import sys
import math
import numpy as np
import random
####------------
Replicas = int(sys.argv[1])
Cycle = int(sys.argv[2])
def TemperatureExchange(Replicas):
exchangeList = range(Replicas)
#random.shuffle(exchangeList)
#####Read the mdinfo files######
Temp = 0.0
... |
"""
Django settings for TEKDB project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... |
import pygad as pg
import matplotlib.pyplot as plt
import numpy as np
import utils
import glob
from multiprocessing import Pool
filename = __file__
def plot(args):
halo = args[0]
type = args[1]
path = '/ptmp/mpa/naab/REFINED/%s/SF_X/4x-2phase/out/snap_%s_4x_???' % (halo, halo)
max = int(sorted(glob.gl... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Lice... |
#!/usr/bin/env python
# coding:utf-8
import errno
import time
import re
import socket
import ssl
import http.client
import OpenSSL
NetWorkIOError = (socket.error, ssl.SSLError, OpenSSL.SSL.Error, OSError)
from .connect_manager import https_manager
from .gae_handler import return_fail_message
from .google_ip impor... |
# Orca
#
# Copyright 2014 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs@igalia.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your o... |
"""Trigram analysis text generator."""
import sys
from random import randint
import io
def create_word_bank(word_list):
"""Create a dictionary with keys of 2 word pairs."""
word_bank = {}
for i, word in enumerate(word_list):
key = word + ' ' + word_list[i + 1]
if i < len(word_list) - 2:
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Standard Library
import collections
# Third Party Stuff
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import... |
"""codefragments.py -- wrapper to modify code fragments."""
# (c) 1998, Just van Rossum, Letterror
__version__ = "0.8b3"
__author__ = "jvr"
import Carbon.File
import struct
from Carbon import Res
import os
import sys
DEBUG = 0
error = "cfm.error"
BUFSIZE = 0x80000
def mergecfmfiles(srclist, dst, architecture = '... |
import json
import torch
import torch.legacy.optim as optim
from pprint import pprint
def rosenbrock(tensor):
x, y = tensor
return (1 - x) ** 2 + 100 * (y - x ** 2) ** 2
def drosenbrock(tensor):
x, y = tensor
return torch.DoubleTensor((-400 * x * (y - x ** 2) - 2 * (1 - x), 200 * x * (y - x ** 2)))
... |
from __future__ import unicode_literals
import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.urls.exceptions import Resolver404
from django.urls.resolvers import URLResolver
from channels.http import AsgiHandler
"""
All Routing instances inside this ... |
"""Pattern clustering procedure APIs.
"""
from .compat import itervalues
from .config import get_default_config
from .definition import BasePattern
from .parse_utils import EMPTY_PARSED_PIECE, ParsedPiece
from .parser import fuzzy_digest, parse
from .pattern_cluster import cluster
from .piece_pattern_node import PieceP... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# ======================================================================================================================
# The MIT License (MIT)
# ======================================================================================================================
# Copyr... |
# -*- coding: utf-8 -*-
#
# Scikit-Criteria documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 3 02:18:36 2017.
#
# 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 fil... |
# Copyright 2016 - ZTE, Nokia
#
# 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... |
''' Wrapper for R models to allow comparison to scipy models '''
import numpy as np
from rpy import r
from exampledata import x, y
class RModel(object):
''' Class gives R models scipy.models -like interface '''
def __init__(self, y, design, model_type=r.lm):
''' Set up and estimate R model with data... |
# -*- coding: utf-8 -*-
import os
import sass
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.template.loader import get_template # noqa Leave this in to preload template locations
from django.utils.importlib import import_... |
import os
class CopyType:
""" A fake enum, define three type of copy job """
FILE2FILE = 0
FILE2DIR = 1
DIR2DIR = 2
def copytype2str(t):
if t == CopyType.FILE2FILE:
return "file to file"
elif t == CopyType.FILE2DIR:
return "file(s) to dir"
elif t == CopyType.DIR2DIR:
... |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr
import os, json
from webnotes.utils import get_base_path
from install_erpnext... |
# Only Celery settings for stations project.
#import djcelery
#djcelery.setup_loader()
#BROKER_TRANSPORT = 'amqplib'
#BROKER_URL = 'django://'
##CELERY_RESULT_BACKEND = 'database'
#CELERY_DEFAULT_QUEUE = "default"
#CELERY_QUEUES = {
# "default": {
# "binding_key": "task.#",
# },
# "mailer": {
# "binding_key": "t... |
#!/usr/bin/env python
__author__ = 'Adam R. Smith'
__license__ = 'Apache 2.0'
import collections
class DotNotationGetItem(object):
""" Drive the behavior for DotList and DotDict lookups by dot notation, JSON-style. """
def _convert(self, val):
""" Convert the type if necessary and return if a conver... |
from django.shortcuts import render
# from django.views.decorators.csrf import csrf_exempt
from tempfile import NamedTemporaryFile
import os, sys
from django.http import HttpResponse
# import http.client
# python2 import httplib
# this for python3 maybe:
# import urllib.request
# import urllib.parse
# this for pytho... |
from toee import *
def OnBeginSpellCast( spell ):
print "Holy Word OnBeginSpellCast"
print "spell.target_list=", spell.target_list
print "spell.caster=", spell.caster, " caster.level= ", spell.caster_level
game.particles( "sp-evocation-conjure", spell.caster )
def OnSpellEffect ( spell ):
print "Holy Word OnSpel... |
# -*- coding: utf-8 -*-
#
# pydex_dialogs.py
#
# Copyright Cristian Navalici ncristian [at] lemonsoftware.eu
#
# 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; eith... |
# to be imported to access modbus registers as counters
# 04.04.2014 OOP
# 05.04.2014 OOP
# 06.04.2014 counter grousp with sequential regadd range, optimized read done
# 15.04.2014 added ask_counters()
from sqlgeneral import * # SQLgeneral / vaja ka time,mb, conn jne
s=SQLgeneral() # init sisse?
from counter2power im... |
import scipy.io
from sklearn.metrics import accuracy_score
from sklearn import cross_validation
from sklearn import svm
from skfeature.function.information_theoretical_based import JMI
def main():
# load data
mat = scipy.io.loadmat('../data/colon.mat')
X = mat['X'] # data
X = X.astype(fl... |
from datetime import datetime, timedelta
import numpy as np
import pytest
from pandas._libs.tslibs import frequencies as libfrequencies, resolution
from pandas._libs.tslibs.ccalendar import MONTHS
from pandas._libs.tslibs.frequencies import (
INVALID_FREQ_ERR_MSG, FreqGroup, _period_code_map, get_freq, get_freq_c... |
##############################################################################
# Clinical trials parser
#
# eg 2013-2016
##############################################################################
import cPickle, os, re
def main():
#base_dir = "../data/ct/"
base_dir = "/home/eguney/data/ct/"
file_name ... |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
scope = "System"
description = """
This role grants a user basic object creation and editing permission.
"""
owner_base = [
"Categorization",
"Category",
"ControlCategory",
"ControlAsser... |
import os
import random
import sys
sys.path.append(os.path.join(os.getcwd(), 'gen-py'))
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTransport
# Generated using
# thrift -o . --gen py:new_style student.thrift
from student.ttypes import Course
from student.ttypes import Student
# Based ... |
#
# Copyright (C) 2009 Thadeus Burgess
#
# 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 distr... |
import copy
import datetime
import json
import logging
import os
import re
import time
import warnings
from collections import defaultdict
from typing import List
import pandas as pd
import requests
from pyshex import ShExEvaluator
from rdflib import Graph
from shexer.shaper import Shaper
from wikidataintegrator.wdi_... |
import base64
import ctypes
import sys
from Crypto.Cipher import AES
from Crypto import Random
from pbkdf2 import PBKDF2
class iv:
def __init__(self, bs):
self.bs = bs
self.usedIVs = set()
self.initializeIV()
def initializeIV(self):
self.value = Random.new().read(self.bs)
self.usedIVs.... |
__author__ = 'mori.yuichiro'
import os
import fnmatch
class FileLister():
def __init__(self, target_path, ignore_dirs=None, ignore_file_patterns=None):
abs_path = os.path.abspath(target_path)
if not os.path.isdir(abs_path):
raise Exception('Invalid target path!')
self.target_... |
# -*- encoding: utf-8 -*-
# #############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
# 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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... |
#!/usr/bin/env @PYTHON_EXECUTABLE@
"""
Description: Viewer and exporter for Siconos mechanics-IO HDF5 files based on VTK.
"""
# Lighter imports before command line parsing
from __future__ import print_function
import sys
import os
import json
import getopt
import math
import traceback
import vtk
from vtk.util.vtkAlgor... |
# 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,... |
from faf.api import LeaderboardSchema
from faf.api import LeaderboardStatsSchema
from flask import request
from pymysql.cursors import DictCursor
from api import app
from api.error import ApiException, ErrorCode
from api.error import Error
from api.query_commons import fetch_data
from faf import db
MAX_PAGE_SIZE = 50... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2011, Nicolas Clairon
# 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 abov... |
import sys
import re
import pymel.util as _util
import pymel.internal.pmcmds as cmds
import pymel.internal.factories as _factories
import pymel.internal.startup as _startup
import pymel.internal as _internal
import pymel.versions as _versions
import maya.mel as _mm
_logger = _internal.getLogger(__name__)
def _resolveU... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 12 14:22:31 2016
@author: Tobias Jachowski
"""
import collections
import matplotlib.pyplot as plt
import numpy as np
from abc import ABCMeta, abstractmethod
from .. import gui
from .. import helpers as hp
from .. import traces as tc
from ..evaluate import signal as sn
fr... |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
## @file info_mc_j2k.py
# The size in bytes, and a codestream Kbps, even detailed subband
# level and neglecting headers, from a MCJ2K codestream.
#
# @authors Jose Carmelo Maturana-Espinosa\n Vicente Gonzalez-Ruiz.
# @date Last modification: 2015, January 7.
#
## @p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import os
def set_proxies(proxy_host, proxy_port, proxy_user=None, proxy_password=None):
"""Sets proxy dict for requests."""
PREFIX_HTTP = "http://"
PREFIX_HTTPS = "https://"
proxi... |
from setuptools import setup
with open('README.rst', encoding='utf-8') as file:
long_description = file.read()
install_requires = [
'aiohttp',
'aioredis',
'click',
'structlog[dev]',
'websockets',
]
tests_require = install_requires + [
'aioresponses',
'pytest',
'pytest-asyncio',
]... |
from django import forms
__author__ = 'ubuntu'
def tag_form_factory(image_tags):
# 'question' : forms.IntegerField(widget=forms.HiddenInput, initial=question.id),
properties = {}
for tag in image_tags:
properties[image_tags[tag]] = forms.BooleanField(initial=True)
return type('TagForm', (form... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.