src stringlengths 721 1.04M |
|---|
#encoding:utf-8
import logging
import yaml
import praw
import utils
from reporting_stuff import report_error
from utils.tech import long_sleep, short_sleep
def send_to_channel_from_subreddit(how_to_post, channel_to_post, subreddit, submissions_ranking, submissions_limit, config, **kwargs):
reddit = praw.Reddit... |
from ..hub_proxy import SAMPHubProxy
from ..hub import SAMPHubServer
from .. import conf
def setup_module(module):
conf.use_internet = False
class TestHubProxy(object):
def setup_method(self, method):
self.hub = SAMPHubServer(web_profile=False, mode='multiple', pool_size=1)
self.hub.start... |
"""
usage: python ./kmeans_trialtime.py name data roifile cond tr window [, filtfile]
"""
import sys, os
import numpy as np
import argparse
# from fmrilearn.analysis import fir
from fmrilearn.load import load_roifile
from sklearn.cluster import KMeans
from wheelerexp.base import Trialtime
from wheelerexp.base import ... |
# Copyright 2015 Internap.
#
# 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, so... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2011-2021, Nigel Small
#
# 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 require... |
"""Locations where we look for configs, install stuff, etc"""
import sys
import site
import os
import tempfile
from distutils.command.install import install, SCHEME_KEYS
import getpass
from pip.backwardcompat import get_python_lib
import pip.exceptions
DELETE_MARKER_MESSAGE = '''\
This file is placed here by pip to ... |
"""Interpreter za pseudokod, s funkcijskim pozivima i dva tipa podataka.
Podržane naredbe:
ako je Uvjet naredba inače naredba ime = izraz
ako je Uvjet naredba Ime = Uvjet
ako nije Uvjet naredba vrati izraz
dok je Uvjet naredba vrati Uvjet
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Umeå University.
#
# 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
#
# U... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# License: BSD style
import numpy as np
from scipy import linalg, optimize, rand
from ..base import BaseEstimator, RegressorMixin
from ..metrics.pairwise import m... |
# -*- coding: utf-8 -*-
import logging
import os
from flask import render_template, request, redirect, \
url_for, flash, session, abort, current_app, jsonify
from flask.blueprints import Blueprint
from flask_babel import gettext, format_date
from flask_login import current_user, login_user, logout_user, \
logi... |
#!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': '... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-16 16:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
"""
Django Celery tasks for service status app
"""
import logging
from smtplib import SMTPException
import requests
import simplejson
from celery import Task, shared_task
from celery.states import FAILURE
from django.conf import settings
from django.core.mail import EmailMessage
from edx_django_utils.monitoring impor... |
import numpy as np
import tifffile
import os
import scipy
import dill
import pandas as pd
def load_object(filename):
f = open(filename, "rb")
obj = dill.load(f)
f.close()
return obj
## Directory of the folder containing activity images
file_dir="/n/schier_lab2/everyone/avereallyfullfusio... |
# # tests
import logging
import operator
from datetime import datetime
from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import PermissionDenied, ValidationError
from django.urls import reverse
from django.db.models import Q
from django.http i... |
# coding=utf8
import sublime
import sublime_plugin
from queue import Queue
from threading import Thread
from subprocess import Popen, PIPE
import subprocess
import os
import json
import re
import sys
# --------------------------------------- CONSTANT -------------------------------------- #
dirname = os.path.dirnam... |
# Copyright 2017 DataCentred Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of <%= package.name %>.
# <%= package.url %>
# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.au... |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all... |
# Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly no... |
#-*- encoding=UTF-8 -*-
"""
Django settings for nthuoj 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... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from dataclasses import dataclass
from pants.backend.python.rules.inject_init import InitInjectedSnapshot, InjectInitRequest
from pants.backend.python.rules.inject_init import rules as in... |
from operator import attrgetter
from django.http import HttpResponse,HttpResponseRedirect,HttpResponseNotFound,HttpResponseForbidden
from django.shortcuts import render_to_response
from django.views.decorators.http import require_GET, require_POST
from webinars_web.webinars.forms.event import EventForm
from marketplace... |
from contextlib import contextmanager
from typing import (
TYPE_CHECKING,
Any,
Dict,
Hashable,
Iterator,
Mapping,
Sequence,
Set,
Tuple,
Union,
cast,
)
import pandas as pd
from . import formatting, indexing
from .indexes import Indexes
from .merge import merge_coordinates_wi... |
"""
问题描述:分别用递归和非递归方式实现二叉树的先序、中序、和后续遍历
思路:使用非递归的方式需要使用辅助栈代替函数栈
"""
from binarytree.toolcls import Node
class RecursiveVisit:
@classmethod
def visit_in_first_order(cls, head):
if head is None:
return
print(head.value, end=' ')
cls.visit_in_first_order(head.left)
cl... |
#!/usr/bin/python
# encoding: utf-8
import os
import sys
from testlib import repo_path, cmc_path
import testlib.pylint_cmk as pylint_cmk
def test_pylint_checks(pylint_test_dir):
f = file(pylint_test_dir + "/cmk-checks.py", "w")
# Fake data structures where checks register (See cmk_base/checks.py)
f.writ... |
from setuptools import setup
import os
DESCRIPTION = "API for Brazillian Correios in Python"
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.md').read()
except:
pass
def get_version(version_tuple):
version = '%s.%s' % (version_tuple[0], version_tuple[1])
if version_tuple[2]:
ver... |
# -*- coding: 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):
# Deleting field 'OrderItem.special_arrangement'
db.delete_column(u'exams_orderitem', 'special_arrangement_i... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
VoronoiPolygons.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
# Natural Language Toolkit: Tokenizer Interface
#
# Copyright (C) 2001-2010 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Tokenizer Interface
"""
from nltk.internals import overridden
from util import string_span_tokeni... |
import calendar
from datetime import datetime
from datetime import timedelta
from pandac.PandaModules import Vec3, Vec4, Point3, TextNode, VBase4
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import DirectFrame, DirectButton, DirectLabel, DirectScrolledList, DirectCheckButton
from direct.gui import Dir... |
#!/usr/bin/python2
#
# Copyright (C) 2014 pytest-sourceorder contributors. See COPYING for license
#
from setuptools import setup
import io
with io.open('README.rst', 'rt', encoding='utf-8') as f:
readme_contents = f.read()
setup_args = dict(
name = "pytest-sourceorder",
version = "0.5.1",
descriptio... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.apach... |
"""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 operations to manipula... |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
# Copyright (c) - 2013 Mitchell Peabody.
# See COPYRIGHT.txt and LICENSE.txt in the root of this project.
import datetime
import jinja2
import os
import webapp2
# some google apis
from google.appengine.api import users
# application apis
from nl import parser
from model import User, Variable, Value
from xmpp import X... |
# -*- coding: UTF-8 -*-
#
# (c) 2012 Mandriva, http://www.mandriva.com/
#
# This file is part of Management Server Setup
#
# MSS 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,... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#-------------------------------------------------------------------------------
"""test
Implements a Distutils 'test' command."""
__author__ = ('Lance Finn Helsten',)
__version__ = '1.0.1'
__copyright__ = """Copyright 2009 Lance Finn Helsten (helsten@acm.org)"""
__license... |
# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Tests for `rpc.leases`."""
from datetime import datetime
import random
import time
from django.utils import timezone
from netaddr import IPAddress
from testtools.matcher... |
import os.path
from django.db import models
from django.utils import timezone
from django.utils.text import get_valid_filename
from django.utils.translation import ugettext_lazy as _
from oioioi.contests.models import Contest
from oioioi.filetracker.fields import FileField
def make_logo_filename(instance, filename)... |
#!/usr/bin/env python3
import httplib2
import os
import sys
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import argparser, run_flow
class YoutubeSearcher():
# The ... |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... |
import bee
from bee.segments import *
class dictionary(object):
metaguiparams = {"type": "type"}
def __new__(cls, type):
class dictionary(bee.worker):
def place(self):
self._dict = {}
self.v_dic = self._dict
def __setitem__(self, key, value):
... |
'''
Created on 27.03.2013
HB! :)
@author: capone
'''
# TODO: Style!!! rewrite it all
import urllib
import os
import socket
import urlparse
import logging
from crashtec.db.provider import routines as dbroutines
from crashtec.db.provider import filter
from crashtec.config import symbolsmngrconfig
from crashtec.utils... |
import logging
from bson import ObjectId
from superdesk.resource import Resource
from superdesk.services import BaseService
from superdesk.errors import SuperdeskApiError
from superdesk import get_resource_service
from flask import current_app as app
from flask import Blueprint
from flask_cors import CORS
from liveblo... |
# -*- test-case-name: vumi.application.tests.test_bridge -*-
from base64 import b64encode
from twisted.python import log
from twisted.web import http
from twisted.internet.defer import inlineCallbacks
from vumi.application.base import ApplicationWorker
from vumi.utils import http_request_full
from vumi.errors import... |
# -*- coding:utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2014 Atushi Odagiri
# 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 rig... |
"""
.. autoclass:: revscoring.Feature
:members:
"""
from math import log as math_log
from ..dependencies import Dependent
# Sets up refences to overloaded function names
math_max = max
math_min = min
class Feature(Dependent):
"""
Represents a predictive feature.
:Parameters:
name : str
... |
#!/usr/bin/env python
#coding:utf-8
"""
Prime square remainders
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn−1)n + (pn+1)n is divided by pn2.
For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
The least value of n for which the remainder first exceeds 109 is 7037.
Find... |
import warnings
import sys
import itertools
from ..col import search
from pytaxize.ncbi import ncbi
from pytaxize.itis import terms
from .gbif_helpers import gbif_query_for_single_name, process_gbif_response
from .format_helpers import _make_id
from .eol_helpers import (
eol_search_query_for_single_name,
proces... |
import ply.lex as lex
import ply.yacc as yacc
# Constants
SIZE = 0x10000
# Lookups
BASIC_OPCODES = {
'SET': 0x01,
'ADD': 0x02,
'SUB': 0x03,
'MUL': 0x04,
'MLI': 0x05,
'DIV': 0x06,
'DVI': 0x07,
'MOD': 0x08,
'MDI': 0x09,
'AND': 0x0a,
'BOR': 0x0b,
'XOR': 0x0c,
'SHR': 0x... |
from tkintertable import *
from helperfunctions import connect_to_db, close_connection, create_names_dict, parse_comma_separated_numbers
from helperclasses import DataTable
from ttk import Combobox, Checkbutton
from DamageRules import shell_bomb_hit
class GameWindow(Frame):
def __init__(self, parent, game_id):
... |
##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Robert McGibbon
# Contributors: Teng Lin
#
# MDTraj is free so... |
#App Toolbar
#copyright (c) 2015 Tyler Spadgenske
#MIT License
import time
import os
import pygame
from pygame.locals import *
class Toolbar():
def __init__(self, fona):
self.UPDATE_TIME = 30
self.DEAD = 30
#Setup fona
self.fona = fona
#Define colors
self.... |
"""Views for hdd-indexer
/ - homepage
/crawler [GET/POST] - crawler interactions
/loader [GET/POST] - loader interactions
/settings [POST] - settings
/setup [POST] - setup
"""
# TODO: refactor validations into separate methods
# TODO: make validation a method of class
# HDDRoot.validate(path): Tr... |
import sys
import numpy as np
import pandas as pd
from pvlib import iam, modelchain, pvsystem, temperature
from pvlib.modelchain import ModelChain
from pvlib.pvsystem import PVSystem
from pvlib.tracking import SingleAxisTracker
from pvlib.location import Location
from pvlib._deprecation import pvlibDeprecationWarning... |
# 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 ... |
import numpy as np
import pytest
from hmmlearn import hmm
from . import log_likelihood_increasing, normalized
class TestMultinomialAgainstWikipedia:
"""
Examples from Wikipedia:
- http://en.wikipedia.org/wiki/Hidden_Markov_model
- http://en.wikipedia.org/wiki/Viterbi_algorithm
"""
def setup... |
"""This module contains the general information for BiosVfCDNEnable ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfCDNEnableConsts:
VP_CDNENABLE_DISABLED = "Disabled"
VP_CDNENABLE_ENABLED = "Enabled"
_V... |
# -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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... |
# -*- coding: utf-8 -*-
from dp_tornado.engine.helper import Helper as dpHelper
class FormHelper(dpHelper):
def validate(self, controller, fields, error_res='json'):
assert error_res in ('json', 'http', 'code')
output = {}
missing_reason = 'missing'
invalid_reason = 'invalid'
... |
# Dependencies from cobra
from cobra.io.sbml import create_cobra_model_from_sbml_file, write_cobra_model_to_sbml_file
from cobra.manipulation.modify import convert_to_irreversible
from cobra import Model, Metabolite, Reaction
from cobra.io.json import load_json_model, save_json_model
# Resources
from molmass.molmass i... |
import caffe
import numpy as np
from glob import glob
import random
from PIL import Image
from os.path import normpath, basename
from scipy.misc import imresize
from ifp_morris import downsample_segmentation
class OlympicDataLayer(caffe.Layer):
im_factor = 1.0
#label_factor = 0.25
label_factor = 0.5
#... |
__author__ = 'Kondal Rao Komaragiri'
num1 = 0
num2 = 0
oper = ''
res = ''
# noinspection PyUnusedLocal
def log(context):
"""
@param context:
@type context:
"""
print ("Error Event Received.")
# noinspection PyUnusedLocal,PyUnusedLocal
def null(context):
"""
@param context:
@type co... |
import re
import uuid
from datetime import datetime
from functools import wraps
import cherrypy
import pytz
import six
from cherrypy import HTTPError
from dateutil import parser as dateparser
from pockets import unwrap
from time import mktime
from residue import UTCDateTime
from sqlalchemy import and_, func, or_
from ... |
"""Added summary table
Revision ID: 48c16211f99
Revises: 404db3c1f74
Create Date: 2016-10-08 22:36:11.305570
"""
# revision identifiers, used by Alembic.
revision = '48c16211f99'
down_revision = '2105015bafe'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic ... |
# Copyright (c) 2021 PaddlePaddle 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 applic... |
#
# Copyright (C) 2014 Red Hat, 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 wr... |
import logging
import torch
from torch.utils.data.sampler import Sampler
from mlperf_compliance import mlperf_log
from seq2seq.utils import gnmt_print
from seq2seq.utils import get_world_size, get_rank
class BucketingSampler(Sampler):
"""
Distributed data sampler supporting bucketing by sequence length.
... |
import platform
from ctypes import *
from datetime import datetime
from pysecure.constants import TIME_DATETIME_FORMAT
from pysecure.constants.sftp import SSH_FILEXFER_TYPE_REGULAR, \
SSH_FILEXFER_TYPE_DIRECTORY, \
SSH_FILEXFER_TYPE_SYMLINK, \
... |
'''Inspect Microchip's PIC objects in COFF format.
Copyright 2016 Antonio Serrano Hernandez
This file is part of picc.
picc 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
(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
In this problem set you work with another type of infobox data, audit it, clean it,
come up with a data model, insert it into a MongoDB and then run some queries against your database.
The set contains data about Arachnid class.
The data is already in the database. Bu... |
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions impor... |
try:
const(1)
except:
def const(v):
return v
SNMP_VER1 = const(0x00)
ASN1_INT = const(0x02)
ASN1_OCTSTR = const(0x04)
ASN1_OID = const(0x06)
ASN1_NULL = const(0x05)
ASN1_SEQ = const(0x30)
SNMP_GETREQUEST = const(0xa0)
SNMP_GETNEXTREQUEST = const(0xa1)
SNMP_GETRESPONSE = const(0xa2)
SNMP_... |
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2009 Bastian Kleineidam
"""
Basic rule class and routines.
"""
import re
from wc.XmlUtils import xmlquote, xmlquoteattr, xmlunquote
from . import register_rule
def compileRegex(obj, attr, fullmatch=False, flags=0):
"""
Regex-compile object attribute into <attr... |
# -*- coding: utf-8 -*-
# Copyright 2013 Jacek Mitręga
# 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... |
from ConfigParser import SafeConfigParser
import sys, os
from string import Template
import markdown2
import shutil
import glob
from dateutil.parser import parse
import calendar
def parse_config(posts_directory):
global site_title, site_subtitle, site_author, \
site_aboutme, site_info, site_syntax, \
... |
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, Extension
import os
import sys
import shutil
import gshogi.constants
assert sys.version_info >= (3,0)
VERSION = gshogi.constants.VERSION
macros = [
("HAVE_BCOPY", "1"),
("HAVE_ERRNO_H", "1"),
("HAVE_FCNTL_H", "1"),
... |
import numpy as np
from mpi4py import MPI
import matplotlib.pyplot as plt
from pySDC.helpers.stats_helper import filter_stats, sort_stats
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.implementations.collocation_classes.gauss_lobatto import CollGaussLobatto
fro... |
import numpy as np
from . import dqflags
def dynamic_mask(input_model):
#
# Return a mask model given a mask with dynamic DQ flags
# Dynamic flags define what each plane refers to using the DQ_DEF extension
dq_table = input_model.dq_def
# Get the DQ array and the flag definitions
if (dq_table ... |
#!/usr/bin/env python
#
# Copyright 2012 <+YOU OR YOUR COMPANY+>.
#
# This 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, or (at your option)
# any later version.
#
# This software is distri... |
# coding=utf-8
from mock import patch
from twitter_tunes.tests import mock_youtube_api_response as API_DATA
from apiclient.errors import HttpError, UnknownApiNameOrVersion
from httplib2 import ServerNotFoundError
from twitter_tunes.scripts import youtube_api
import pytest
TITLES_TERM = [
('Donald Trump Remix', Tru... |
#!/usr/bin/env python
import analyze_conf
import sys
import datetime, glob, job_stats, os, subprocess, time
import numpy
import scipy, scipy.stats
import argparse
import tspl, tspl_utils
def main():
parser = argparse.ArgumentParser(description='Dump CSV for a key pair for some jobs')
parser.add_argument('-k1', he... |
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC Corporation
# Copyright (C) 2015 Kevin Fox <kevin@efox.cc>
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# Copyright (C) 2016 Vedams Inc.
# Copyright (C) 2016 Google Inc.
# All Rights Reserv... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
import codecs
import copy
import json
import logging
import tempfile
import time
import uuid
from datetime import datetime
from os import getenv, makedirs, mkdir, path, remove, removedirs, rmdir
fro... |
# 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 agreed to in writing, s... |
from qtpy import QtWidgets as QW
from qtpy import QtGui as QG
from qtpy import QtCore as QC
import qwt
import numpy as np
import os.path as osp
app = QW.QApplication([])
# --- Construct custom symbol ---
path = QG.QPainterPath()
path.moveTo(0, 8)
path.lineTo(0, 5)
path.lineTo(-3, 5)
path.lineTo(0, 0)
path.lineTo(3, ... |
#!/usr/bin/env python
from sys import argv, stderr
usage = \
"""
Usage: {program} <sample rate> <A4 freq.> [octaves=8]
e.g.: {program} 64000 442.0 5
""".format(program=argv[0])
if len(argv) < 3 or len(argv) > 4 :
print(usage, file = stderr)
exit(1)
A4 = 0
sample_rate = 0
octaves = 8
try:
A4 = float(argv... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Copyright (c) 2015-2021 Erin Morelli.
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... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from config.template_middleware import TemplateResponse
from gaebusiness.business import CommandExecutionException
from gaepermission.decorator import login_not_required
from tekton import router
from gaecookie.decorator import no_csrf
fro... |
from sqlalchemy import Column, Integer, String, Enum, Text, Index, BigInteger, \
ForeignKey
from sqlalchemy.orm import relationship, backref, validates
from sqlalchemy.schema import UniqueConstraint
from inbox.sqlalchemy_ext.util import MAX_TEXT_CHARS
from inbox.models.mixins import (HasPublicID, HasEmailAddress, ... |
from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
from .utils.theano_utils import shared_zeros, shared_scalar
from six.moves import zip
def clip_norm(g, c, n):
if c > 0:
g = T.switch(T.ge(n, c), g * c / n, g)
return g
def kl_divergence(p, p_hat):
... |
# -*- coding: utf-8 -*-
# Este archivo es parte de GPLib - http://gplib.org/
#
# GPlib es software libre desarrollado en la Facultad de Filosofía y Letras de
# la Universidad de Buenos Aires y liberado bajo los términos de la licencia
# GPLIB FILO www.gplib.org/licencia bajo los términos de GPL de GNU. Usted
# puede ... |
from types_calc import *
class Lexer:
def setLine(self, line):
self.line = line + ' '
self.tokenizes = []
self.tokenNumber = ''
def tokenize(self):
for i in self.line:
Lexer.tokenizeNumber(self, i)
Lexer.tokenizeMath(self, i)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Contributor:
# sdkyoku <chiey.qs@gmail.com>
# Specially thanks:
# GoAgent Team
__version__ = '0.1.01'
import sys
import os
import time
class MyLogger(type(sys)):
CRITICAL = 50
FATAL = CRITICAL
ERROR = 40
WARNING = 30
INFO = 20
... |
# Copyright (C) 2006 CSC-Scientific Computing Ltd.
# Please see the accompanying LICENSE file for further information.
import os
import sys
import re
import distutils.util
from distutils.sysconfig import get_config_var, get_config_vars
from distutils.command.config import config
from glob import glob
from os.path imp... |
# -*- coding: utf-8 -*-
# Copyright 2014 Foxdog Studios
#
# 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 l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.