text stringlengths 17 737k |
|---|
import os
import datetime
import operator
import pytest
from doit import tools
from doit import task
def test_create_folder():
def rm_dir():
if os.path.exists(DIR_DEP):
os.removedirs(DIR_DEP)
DIR_DEP = os.path.join(os.path.dirname(__file__),"parent/child/")
rm_dir()
assert True ... |
import logging
import json
import requests
import datetime
import math
import time
# django modules
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render, get_object_or_404
from django.views.generic import View, TemplateView, ListView, DetailView
from django.db.models import Q,Count
... |
{
'targets': [
{
'target_name': 'compiler',
'type': 'static_library',
'include_dirs': [
'include',
'src',
'externals/utf8proc',
'externals/json-parser',
],
'sources': [
'src/compiler/build_tables/build_parse_table.cc',
'src/compiler/bu... |
version = "1.2.2"
|
import cv2
import matplotlib.pyplot as plt
import numpy as np
import os
import _init_paths
import caffe
caffe_root = os.path.join(os.path.dirname(__file__), '..', '..', 'caffe')
def get_map(image, verbose=False):
# caffe.set_device(0)
# caffe.set_mode_gpu()
caffe.set_mode_cpu()
model_def = os.path... |
"""
This file is part of Arakoon, a distributed key-value store. Copyright
(C) 2010 Incubaid BVBA
Licensees holding a valid Incubaid license may use this file in
accordance with Incubaid's Arakoon commercial license agreement. For
more information on how to enter into this agreement, please contact
Incubaid (contact d... |
# Amara, universalsubtitles.org
#
# Copyright (C) 2012 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... |
# -*- encoding: utf-8 -*-
from abjad.tools import systemtools
from abjad.tools import timespantools
import consort
import collections
def _make_timespan_inventory():
timespan_inventory = timespantools.TimespanInventory([
consort.PerformedTimespan(
start_offset=0,
stop_offset=20,
... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Johannes Baiter <johannes.baiter@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your ... |
"""Formatter producing CSV data."""
import sys
import csv
from collections import OrderedDict
import formatter
import executor
# TO BE DEFINED
# - wrong lines
# - return_code/code/section status
# - difference/similarity
class CSVFormatter(formatter.Formatter):
_RESULT_TABLE = {
executor.ER_OK: "ok",
... |
#!/usr/bin/python3
from pkg_resources import parse_version
import json
import sys
import importlib
from importlib.machinery import SourceFileLoader
import traceback
import configparser
import datetime
from time import mktime
import argparse
import time
import logging
import os
import os.path
import glob
from websocket ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Descripti... |
# -*- coding: utf-8 -*-
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
managers = orm['fixmystreet.FMSUser'].objects.filter(manager=True)
#~ table_line_format = u"{0:5} {1:30.30} {2:15.15} {3:4} {4:4}"
#~ table_line_separator = ''.join(['-... |
#!/usr/bin/env python
from operator import itemgetter
import datetime
import sys
import usb.core
MAX_BYTES = 10 * 1000
STARTING_MESSAGE_SIZE = 48
ENDING_MESSAGE_SIZE = 64
MESSAGE_SIZE_STEP = 12
DATA_ENDPOINT = 0x81
class MessageDeviceBenchmarker(object):
def read(self):
data = self._read()
sel... |
from flask.ext.testing import TestCase
import unittest
import angular_flask
from flask import Flask, json, jsonify
from angular_flask import app, db, session
from angular_flask.models import User
class UserTestCase(TestCase):
STATUS_OK = "200 OK"
def create_app(self):
app = Flask(__name__)
app... |
"""Formatter producing CSV data."""
import sys
import csv
from collections import OrderedDict
import formatter
import executor
# TO BE DEFINED
# - wrong lines
# - return_code/code/section status
# - difference/similarity
class CSVFormatter(formatter.Formatter):
_RESULT_TABLE = {
executor.ER_OK: "0",
... |
""" Flow class
"""
import pdb
from blackwidow.network.packet import AckPacket, DataPacket
from event import Event
class Flow(object):
"""Simple class for flows.
Flows will trigger host behavior.
"""
def __init__(self, flow_id, source, destination, amount, env, time):
""" Constructor for Flow c... |
import traceback
import datetime
from datetime import timedelta
import pytz
import astral
import random
import uuid
import re
import asyncio
import logging
from collections import OrderedDict
from copy import deepcopy
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class Scheduler:
def... |
import time
import numpy as nm
import scipy.linalg as sla
from sfepy.base.base import output, get_default, Struct
from sfepy.solvers.solvers import make_get_conf, Solver, EigenvalueSolver
def eig(mtx_a, mtx_b=None, num=None, eigenvectors=True,
return_time=None, method='eig.scipy', **ckwargs):
"""
Uti... |
# Copyright 2015-2016 Yelp 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 writin... |
import datetime
import zmq
import json
from . import monitor
from panoptes.utils import logger, config, messaging, threads, serial
@logger.has_logger
@config.has_config
class CameraEnclosure(monitor.EnvironmentalMonitor):
"""
Listens to the sensors inside the camera enclosure
Args:
messaging (p... |
import collections
import copy
from contextlib import contextmanager
import matplotlib.pyplot as plt
import numpy as np
from astromodels.parameter import Parameter
from astromodels.functions.functions import Uniform_prior
from astromodels.utils.valid_variable import is_valid_variable_name
from threeML.io.file_utils im... |
import json
import re
from collections import Iterable
from copy import deepcopy
from datetime import datetime as dt
from datetime import timedelta as td
from functools import lru_cache
from http.client import HTTPResponse
from urllib import error, parse, request
from ruz.utils import (EMAIL_DOMAINS, EMAIL_PATTERN, RE... |
"""
Linear mixed effects models.
The MixedLM class fits linear mixed effects models to data. This is a
group-based implementation that does not efficiently handle crossed
random effects.
The data are partitioned into disjoint groups. The probability model
for group i is:
Y = X*beta + Z*gamma + epsilon
where
* n_... |
#!/usr/bin/python
"""
Copyright (c) 2014 tilt (https://github.com/AeonDave/tilt)
See the file 'LICENSE' for copying permission
"""
import socket, re, source, util
from lib.logger import logger
def is_valid_ip(ip):
is_valid = re.match("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-... |
print("Hello, welcome to the personalized passwordlist creator : ")
print("please enter the necessary information:")
print("!!! leave unknown information fields empty")
print(" ")
print("""1- info about subject
2- common number passwords
3- general password list
""")
wordlist = []
def shuffle():
lst =... |
#!/usr/bin/env python
'It test the backbone whole process'
# Copyright 2009 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia
# This file is part of franklin.
# franklin is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by th... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014-2015 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the who... |
import re
import csv
from statistics import mean
from fuzzywuzzy import fuzz
from datetime import datetime
from collections import namedtuple
# Classes and Functions for reading and parsing invoices
InvRec = namedtuple('InvoiceRecord', ['NAMEDOSE', 'NAME', 'DOSE', 'COST', 'CATEGORY', 'ITEMNUM',\
'REQDATE'])
d... |
"""
Linear mixed effects models for Statsmodels
The data are partitioned into disjoint groups. The probability model
for group i is:
Y = X*beta + Z*gamma + epsilon
where
* n_i is the number of observations in group i
* Y is a n_i dimensional response vector
* X is a n_i x k_fe design matrix for the fixed effects
*... |
'''
PathwayGenie (c) GeneGenie Bioinformatics Ltd. 2018
PathwayGenie is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
# pylint: disable=invalid-name
# pylint: disable=no-member
# pylint: disable=wrong-import-order
from collect... |
# Copyright (c) 2013 Spotify AB
#
# 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, s... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jiri "NoxArt" Petruzelka
#
# 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,... |
#!/usr/bin/env python3
"""Project Euler - Problem 71 Module"""
from fractions import Fraction
# Smallest Distance if 7 & new_d have no common devisors
# 3/7 -> 3*5 / 7*5 -> 15 / 35 -> (closest) 14 / 35 = 2/5
# 3/7 -> 3*7 / 7*7 -> bad
# 3/7 -> 3*3 / 7*3 -> 9 / 21 -> (closest) 7 / 21 = 1/3
# direction = {-1,1} == {le... |
"""
Linear mixed effects models for Statsmodels
The data are partitioned into disjoint groups. The probability model
for group i is:
Y = X*beta + Z*gamma + epsilon
where
* n_i is the number of observations in group i
* Y is a n_i dimensional response vector
* X is a n_i x k_fe design matrix for the fixed effects
*... |
# -*- coding: utf-8 -*-
import os
import uuid
from django.db import models
from django.db.models.signals import post_delete
from django.utils.translation import ugettext_lazy as _
from apps.gallery import settings as gallery_settings
class UnhandledImage(models.Model):
image = models.ImageField(upload_to=galle... |
from collections import OrderedDict
import os
from pyquery import PyQuery
class Article:
def __init__(self, element, run_time):
self.element = element
self.slot = None
self.run_time = run_time
def serialize(self):
return OrderedDict([
('layout', self.layout),
... |
"""
MMRadar.py
"""
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, LineAsset
from ggame import ImageAsset, PolygonAsset, Frame, Sound, SoundAsset, TextAsset
import time
import random
import math
'''
weather = int(input("Any weather? (1 for custom, 0 for none)"))
if weather =... |
# -*- coding: utf-8 -*-
"""PyMzn can also be used to dynamically change a model during runtime. For
example, it can be useful to add constraints incrementally or change the solving
statement dynamically. To dynamically modify a model, you can use the class
``MiniZincModel``, providing a template model file as input whi... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the... |
import os,platform
class JBCliPy():
"""Constructor"""
def __init__(self,username=None,password=None,win_suppress=False):
if username and password:
self.connect = ' --user=' + username + ' --password=' + password
else:
self.connect = ''
... |
from datetime import timedelta
from django.db.models import Avg, Q
from django.utils import timezone
from drf_haystack.viewsets import HaystackViewSet
from drf_haystack.filters import HaystackHighlightFilter
from rest_framework import mixins, permissions, status, viewsets
from rest_framework.authentication import (
... |
# Copyright (c) Charl P. Botha, TU Delft.
# All rights reserved.
# See COPYRIGHT for details.
###################################################################
# the following programmes should either be on your path, or you
# should specify the full paths here.
# Microsoft utility to rebase files.
REBASE = "rebase... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse, copy, datetime, math, os, pickle, random,sys
import astropy.time as time
import chainer
# from chainer import cuda
import chainer.functions as F
from chainer import optimizers
import hashlib
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot a... |
import waffle
from django.conf import settings as project_settings
from django.db.models import Q
from django.utils import timezone
from django_rq import job
from drf_haystack.viewsets import HaystackViewSet
from drf_haystack.filters import HaystackHighlightFilter
from rest_framework import mixins, permissions, statu... |
from nose.tools import *
from lust import unix, log
from mock import patch, Mock
import sys
import os
import time
import signal
# These tests use mocks to avoid system calls, with testing that the
# functionality works in the tests/server_tests.py using small server
# that are launched and confirmed work.
def test_ma... |
import asyncio
import logging
from aiohttp import web
import django.db
import jsonschema
from vonx.indy.messages import \
ProofRequest as VonxProofRequest, \
ConstructedProof as VonxConstructedProof
import vonx.web.views as vonx_views
from tob_anchor.boot import indy_client, indy_holder_id, indy_verifier_id
... |
from ..common import (
WebApiTestBase, WebClientError as ClientError,
WebClientLoginError as ClientLoginError,
compat_mock, compat_urllib_error
)
class ClientTests(WebApiTestBase):
"""Tests for client related functions."""
@staticmethod
def init_all(api):
return [
{
... |
# Copyright 2014 PerfKitBenchmarker 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 appli... |
import scipy.signal
import numpy as np
import sys
import os
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath("../gunshots"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
fr... |
'''
Split MS into single spectral channels
'''
import os
from taskinit import tb
from .mytools import mymstransform
def split_by_channel(vis, nchan=-1, start=1, spw=0,
restfreq='1420.40575177MHz'):
'''
Splits a MS by its spectral channels, according to the given
'''
# Get the... |
import re
import unittest
from urlparse import urlsplit, urlunsplit
from django.http import QueryDict
from django.db import transaction
from django.core import mail
from django.core.management import call_command
from django.test import _doctest as doctest
from django.test.client import Client
normalize_long_ints = l... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Furtive. Deal with it!
"""
import os
import hashlib
import sys
import sqlite3
class Furtive:
"""
Furtive: file integrity verification system.
"""
def __init__(self, dir, verbose=False):
self.dir = dir
self.verbose = verbose... |
from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.template import Context, loader
from django.models.core import sites
from django.utils import httpwrappers
def shortcut(request, content_type_id, object_id):
from django.models.core import contenttypes
try:
content_type = c... |
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""
Class for reading and writing casa measurement sets.
Requires casacore.
"""
import numpy as np
import os
import warnings
from astropy.time import Time
from .uvdata import UVData
fro... |
from typing import Optional
import requests
from lxml import etree
from xml.sax.saxutils import escape
# import defusedxml.ElementTree as etree
class Office365:
"""
Class to authenticate Office 365 Sharepoint
"""
def __init__(self, share_point_site, username, password):
# type: (str, str, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Compares theorerical scattering curves generated from PDB structure files to
experimental x-ray and neutron scattering curves.
PDBs are converted into sphere models and the Debye equation used to compute
the theoretical curves. The original sphere models are surrounded... |
#!/usr/bin/env python
from numpy import double, fromfile, loadtxt
class LoadMatrix:
def __init__(self):
pass
def load_numbers(self, filename):
return loadtxt(filename).T
def load_dna(self, filename):
fh=open(filename, 'r');
matrix=[]
for line in fh:
matrix.append(line[:-1])
return matrix
def... |
r"""
_
(_) _ __
| | /'_`\ /'__`\
| |( (_) )( ___/
_ | |`\___/'`\____)
( )_| |
`\___/'
joe generates .gitignore files from the command line for you
Usage:
joe (ls | list)
joe [NAME...]
joe (-h | --help)
joe --version
Options:
-h --help Show this screen.
--version Show ... |
'''
Copyright (c) 2016 The Hyve B.V.
This code is licensed under the GNU Affero General Public License (AGPL),
version 3, or (at your option) any later version.
'''
import unittest
import logging
import sys
from import_data_validator.hugoEntrezMap import parse_ncbi_file
from import_data_validator import validateData
f... |
"""
Wps Request
-----------
"""
# Author: Jachym Cepicky
# http://les-ejk.cz
# jachym at les-ejk dot cz
# Lince:
#
# Web Processing Service implementation
# Copyright (C) 2006 Jachym Cepicky
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... |
#!/usr/bin/env python
"""
@brief A class for testing if a point is inside a shape
@author pletzer@psu.edu
"""
import numpy
class Inside:
def __init__(self, shape):
"""
Constructor
@param shape instance of Shape
@param polys connectivty
"""
points, polys, count = ... |
# Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
# Copyright (c) 2012-2016 The PyWavelets Developers
# <https://github.com/PyWavelets/pywt>
# See COPYING for license details.
"""
The thresholding helper module implements the most popular signal thresholding
functions.
"""
from __f... |
from django.test import TestCase
from corehq.apps.domain.models import Domain
from corehq.apps.userreports.models import ReportConfiguration
from corehq.apps.userreports.dbaccessors import get_report_configs_for_domain, \
get_all_report_configs, get_number_of_report_configs_by_data_source
class DBAccessorsTest(Te... |
from collections import defaultdict, namedtuple
from copy import copy
from datetime import datetime
import json
import itertools
from couchdbkit.exceptions import ResourceConflict, ResourceNotFound
from casexml.apps.phone.exceptions import IncompatibleSyncLogType
from corehq.toggles import LEGACY_SYNC_SUPPORT
from core... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from aldryn_apphooks_config.fields import AppHookConfigField
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
from cms.models import CMSPlugin, PlaceholderField
from django.conf import se... |
# -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón andres.calderon@correlibre.org
Sebastián Ortiz V. neoecos@gmail.com
SIIM2 Server is the web server of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you can redistribute it and/or modify
it under the ... |
"""
Easily manage a complex pipeline with python.
============================================================================
AUTHOR: Michael D Dacre, mike.dacre@gmail.com
ORGANIZATION: Stanford University
LICENSE: MIT License, property of Stanford, use as you wish
VERSION: 1.0
CREATED... |
import tensorflow as tf
tf.set_random_seed(777)
class GAN:
def __init(self, s, batch_size=64,
input_height=28, input_width=28, channel=1, z_num=128, sample_num=9, sample_size=16,
output_height=28, output_width=28, n_input=784, n_classes=10,
n_hidden_layer_1=128, n_h... |
"""Core logic of PyTOPKAPI.
The `run` function in this module contains the logic to run a TOPKAPI
simulation based on the parameters specified in an INI file.
"""
#General module importation
import os.path
from configparser import SafeConfigParser
import h5py
import numpy as np
import tables as h5
#Personnal modul... |
#!/usr/bin/python
from __future__ import unicode_literals
import json
import re
import sys
import unicodedata
from datetime import datetime
from pytvmaze import endpoints
from pytvmaze.exceptions import *
try:
# Python 3 and later
from urllib.request import urlopen
from urllib.parse import quote as url_... |
from datetime import datetime, timedelta
from uuid import uuid4
from cqlengine import Model, ValidationError
from cqlengine import columns
from cqlengine.management import create_table, delete_table
from cqlengine.tests.base import BaseCassEngTestCase
class TestSetModel(Model):
partition = columns.UUID(primary... |
###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... |
# Copyright (c) 2016 Ivan Magazinnik
# Copyright (C) 2015 Intel Corporation
# Copyright (C) 2010 Mark Mc Mahon
# 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 ... |
"""Entry point script; implements CLI."""
import argparse
import msvcrt
import os
import pickle
import sys
from PyInquirer import prompt
import questions
from src.pytorch_impl import constants as pyt_constants
from src.pytorch_impl.src import classify as pyt_classify
from src.pytorch_impl.src import train as pyt_tra... |
import copy
import json
import logging
import redis
import sys
from xbrowse.core.constants import GENOME_VERSION_GRCh37, GENOME_VERSION_GRCh38, ANNOTATION_GROUPS_MAP, \
ANNOTATION_GROUPS_MAP_INTERNAL
from xbrowse.core.genomeloc import get_chr_pos
import settings
import time
from xbrowse import genomeloc
from xbr... |
def stat_all_scale_denominators(stat):
return sorted(list(set([
v['selector']['min_scale']
for v in stat['statements']
] + \
[
v['selector']['max_scale']
for v in stat['statements']
if v['selector']['max_scale'] != None
])),
... |
import paypalrestsdk
import warnings
from decimal import Decimal
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import ImproperlyConfigured
from django.http.response import HttpResponseRedirect, HttpResponseBadRequest
from django.urls import NoReverseMatch, resolve, rever... |
# -*- coding: utf-8 -*-
"""
Description: Provides a general html tree class, Element (often imported as E).
This file is part of NearlyPurePythonWebAppDemo
https://github.com/Michael-F-Ellis/NearlyPurePythonWebAppDemo
Compatibilty with Transcrypt Python to JS transpiler:
By design, this module is intended for use... |
#
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Mario Lassnig, mario.lassnig@cern.ch, 2017
# This is a stub... |
# Copyright 2014 Openstack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
"""The Session class allows for a unified (and simplified) view of
interfacing with a PostgreSQL database server.
Connection details are passed in as a PostgreSQL URI and connections are pooled
by default, allowing for reuse of connections across modules in the Python
runtime without having to pass around the object h... |
import math
from operator import and_, or_
import types
from hwt.hdlObjects.operatorDefs import concatFn
from hwt.hdlObjects.constants import DIRECTION
from hwt.hdlObjects.typeShortcuts import hInt, vec, vecT
from hwt.hdlObjects.types.defs import BIT
from hwt.hdlObjects.types.enum import Enum
from hwt.hdlObjects.types... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
'''This is the main module in thumbor'''
__version__ = "0.9.4"
|
# -*- coding: utf-8 -*-
import os
import logging
from pyramid.config import Configurator
from pyramid.session import SignedCookieSessionFactory
from pyramid.view import view_config
from pyramid.events import NewRequest, subscriber
from pyramid.httpexceptions import HTTPFound, HTTPInternalServerError
from pyramid.authe... |
import os, time, numbers, math
import pygame
from .utils import cached_property
# colors from http://clrs.cc/
color_map = {
'aqua': (127, 219, 255),
'blue': (0, 116, 217),
'navy': (0, 31, 63),
'teal': (57, 204, 204),
'green': (46, 204, 64),
'olive': (61, 153, 112),
'lime': (1, 255, 112),
... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... |
#!/bin/env python
#
# AutoPyfactory batch status plugin for Condor
# Dedicated to handling VM job submissions and VM pool startds.
import commands
import subprocess
import logging
import os
import time
import threading
import traceback
import xml.dom.minidom
import sys
from datetime import datetime
from pprint i... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team
#
# 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 ... |
from typing import List, Optional
from hwtHls.clk_math import start_of_next_clk_period
from hwtHls.netlist.nodes.io import HlsWrite
from hwtHls.netlist.nodes.ops import HlsConst, AbstractHlsOp
from hwtHls.scheduler.errors import TimeConstraintError
from hwt.pyUtils.uniqList import UniqList
def _asap(node: AbstractHl... |
# Game made by GR8 from Legend Family.
import discord
from discord.ext import commands
from cogs.utils import checks
from .utils.dataIO import dataIO, fileIO
from collections import Counter, defaultdict, namedtuple
from .utils.chat_formatting import box
from __main__ import send_cmd_help
import os
from copy import dee... |
'''
Show log output of program:
To show the chalmers program control log, run:
chalmers log server1 -3
'''
from __future__ import unicode_literals, print_function
from argparse import RawDescriptionHelpFormatter
import logging
import os
import sys
import time
from chalmers import config
from chalmers.program ... |
import logging
from argparse import ArgumentParser
from httplib import BadStatusLine
from traceback import print_exc
from urllib2 import HTTPError
from urllib2 import URLError
from bs4 import BeautifulSoup
from srs.db import download_db
from srs.db import open_db
from srs.db import open_dt
from srs.db import show_tab... |
#!/usr/bin/env python
import curses, cv
from random import choice
from os import environ
class PyCamera(object):
kPALETTE_A = list(' .,/c(@#8')
kPALETTE_B = list(' .;-:!>7?Co$QHNM')
kPALETTE_C = list(' .,:;irsXA253hMHGS#9B&@')
def __init__(self, stdscr):
self._palette = None
self.stds... |
#!/usr/bin/python
import subprocess
### PYMALLET
class pymallet(object):
"""class documentation string"""
def __init__(self):
print "Welcome to pymallet"
pass
### POSSIBLY INCLUDE A FUNCTION TO DO BASIC PRE-PROCESSING LIKE REMOVING
### STOPWORDS AND STEMMING
### INPUT A CSV FILE AND RETURN A TEMPORARY ... |
#!/usr/bin/env python
"""This module is for reading ACE-format cross sections. ACE stands for "A Compact
ENDF" format and originated from work on MCNP_. It is used in a number of other
Monte Carlo particle transport codes.
ACE-format cross sections are typically generated from ENDF_ files through a
cross section proc... |
import re
import sys
import operator
import numpy as np
import numpy.linalg as linalg
from sets import Set
import pdb
high_cost = ['ARRAYLEN_GC_OP',
'STRLEN_OP',
'STRGETITEM_OP',
'GETFIELD_GC_PURE_OP',
'GETFIELD_RAW_PURE_OP',
'GETARRAYITEM_GC_PURE_OP',
'GETARRAYITEM_RAW_PURE_OP',
'UNICODEL... |
# coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... |
import datetime
from functools import total_ordering
from racconto.settings_manager import SettingsManager as SETTINGS
#
# Content containers (Post and Page)
#
class ContentBase(object):
""" Base class for compiled content """
def __init__(self, options):
self.title = options["title"]
self.tem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.