src stringlengths 721 1.04M |
|---|
#
# Title : Data munging(AKA cleaning) the Titanic Data
# Author : Felan Carlo Garcia
#
# Notes:
# -- Code is based on the Kaggle Python Tutorial
# -- data cleaning prior to implementing a machine learning algorithm.
import numpy as np
import pandas as pd
def processdata(filename, outputname):
df = pd.read... |
# -*- coding: utf-8 -*-
import concurrent
import logging
import uuid
from collections import OrderedDict
from concurrent.futures.process import ProcessPoolExecutor
from concurrent.futures.thread import ThreadPoolExecutor
from copy import deepcopy
from multiprocessing import cpu_count
from typing import (
TYPE_CHECK... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
_user_model = None
try:
from django.utils.module_loading import import_string
except ImportError:
from django.utils.module_loading import import_by_path as import_string # noqa
def get_user_mod... |
# Copyright 2017 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.
from PB.go.chromium.org.luci.buildbucket.proto import build as build_pb2
DEPS = [
'buildbucket',
'properties',
'runtime',
]
def RunSteps(... |
#!/usr/bin/env python
# Python module for photometric calibration.
# It needs the Python modules ppgplot and
# mpfit to be installed.
# 03.03.2005 Fixed a serious bug in the rejection loop. Instead
# of using the remaining points we always used all points
# and rejected points until the original... |
#!/usr/bin/env python
# coding: utf-8
from time import time
import random
class Traindata():
"""docstring for Traindata"""
posi = []
nega = []
cv = []
k = 3
def __init__(self):
pass
def load_intm(self, filename, isPosi):
startTime = time()
dataset = self.posi if isPosi else self.nega
state = 'Positiv... |
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import re
import struct
from os import remove
from os.path import isdir, isfile, join
from shutil import rmtree
from time import time
import click
from platformio import __version__, app, telemetry
from platformio.commands.install import cli a... |
# Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# coding=utf-8
from wraptor.decorators import throttle
from config import config
from items import get_item, get_item_kind_from_item, refresh_item
Activity = None
try:
from plex_activity import Activity
except ImportError:
pass
class PlexActivityManager(object):
def start(self):
activity_sources_... |
#!/usr/bin/env python
__author__ = 'PSM'
__version__ = "1.0.0"
import os
from bottle import auth_basic, route, run, response, request, abort
import psycopg2
import json
postgres_host = os.environ['APP_DB_HOST']
postgres_port = os.environ['APP_DB_PORT']
postgres_database = os.environ['APP_DB_DATABASE']
p... |
"""Create random dog names"""
import random
from functools import reduce
from dog_list import DOGS
def word_iter(words):
"""iterate on words"""
word = []
for char in words:
if char in ' \n\t':
if word:
yield ''.join(word)
word = []
else:
... |
from __future__ import print_function, division, absolute_import
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
import subprocess
from astropy.io import fits
from astropy import time
import DataStructures
from ._utils import combine_orders, read_grid_points, ensure_dir
from .analyzer import ... |
# import transaction
# import datetime
from pyramid.httpexceptions import HTTPFound
# from pyramid.renderers import get_renderer
from ..models import (
StoredQuery,
)
# import json
from ..lib import joins
from .. import config
def alter_query_type(request):
request.do_not_log = True
query_id = in... |
from importlib import _bootstrap
from importlib import machinery
from .. import util
from . import util as import_util
from contextlib import nested
import imp
import os
import sys
from test import support
from types import MethodType
import unittest
class FinderTests(unittest.TestCase):
"""Tests for PathFinder.... |
# -*- coding: utf-8 -*-
from django import dispatch
from django.contrib.sites.models import Site
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from threebot.models imp... |
import xml.etree.ElementTree as ET
import re
import time
import os, csv
from nltk.tokenize import sent_tokenize
from textblob.classifiers import NaiveBayesClassifier
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
stop_words = set(stopwords.words('english'... |
#!/usr/bin/env python
# Copyright (c) 2006
# Colin Dewey (University of Wisconsin-Madison)
# cdewey@biostat.wisc.edu
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Li... |
"""Couchbase CLI progress bar utilities"""
import platform
import struct
import sys
import time
if platform.system() == "Windows":
import ctypes
from ctypes import c_long, c_ulong
g_handle = ctypes.windll.kernel32.GetStdHandle(c_long(-11))
def get_terminal_width():
"""Get windows terminal siz... |
import csv
import time
fieldnames = ['class', 'knn_hst', 'hst_pxl', 'mlp_hst', 'mlp_pxl', 'svm_hst', 'svm_pxl', 'ensemble_hst', 'ensemble_pxl', 'ensemble_all']
writer = None
file = 'results_' + str(time.ctime()) +'.csv'
def initializate(fname=file):
global writer
global file
file = fname
with open(fname, 'w') as... |
# Import system modules
import sys, os
import Helper
import regression
import arcpy
from arcpy import env
from arcpy.sa import *
hp = Helper.Helper(sys.argv)
try:
# Local variables
Rural_1yrQ = Raster(os.path.join(hp.Workspace + "\\WIPoutput.mdb", "UndevQ"))
BMPpts = os.path.join(hp.SWorkspace, "BMPp... |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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... |
#!/usr/bin/env python
#
# Copyright (C) 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from datetime import datetime
from mcrouter.test.MCProcess import Memcached
from mcrouter.test.McrouterTestCase import... |
class Vertex:
def __init__(self, n):
self.name = n
self.neighbors = list()
self.discovery = 0
self.finish = 0
self.color = 'black'
def add_neighbor(self, v):
if v not in self.neighbors:
self.neighbors.append(v)
self.neighbors.sort()
cla... |
# -*- coding: utf-8 -*-
#
# DBoilerplate documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 12 10:04: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.
... |
import datetime
import flask
from flask.ext.mongoengine import MongoEngine
from tests import FlaskMongoEngineTestCase
class BasicAppTestCase(FlaskMongoEngineTestCase):
def setUp(self):
super(BasicAppTestCase, self).setUp()
db = MongoEngine()
class Todo(db.Document):
title = ... |
from django import template
from django.conf import settings
from django_jsx.template.backend import JsTemplate
from django_jsx.template.loaders import JsLoader
register = template.Library()
loader = JsLoader(engine=None)
class JsMissingTemplateDirException(Exception):
pass
def _get_template_dirs():
for t ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''Produce a custom twist drill plot'''
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
# set some rcParams
mpl.rcParams['font.weight'] = 'bold'
mpl.rcParams['xtick.major.pad'] = 10
mpl.rcParams['xtick.direction'] =... |
#!/usr/bin/python2.4
#
# Unit tests for Mox.
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
"""This renderer class renders volume properties into a separate
drawing area next to the main volume rendering drawing area.
"""
import sys
import math
import operator
import types
import select
import signal
import gobject
import pango
import string
import os
from lvmui_constants import *
import stat
import gett... |
#On the name of ALLAH and may the blessing and peace of Allah
#be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam.
#Author : Fouad Teniou
#Date : 06/07/10
#version :2.6
"""
maclaurin_expenantial is a function to compute e^x using maclaurin series
and the interval of convergence is -inf < x < + inf
e... |
import sys
from PyQt5.QtWidgets import QApplication, QMessageBox, QSystemTrayIcon
from osfoffline import utils
from osfoffline.application.main import OSFApp
from osfoffline.database_manager.db import drop_db
def running_warning():
warn_app = QApplication(sys.argv)
QMessageBox.information(
None,
... |
from docutils.parsers.rst import Directive, nodes
from docutils.utils import new_document
from recommonmark.parser import CommonMarkParser
import importlib
import textwrap
class WPTLintRules(Directive):
"""A docutils directive to generate documentation for the
web-platform-test-test's linting tool from its sou... |
#!/usr/bin/python
# Filename: paste
# Purpose: XmlRpc interface client to paste.debian.net
# Author: Copyright (C) 2007-2011 Michael Gebetsroither <michael@mgeb.org>
# License: This file is licensed under the GPL v2+. Full license text in LICENSE
# Modified original: No modificat... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
#from distutils.core import setup
from distutils.extension import Extension
from distutils.command.build_ext import build_ext
from distutils.command.sdist import sdist
import hashlib
import io
from pkg_r... |
# -*- coding: UTF-8 -*-
#! python3
"""
Isogeo API v1 - API Routes to retrieve CoordinateSystems
See: http://help.isogeo.com/api/complete/index.html
"""
# #############################################################################
# ########## Libraries #############
# ##################################
# ... |
"""Provides device automations for Arcam FMJ Receiver control."""
from typing import List
import voluptuous as vol
from homeassistant.components.automation import AutomationActionType
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import (
ATTR_ENTITY_ID,
C... |
from twisted.internet import reactor
from autobahn.wamp1 import protocol as wamp
from autobahn.twisted.websocket import listenWS
from pubsubclub import (
ConsumerMixin, ProducerMixin, ConsumerServer, ProducerClient, consul,
)
class WampServerProtocol(wamp.WampServerProtocol):
def onSessionOpen(self):
... |
#! /usr/bin/env python
# Copyright (C) 2015 by Andrea Calzavacca <paranoid.nemo@gmail.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 Foundation; either version 2 of the License, or
# (at ... |
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be usefu... |
# Copyright 2021 The TensorFlow 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 applica... |
from datetime import date, timedelta
from mock import call, patch, Mock
from django.conf import settings
from django.test import TestCase
from ..models import R
from .. import utils
class TestUtils(TestCase):
"""Tests for functions in ``redis_metrics.utils``."""
def setUp(self):
self.old_host = get... |
"""A script to test if the parentheticals of a string are matched."""
class Queue(object):
"""A singly linked list, to hold parens."""
def __init__(self):
"""Initialize a Queue class."""
self.head = None
self.length = 0
# def enqueue(self, data):
# """Add a value to the q... |
'''app.tests.main.test_leaderboard'''
import logging, unittest, json
from flask import g
from app.tests.__init__ import *
from app import get_keys
from app.main import leaderboard
from logging import getLogger
log = getLogger(__name__)
class LeaderboardTests(unittest.TestCase):
def setUp(self):
init(self)
... |
# Copyright 2016, Cossack Labs Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
## raw input basics!
## see also: https://github.com/codelikeagirlcny/python-lessons-cny/blob/master/code-exercises-etc/_raw_input.py
# name = raw_input("what is your name? ")
# print name
# User, tell me one DC address.
# I save that address as "address_1"
# I evaluate address_1 and add it to the appropriate "list_of... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2019-07-12 18:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('manutencao', '0004_fo2_man_unidade_tempo_loaddata'),
]
... |
# Smoke tests for viewing a candidate's page
from datetime import date, timedelta
import re
from django.conf import settings
from django.test.utils import override_settings
from django_webtest import WebTest
from .factories import (
AreaTypeFactory, ElectionFactory, CandidacyExtraFactory,
ParliamentaryChambe... |
import argparse
import contextlib
import functools
import inspect
import time
ANSI_ESCAPE_CODE_RED = "\x1b[1;31m"
ANSI_ESCAPE_CODE_YELLOW = "\x1b[1;33m"
ANSI_ESCAPE_CODE_RESET = "\x1b[1;0m"
class CommandFailedException(Exception):
def __init__(self, message, hint):
super().__init__(message)
self... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlite3
import xml.etree.ElementTree as ETree
import re
import random
import zipfile
import os
import atexit
from math import sqrt
from collections import OrderedDict
class Savegame:
def __init__(self):
self.filename = ""
self.temp_extracted_file = ... |
#
# 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 "License"); you may not us... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Besetzung',
fields=[
('id', models.AutoField(ve... |
import urllib
import json
from decimal import Decimal
from django.db import models
class Marker(models.Model):
"""
Abstract model that provides geocoding for models with address.
"""
address = models.CharField(max_length=200, blank=True,
help_text="Separate address item... |
#
# synctool.main.config.py WJ109
#
# synctool Copyright 2015 Walter de Jong <walter@heiho.net>
#
# synctool COMES WITH NO WARRANTY. synctool IS FREE SOFTWARE.
# synctool is distributed under terms described in the GNU General Public
# License.
#
'''show elements of the synctool.conf file
This program is nic... |
import sys
from steel import base, fields
__all__ = ['Structure']
class Structure(base.Structure):
def __init__(self, *args, **kwargs):
super(Structure, self).__init__(*args, **kwargs)
self._bits_left = 0
self._bit_buffer = 0
def read(self, size=None):
bit_buff... |
from collections import deque
from . import commands, exceptions
from .strings import to_bytes, to_unicode
from .utils import LINEFEED
ACTION_START = b'\1ACTION '
ACTION_END = b'\1'
MAX_LENGTH = 512 # The largest legal size of an IRC command.
class ReceivedMessage(bytes):
"""A message recieved from the IRC ne... |
from flask import request, g, jsonify
from flask_cors import cross_origin
from alerta.app.auth.utils import permission
from alerta.app.models.alert import Alert
from alerta.app.utils.api import process_alert, add_remote_ip
from alerta.app.exceptions import ApiError, RejectException
from . import webhooks
# {
# ... |
# Copyright 2011, VMware, Inc., 2014 A10 Networks
# 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
#
# ... |
from application import Application
from error_checker import ErrorChecker
from errors import InvalidDateException
import add_person
class RecordViolation(Application):
def start_application(self, c):
self.cursor = c
self.list_of_inputs = [ None for i in range(8) ]
self.get_violation_no(0... |
from microbit import *
import random
from math import ceil
MAX_COLS = 5
PAUSE = 500
def init():
global blocks, wait, player, old_player, jump_counter, start, counter, lives, jump_held, jump_amount, jump_maxed, PAUSE
blocks = []
wait = 0
player = [1, 4]
old_player = None
jump_counter = 0
s... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ExpirationBox.ui'
#
# Created by: PyQt5 UI code generator 5.7.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ExpirationBox(object):
def setupUi(self, ExpirationBox):
... |
#!/usr/bin/env python
# 2014-07-11 DHT22.py
import time
import atexit
import pigpio
import smbus
import subprocess
import os
import signal
import RPi.GPIO as GPIO
import psutil
import json
import socket
import math
import datetime
import urllib2
class i2c_device:
def __init__(self, addr, port=1):
self.a... |
AR = ['/usr/bin/ar']
ARFLAGS = ['rcs']
BINDIR = '/usr/local/bin'
CC = ['/usr/bin/gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CC_VERSION = ('4', '8', '4')
CFLAGS = ['-I/home/cypher-thor/nicks/audio-programming/Minaton', '-DNDEBUG', '-fshow-column', '-std=c99']
CFLAGS... |
import requests_mock
from django.utils import timezone
from django.test.utils import override_settings
from bulbs.content.models import FeatureType, Content
from bulbs.utils.test import BaseIndexableTestCase
from bulbs.utils.test.mock_vault import mock_vault
from example.testcontent.models import TestContentObjThree... |
# coding=utf-8
# Copyright 2021 The Meta-Dataset Authors.
#
# 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 ... |
# coding: utf-8
# # The best model parameters are given by
# ```
# author : SHAMINDRA
# data_source_dir : SC_shuffle
# test_type : validation
# model_type : RF
# RF:
# n_estimators : 100
# criterion : 'gini'
# max_features : 'auto'
# max_depth : 20
# n_jobs : 1
# SVM:
# kernel : 'rbf'
# de... |
# -*- coding: utf-8 -*-
from datetime import datetime as dt
import numpy as np
import pandas as pd
import pytest
import six
from mock import patch, call, Mock
from numpy.testing.utils import assert_array_equal
from pandas import DatetimeIndex
from pandas.util.testing import assert_frame_equal
from pymongo import ReadP... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import numpy as np
from distutils.extension import Extension
def readme():
with open('README.md') as f:
return f.read()
setup(name='pidpy',
version='0.1',
description='Partial Information Decompo... |
''' 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, software
di... |
#!/usr/bin/python
#$Id: MessageSnooper.py,v 1.2 2005/10/27 02:23:37 kaminw Exp $
# "Copyright (c) 2000-2003 The Regents of the University of California.
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose, without fee, and without written a... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from ..security import PortalServerSecurityHandler
from ..manageags import AGSAdministration
from ..hostedservice import Services
from ..common.general import local_time_to_online
from .._abstract.abstract impo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ast import literal_eval
from django.db import models
from django.conf import settings
class Board(models.Model):
name = models.CharField(max_length=100)
webhook_activate = models.BooleanField(default=False)
trello_board_id = models.Cha... |
'''
Created on 14.03.2016
@author: mkennert
'''
from kivy.properties import NumericProperty
from kivy.uix.gridlayout import GridLayout
from crossSectionView.aview import AView
from ownComponents.design import Design
from ownComponents.ownGraph import OwnGraph
from plot.dashedLine import DashedLine
from ... |
#!/usr/bin/env python
import io
import os
import mozunit
import proctest
from mozprocess import processhandler
here = os.path.dirname(os.path.abspath(__file__))
class ProcTestOutput(proctest.ProcTest):
""" Class to test operations related to output handling """
def test_process_output_nonewline(self):
... |
#!/usr/bin/python
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.cli import CLI
from mininet.node import OVSSwitch, CPULimitedHost
from mininet.node import Controller, RemoteController
from mininet.link import TCLink
import os
import signa... |
import inspect
import itertools
import json
import operator
import os
OPERATORS = {
'<': operator.lt,
'<=': operator.le,
'==': operator.eq,
'!=': operator.ne,
'>=': operator.ge,
'>': operator.gt,
'in': operator.contains,
'nin': lambda x, y: not operator.contains(x, y),
}
def can_take_... |
#!/usr/bin/env python
# Copyright 2015 Stanford 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
#
# Unless required by applicabl... |
# -*- Mode: Python; test-case-name: flumotion.test.test_wizard_models -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License v... |
#!/usr/bin/env python
from math import *
import thread
import random
import time
import pygtk
pygtk.require("2.0")
import gtk
import gtk.glade
import commands
import matplotlib.pyplot
class rodent:
def __init__(self):
self.time_from_last_childbirth=0
class felix:
def __init__(self):
self.size=0
self.is_virgin... |
#!/usr/bin/env python3
'''
This script will generate the lines for a new types file with the iterative poses generated from counterexample_generation_jobs.py
!!WARNING!!
Part of this process is to determine which newly generated poses are NOT REDUNDANT with the previously generated ones.
This requires an O(n^2) calcu... |
# Copyright 2015 John Reese
# Licensed under the MIT license
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import sys
if sys.version_info[0] != 2:
basestring = str
class Processor:
"""
Framework for allowing modules to modify the in... |
# A non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape.
# Any integer P, such that 0 < P < N, splits this tape into two non-empty parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1].
# The difference between the two parts is the value of: |(A[0] + A[1... |
from snovault import upgrade_step
from pyramid.traversal import find_root
from datetime import datetime, time
@upgrade_step('file', '', '2')
def file_0_2(value, system):
# http://redmine.encodedcc.org/issues/1295
# http://redmine.encodedcc.org/issues/1307
if 'status' in value:
value['status'] = va... |
# 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
# "License"); you may ... |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QAbstractScrollArea import QAbstractScrollArea
class QAbstractItemView(QAbstractScrollArea):
""" QAbstractI... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Verification'
db.create_table(u'compendia_verification', ... |
import os
from zeus.config import ConfigManager
from zeus.common import FabricManager
from zeus.common import PasswordManager
from zeus.configmanagement import ConfigEditor
from zeus.ubuntu import RepoManager
from zeus.services import ServiceControl
from fabric.api import parallel, roles, run, env
metadata = Config... |
import importlib
from .base import BaseTransport
from ..service import Service
class LocalTransport(BaseTransport):
def __init__(self):
super(LocalTransport, self).__init__()
self.__service = None
def __repr__(self):
return self.__class__.__name__
def configure(self, service_na... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.option.ra... |
#!/usr/bin/python3
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it w... |
# 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 cv2
class Simulator:
def __init__(self,reward,screen_size=64,state_space=10):
self.number_of_actions = 3
self.screen_size=screen_size
self.state_space=state_space
self.reset(reward)
def do_action(self,action,side="right",simple_AI=False):
if si... |
"""Support for local control of entities by emulating a Philips Hue bridge."""
import logging
from aiohttp import web
import voluptuous as vol
from homeassistant import util
from homeassistant.components.http import real_ip
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homea... |
import git_pre_commit_hook_utils as utils
import scripttest
import os
import copy
def test_git_mode():
m = utils.GitMode('120000')
assert m.is_symlink()
assert not m.is_gitlink()
def test_with_empty_repo(tmpdir):
os_environ = copy.deepcopy(os.environ)
os_environ['GIT_DIR'] = str(tmpdir) + '/.git... |
#! /usr/bin/env python
# -*- coding:Utf8 -*-
## Cette variante utilise une liste de listes ##
## (que l'on pourrait aisément remplacer par deux listes distinctes)
# La liste ci-dessous contient deux éléments qui sont eux-mêmes des listes.
# l'élément 0 contient les nombres de jours de chaque mois, tandis que
# l'élém... |
# Copyright 2017 - Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
from setuptools import setup, find_packages
with open("README.rst", "r") as fh:
long_description = fh.read()
# Get the version.
version = {}
with open("pastas/version.py") as fp:
exec(fp.read(), version)
setup(
name='pastas',
version=version['__version__'],
description='Python package to perform ... |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.