src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
"""
Bubbles Addon
Copyright (C) 2016 Viper2k4
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... |
# -*- coding: utf-8 -*-
#
# csa_example.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy
import sys, struct
from scipy.fftpack import fft, fftfreq, fftshift
def getlines(filename):
with open(filename) as fd:
return [line.strip() for line in fd.readlines()]
def replay_packets(filename):
for line in getlines(filename):
... |
'''
Created on May 9, 2014
@author: jtaghiyar
'''
import argparse
import os
parser = argparse.ArgumentParser(description='Pipeline user interface')
parser.add_argument('-b', '--job_scheduler',
default='drmaa',
choices=['sge','drmaa'],
help="job schedule... |
#coding=utf8
import pycurl
import sys
import urllib2
import gzip
import StringIO
from bs4 import *
from bmplugin import *
import re
info={'desc':"get ip list object use www.zoomeye.org for search keys",
'cve':'',
'link':"https://www.zoomeye.org/help/manual"}
zoom=None
lock=lib_TheardPool2.getlock()
def... |
# -*- coding: utf-8 -*-
import urllib, urllib2, json
#import urlresolver
import os, re
#SEP = os.sep
#thisPlugin = int(sys.argv[1])
#dialog = xbmcgui.Dialog()
#addonInfo = xbmcaddon.Addon()
#hosterList = xbmcplugin.getSetting(thisPlugin,"hosterlist").lower()
#serienOrdner = xbmcplugin.getSetting(thisPlugin, 'seriesp... |
###############################################################################
##
## Copyright (C) 2011-2014 Tavendo GmbH
##
## 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
##
## h... |
#!/usr/bin/env vpython
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Uploads a ton of stuff to isolateserver to test its handling.
Generates an histogram with the latencies to download a j... |
# -*- coding: utf-8 -*-
# #####################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
# Copyright (C) 2013 INIT Tech Co., Ltd (http://init.vn).
# This program is free software: you can redistribute it and/or... |
from __future__ import absolute_import
from logging import getLogger
Logger = getLogger('chime.error_functions')
from flask import current_app, request
from urllib import quote
from urlparse import urlparse
from os.path import join, exists
from .view_functions import get_repo, strip_index_file, path_display_type, get_... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test Build Config """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ im... |
#Boa:Frame:surat_masuk
import wx
import wx.richtext
import wx.lib.buttons
import input_administrasi_surat
def create(parent):
return surat_masuk(parent)
[wxID_SURAT_MASUK, wxID_SURAT_MASUKDARI, wxID_SURAT_MASUKDATEPICKERCTRL1,
wxID_SURAT_MASUKINPUT_KETERANGAN, wxID_SURAT_MASUKINPUT_NOMOR_SURAT,
wxID_SURAT_MA... |
#!/usr/bin/env python3
import os, sys
import apx
import argparse
def parse_lines_in_file(path):
"""
Parses text file path line by line and returns a list of names found in it.
The special character '#' can be used as a comment character and allows users to write line comments.
Comments does not affect ... |
# Initialize App Engine and import the default settings (DB backend, etc.).
# If you want to use a different backend you have to remove all occurences
# of "djangoappengine" from this file.
from djangoappengine.settings_base import *
import os
import people
# Activate django-dbindexer for the default database
DATABASE... |
# Generated from conversion.g4 by ANTLR 4.8
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7... |
# -*- encoding: utf-8 -*-
{
"name": "Pentaho Reports for OpenERP",
"description": """
Pentaho - OpenERP Report Integration by Willow IT
=================================================
This module integrates Pentaho's reporting engine with OpenERP.
This project was developed by Willow IT, using the libraries ... |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from awx.api.generics import (
LoggedLoginView,
LoggedLogoutView,
)
from awx.api.views import (
ApiRootView,
Api... |
# -*- coding: UTF-8 -*-
# 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 (t... |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: David Versmisse <david.versmisse@itaapy.com>
# Hervé Cauwelier <herve@itaapy.com>
# Romain Gauthier <romain@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software... |
# 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... |
# -*- coding: utf-8 -*-
# Copyright(C) 2014 Oleg Plakhotniuk
#
# This file is part of weboob.
#
# weboob 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 o... |
# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
# 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/LICEN... |
# -*- coding: utf-8 -*-
from PyQt4 import QtGui, QtCore
from ilastik.gui.ribbons.ilastikTabBase import IlastikTabBase, TabButton
from ilastik.gui.iconMgr import ilastikIcons
from ilastik.gui.overlaySelectionDlg import OverlaySelectionDialog
from ilastik.gui.overlayWidget import OverlayWidget
from ilastik.core.overlay... |
from ..proxy import ServerConnection, AddressPriority
KILL = 0 # const for killed requests
class ConnectionTypeChange(Exception):
"""
Gets raised if the connetion type has been changed (e.g. after HTTP/1.1 101 Switching Protocols).
It's up to the raising ProtocolHandler to specify the new conntype before... |
# Copyright 2021 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, ... |
import random
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import client, TestCase
from lib import base62
from .models import AutoSlug, Link
class ShortenerTestCase(TestCase):
"""Base TestCase for all Shortener tests"""
def setUp(self):
... |
from __future__ import print_function
import itertools
import json
import pickle
from game_tree_classes import WinnerOf
import utils
with open(utils.SWEET16_PICKLE, 'r') as fh:
SLOTS_BEFORE = pickle.load(fh)
def complete_bracket(game_slots, choice_slots, choices):
result = game_slots.copy()
for slot_i... |
import sublime, sublime_plugin
from sublime import Region
from criteria import no_need_to_change_base_chars, original_base_chars, mirrored_base_chars
from criteria import char_that_its_mirror_is_common
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
invert_lines(self.view, edit)
# replace_... |
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Lice... |
# -*- coding: utf-8 -*-
"""
picking_list_report.py
"""
from trytond.pool import PoolMeta, Pool
from trytond.transaction import Transaction
from openlabs_report_webkit import ReportWebkit
__metaclass__ = PoolMeta
__all__ = ['PickingListReport']
class ReportMixin(ReportWebkit):
"""
Mixin Class to inher... |
#####################################################################
#
# editor.py
#
# A general purpose text editor, built on top of the win32ui edit
# type, which is built on an MFC CEditView
#
#
# We now support reloading of externally modified documented
# (eg, presumably by some other process, such as so... |
#-------------------
# Abstract types
#-------------------
class OMError(Exception):
"""Root of exceptions generated by the oldman package expected HTTP ones."""
pass
class ModelGenerationError(OMError):
"""Error when generating a new model."""
pass
class OMRuntimeError(OMError):
"""Error at r... |
#!/usr/bin/env python
#coding: utf-8
# @autor: Míriam Félix Lemes da Silva
# @contato: miriamfx2@gmail.com
# @data: 08 de Abril de 2017
import get
import dbmanager
import os,sys
from os import path
from datetime import datetime
import time
def logGet(self):
date = str(time.strftime("%Y-%m-%d")) #
now = str(... |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... |
# Script is deprecated, as of September 18, 2017.
# zoneUnitCount now calculated with LoadData's _get_residential_units()
#
from pprint import pprint
import os
import sys
import requests
from collections import OrderedDict
import csv
import datetime
PYTHON_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__)... |
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from django.contrib.auth import views as auth_views
from accounts.views import groups, group_object_detail, user_groups, member_list, edit_profile, new_profile, all_members
from news.views import story_list
from pa... |
# -*- coding: utf-8 -*-
#
# Copyright © 2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
import sys
import os
import os.path as osp
from time import ... |
# builtins
import os
# third parties
import yaml
class ConfigError(Exception): pass
def get_config(path, environment):
environment = environment.upper()
with open(path) as fp:
conf = yaml.load(fp)
# either get a subconf or the whole conf
conf = conf.get(environment, conf)
conf['ENVIRONME... |
import os
# Django settings for fte project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'... |
# -*- coding: utf-8 -*-
"""
HTML Templating for the Notebook
AUTHORS:
- Bobby Moretti (2007-07-18): initial version
- Timothy Clemans and Mike Hansen (2008-10-27): major update
"""
#############################################################################
# Copyright (C) 2007 William Stein <wstein@gmail.com... |
# Copyright 2018 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... |
import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
# Provided as an attribute, so you can append to these instead
# of r... |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
import datetime
from participantCollection import ParticipantCollection
# Edit Me!
participantFileNames =... |
from __future__ import print_function
from array import array
from itertools import islice
def lcs_cut2(s1, s2, lcs_low_bound=0, bg=None, debug=False):
"""Compule the length of the LCS 2 sequences s1 and s2.
lcs_low_bound : (int), hint of lower bound for the lenght of the lcs
to search for. Default to... |
"""
Django settings for bmat project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... |
# The MIT License (MIT)
#
# Copyright (c) 2015 Noah Ollikainen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... |
# -*- coding: utf-8 -*-
# Copyright 2019 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# pylint: disable=locally-disabled, manifest-required-author
{
"name": "Employee Award",
"version": "8.0.2.0.0",
"category": "Human Re... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
filename1 = "before_light.txt"
filename2 = "during_light.txt"
filename3 = "after_light.txt"
"""
ファイルの書式は以下の通り
filename1(光判定開始前)
diffmin:0.000000
latitude:40.142240 longitude:139.987303 altitude:18.400000
acclx:0.086426 accly:-1.038574 acclz:0.257568
gyrox:0.385254 gyroy:... |
import numpy as np
import math
import wave
import struct
import time
import wave
import alsaaudio as aa
import decoder
import signal
import sys
import curses
stdscr = curses.initscr()
curses.cbreak()
curses.noecho()
curses.curs_set(0)
stdscr.keypad(1)
height = 16
def drawData(data, x, y):
for i in range(len(data... |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, fields, api
from opene... |
import random
from util import hook, http, text, database, web
import re
def api_get(kind, query):
"""Use the RESTful Google Search API"""
url = 'http://ajax.googleapis.com/ajax/services/search/%s?' \
'v=1.0&safe=off'
return http.get_json(url % kind, q=query)
@hook.command('search')
@hook.comma... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Eduardo Augusto Klosowski
#
# This file is part of Ergo Notes.
#
# Ergo Notes 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, ... |
""" Montoring and control GUI. """
import enum
import pygame # pylint: disable=import-error
__author__ = "Alexander Sowitzki"
class BaseElement:
""" An visible element inside a GUI.
:param location: Center of the element.
:type location: mauzr.gui.Vector
:param size: Size of the element.
:type... |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# 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 ... |
#!/usr/bin/env python
################################################################################
#
# Project Euler - Problem 17
#
# If the numbers 1 to 5 are written out in words: one, two, three, four, five,
# then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
#
# If all the numbers from 1 to 1000 (on... |
import settings
from django.core.management.base import NoArgsCommand
from django.contrib.auth.models import User
from compsoc.memberinfo.models import *
from compsoc.events.models import *
from datetime import date
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list
help = "Populates some si... |
import timeit
import time
from astropy.io import ascii
import pandas
import numpy as np
from astropy.table import Table, Column
from tempfile import NamedTemporaryFile
import random
import string
import matplotlib.pyplot as plt
import webbrowser
def make_table(table, size=10000, n_floats=10, n_ints=0, n_strs=0, float_... |
"""
Installation script for accelerated upgrade
"""
import codecs
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from version import get_version
import re
DESCRIPTION = 'Description'
with codecs.open('README.md', 'r', encoding='UTF-8') as readme:
LONG_DESCRIPTION ... |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009,2010, Oracle and/or its affiliates. All rights reserved.
# Use is subject to license terms. (See COPYING)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... |
import copy
from itertools import repeat
from .abc import Integrator, SIIntegrator, OperatorResult
from ._matrix_funcs import (
cf4_f1, cf4_f2, cf4_f3, cf4_f4, celi_f1, celi_f2,
leqi_f1, leqi_f2, leqi_f3, leqi_f4, rk4_f1, rk4_f4
)
__all__ = [
"PredictorIntegrator", "CECMIntegrator", "CF4Integrator",
"... |
#!/usr/bin/env python
# This script uploads a plugin package on the server
#
# Author: A. Pasotti, V. Picavet
import xmlrpclib, sys, os
import getpass
from optparse import OptionParser
# Configuration
PROTOCOL='https'
SERVER='plugins.qgis.org'
PORT='443'
ENDPOINT='/plugins/RPC2/'
VERBOSE=False
def main(options, args... |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
from pysisyphus.helpers import fit_rigid, procrustes
from pysisyphus.optimizers.BacktrackingOptimizer import BacktrackingOptimizer
# [1] Nocedal, Wright - Numerical Optimization, 2006
class BFGS(BacktrackingOptimizer):
def __init__(self,... |
from contextlib import closing
from django.contrib import auth
from django.core.management import call_command
from django.db import connection
from django.test import TestCase
import models
class ViewTestCase(TestCase):
def setUp(self):
call_command('sync_pgviews', *[], **{})
def test_views_have_... |
import datetime
from random import randint
from sqlalchemy.orm import subqueryload, subqueryload_all, aliased, contains_eager, joinedload
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import Alias, or_, asc, desc
from ecomaps.model import Dataset, Analysis, AnalysisCoverageDatasetColumn
from ecomaps.... |
from rest_framework_json_api import serializers
from accounts.models import Child, DemographicData, User
from api.serializers import (
PatchedHyperlinkedRelatedField,
UuidHyperlinkedModelSerializer,
)
from studies.models import Lab
class LabSerializer(UuidHyperlinkedModelSerializer):
resource_name = "lab... |
from django.db import models
from django.conf import settings
from django.utils.translation import get_language
from django.utils.translation import ugettext as _
from django.utils.encoding import force_unicode, smart_str, smart_unicode
from django.forms.fields import Field
from django.forms import ValidationError
from... |
from __future__ import unicode_literals
import hashlib
import json
import time
import warnings
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import (
authenticate,
get_backends,
login as django_login,
logout as django_logout,
)
f... |
# -*- coding: utf-8 -*-
from gi.repository import GObject as gobject, Gst as gst, Gtk as gtk, GdkX11, GstVideo
import platform
import logging
log = logging.getLogger(__name__)
class Player(object):
VIDEO = 0
IMAGE = 1
def __init__(self, window, url, cb_finish, cb_error, mode=VIDEO):
self.window... |
# -*- coding: utf-8 -*-
"""Task widget for pomito."""
import logging
from PyQt5 import QtCore, QtGui, QtWidgets
from pomito.plugins.ui.qt.qt_task import Ui_TaskWindow
from pomito.plugins.ui.qt.utils import get_elided_text, Worker, WorkerCompletedEvent
from pomito.task import Task
logger = logging.getLogger("pomito.p... |
"""Coregistration between different coordinate frames"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
from .externals.six.moves import configparser
import fnmatch
from glob import glob, iglob
import os
import re
import shutil
from warnings import warn
import numpy as np
from ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# score documentation build configuration file, created by
# sphinx-quickstart on Thu Sep 27 15:44:32 2018.
#
# 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
# auto... |
from chainer.functions import deformable_convolution_2d_sampler
from chainer import initializers
from chainer.initializers import constant
from chainer import link
from chainer.links.connection.convolution_2d import Convolution2D
from chainer import variable
class DeformableConvolution2D(link.Chain):
"""Two-dimen... |
# -*- coding: utf-8 -*-
#
# aimes.emanager documentation build configuration file, created by
# sphinx-quickstart on Sat Nov 29 01:32:22 2014.
#
# 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... |
from pyduel_engine.content import default_cards as cd
# from pyduel_engine.content.engine_states import Focus, Target
# ############################### RED DECKS ##################################
# Anakin Skywalker Deck
def anakin_deck():
return [cd.atk_disc(8), cd.atk_disc(8), cd.move_draw(8, 5),
... |
from pycache.client import BaseClient, CacheClient
from twisted.internet.protocol import ClientFactory
class BaseFactory(ClientFactory):
def __init__(self, command, rest, version, headers, data, response):
self.response = response
self.command = command
self.rest = rest
self.header... |
""" Cisco_IOS_XE_memory_oper
This module contains a collection of YANG definitions for
monitoring memory in a Network Element.Copyright (c) 2016\-2017 by Cisco Systems, Inc.All rights reserved.
"""
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64... |
# -*- coding: utf-8 -*-
#
# -----------------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softw... |
#!/usr/bin/python
# Copyright (C) 2010-2014 by the Free Software Foundation, Inc.
#
# This file is part of mailman.client.
#
# mailman.client 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, version 3 o... |
#!/usr/bin/env python
from datetime import datetime
from wtforms import Form, TextField, PasswordField, HiddenField, ValidationError
from wtforms import validators as v
from models import User, authenticate
class RegistrationForm( Form):
name = TextField( validators=[v.DataRequired(), v.Length(max=256)])
ema... |
# coding=utf-8
from sys import version_info
import vim
import re
from os import remove, mkdir
from shutil import move
from os.path import exists, getmtime, join, isfile, basename
from .pad import PadInfo
from .timestamps import natural_timestamp
from .collator import NotesCollator
from .vim_interface import *
from .u... |
"""
Author: Sean Strout
Author: Jon O'Brien
Description: A module for representing the skewer functionality
and graphics. It interfaces between the main program
(kebab.py) and the modules kebab_graphics.py and kebab_spot.py
"""
import kebab_graphics
import skewer_exception
import food
import kebab_spot
def c... |
# coding: utf-8
# Copyright (c) Materials Virtual Lab
# Distributed under the terms of the BSD License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import random
import numpy as np
import pandas as pd
from copy import copy
from pymatgen import Structure
class MonteCarloS... |
from Code.DataStructures.PrimeCurves import P192, P224, P256, P384
from Code.PerformanceComparison.addition import AdditionPerformanceTest
addTest192 = AdditionPerformanceTest(1000, P192)
addTest192J = AdditionPerformanceTest(1000, P192, jacobi=True)
addTest224 = AdditionPerformanceTest(1000, P224)
addTest224J = Add... |
from airflow import DAG
from airflow.operators import PythonOperator
from airflow.hooks import RedisHook
from datetime import datetime, timedelta
from airflow.models import Variable
from airflow.hooks import RedisHook
from shutil import copyfile
import logging
import traceback
from airflow.hooks import MemcacheHook
d... |
from bs4 import BeautifulSoup
import requests
import re
import sys
import os
inputs ={}
outputs = {}
ios = {}
docs = {}
def get():
if os.path.isfile("cache/docs.html"):
with open("cache/docs.html", 'r') as f:
print("Using cache", file=sys.stderr)
return f.read()
r = requests.get("http://docs.nvidia.com/deep... |
## MmmmTools - Usability Improvements For Maya
## Copyright (C) <2008> Joseph Crawford
##
## This file is part of MmmmTools.
##
## MmmmTools 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 ... |
import time
import test.base
from models import User, Sharedfile, Sourcefile, Conversation, Comment
class AdminUserFlagNSFWTests(test.base.BaseAsyncTestCase):
def setUp(self):
super(AdminUserFlagNSFWTests, self).setUp()
self.admin = User(name='admin', email='admin@example.com', email_confirmed=1)
... |
##############################################################################
#copyright 2012, Hamid MEDJAHED & Elyes ZEKRI (hmedjahed@prologue.fr) #
# Prologue #
#Licensed under the Apache License, Version 2.0 (the "License"); #
#yo... |
# 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 ... |
from bitmovin.utils import Serializable
from bitmovin.resources.enums import S3SignatureVersion
from . import AbstractOutput
class GenericS3Output(AbstractOutput, Serializable):
def __init__(self, access_key, secret_key, bucket_name, host, port=None, signature_version=None, ssl=None, id_=None, custom_data=None,
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Snap! extension to support Raspberry Pi -- server component.
Copyright (C) 2014 Paul C. Brown <p_brown@gmx.com>.
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 F... |
import re
import time
import pushb
import cPickle
import hashlib
import sendmail
from functools import wraps
class Dict(dict):
"""Represent dictionary items as object attributes."""
def filter(self, *args):
return Dict((k, v) for k, v in self.items() if k in args)
def __getattr__(self, name):
... |
import json
import unittest
import re
import sys
from subprocess import PIPE, Popen
class pipetest(unittest.TestCase):
def test_pipe_abi_pipe(self):
sub = Popen(["/usr/bin/env", "python", "src/pipe_abi.py", "pipe"],
stdin=PIPE, stdout=PIPE, stderr=sys.stderr,
close... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from frappe.desk.doctype.auto_repeat.auto_repeat import get_auto_re... |
"""Manipulate a TM1637 7-segment display."""
import math
import threading
from time import localtime, sleep
from . import config as cg
from .context import IO
IO.setwarnings(False)
IO.setmode(IO.BCM)
HexDigits = [0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d,
0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, ... |
import pytest
# TODO: Create fixture where image is create
@pytest.fixture(scope="function")
def remove_item(remote, token):
"""
Remove an item with the given name.
:param token: The fixture to have the token for authenticated strings available.
:param remote: The fixture to have the base xmlrpc con... |
# -*- coding: utf-8 -*-
import argparse
import logging
import sys
from textwrap import dedent
from shovel import shovel
class Shovel(object):
def __init__(self):
parser = argparse.ArgumentParser(
description='High level library for storing and retrieving datasets from cloud stores',
... |
# Lint as: python3
"""A sensor prototype class.
The concept is explained in: go/minitaur-gym-redesign-1.1
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from typing import Any, Iterable, Optional, Sequence, Text, Tuple, Union
import gin
import gym
im... |
from freezegun import freeze_time
from rest_framework import test
from waldur_mastermind.common.mixins import UnitPriceMixin
from waldur_mastermind.invoices import models as invoices_models
from waldur_mastermind.marketplace.tests import factories as marketplace_factories
from waldur_mastermind.marketplace_vmware impo... |
#!/usr/bin/env python3
#
# Import script of NIST CWE Common Weakness Enumeration.
#
# Until now, the import is only import Weakness description.
#
# The format is the following:
#
# { "_id" : ObjectId("52b70521b261026f36818515"), "weaknessabs" : "Variant",
# "name" : "ASP.NET Misconfiguration: Missing Custom Error Page... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.