src stringlengths 721 1.04M |
|---|
# stdlib
import logging
import traceback
# grid relative
from ....utils.executor import executor
def run_task_once(name, func, *args):
future = executor.futures._futures.get(name)
logging.info("future: %s" % str(future))
logging.info("futures count: %d" % len(executor.futures._futures))
# prevent run... |
from django.core.exceptions import ValidationError
from django.test import TestCase
from circuits.models import *
from dcim.choices import *
from dcim.models import *
from tenancy.models import Tenant
class RackGroupTestCase(TestCase):
def test_change_rackgroup_site(self):
"""
Check that all chi... |
from ..SocketInterface import serversocket
from ..MPLogger import loggingclient
import plyvel
import pyhash
import zlib
import time
import os
def LevelDBAggregator(manager_params, status_queue, batch_size=100):
"""
Receives <key, value> pairs from other processes and writes them to the central database.
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-28 13:17
from __future__ import unicode_literals
from django.db import migrations
import ideascube.models
class Migration(migrations.Migration):
dependencies = [
('mediacenter', '0008_auto_20160713_1605'),
]
operations = [
m... |
# datatasks\sources\DatabaseSource.py
import os
from collections import OrderedDict
from datatasks.db.DatabaseFactory import DatabaseFactory
from datatasks.utils import convert_to_primary_datatypes
from .DataSource import DataSource
class DatabaseSource(DataSource):
"""
Inherits RecordList and is capable of... |
# -*- coding: utf-8 -*-
#
# Test links:
# http://d-h.st/users/shine/?fld_id=37263#files
import re
import urlparse
from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class DevhostStFolder(SimpleCrypter):
__name__ = "DevhostStFolder"
__type__ = "crypter"
__version__ = "0... |
# Copyright 2008 Ealdwulf Wuffinga
# This file is part of BBChop.
#
# BBChop 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 ... |
import json
from django.http import HttpResponse
from django.shortcuts import render,Http404,HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
from .models import Notifications
# Create your views here.
@login_required
def all(request):
obje... |
#!/usr/bin/env python
import curses
import os
import random
import time
import unicornhathd
CONTROLS = {
ord('w'): 'up',
ord('s'): 'down',
ord('a'): 'left',
ord('d'): 'right',
curses.KEY_UP: 'up',
curses.KEY_DOWN: 'down',
curses.KEY_LEFT: 'left',
curses.KEY_RIGHT: 'right'
}
class Sn... |
# -*- coding: utf-8 -*-
#
# TicTacToe-GE documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 19 23:45:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... |
# ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... |
import sys
class facTable():
def get(self, sieve_range):
table = [{} for _ in range(sieve_range + 1)]
for i in range(2, sieve_range + 1):
if not table[i]:
for j in range(i, sieve_range + 1, i):
table[j][i] = 1
prime_power = i ** 2
... |
from config.api2_0_config import config
from config.amqp import *
from modules.logger import Log
from modules.amqp import AMQPWorker
from modules.worker import WorkerThread, WorkerTasks
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0 import rest
from datetime import datetime
from proboscis.asserts import a... |
# coding=utf-8
from setproctitle import setproctitle
from utils import SensorConsumerBase
import datetime
import os
import sys
import json
class Oven(SensorConsumerBase):
def __init__(self, redis_host, redis_port):
SensorConsumerBase.__init__(self, redis_host=redis_host, redis_port=redis_port)
s... |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... |
#!/usr/bin/python
#
# [Program]
#
# CUPP 3.1
# Common User Passwords Profiler
#
#
#
# [Author]
#
# Muris Kurgas aka j0rgan
# j0rgan [at] remote-exploit [dot] org
# http://www.remote-exploit.org
# http://www.azuzi.me
#
#
#
# [License]
#
# This program is free software; you can redistribute it and/or modify
# ... |
# Copyright (C) 2016-2017 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... |
"""
purpose:
loads the database table "availableSoilTableJoins", cmp table if selected and slc shapefile
notes:
- loads "permittedOperations" table into qgis toc. becomes drop down in processing framework for next script. will allows user to specific what tables
they wish to use and if a join operation is required
- l... |
#!/usr/bin/python
from urlparse import urlparse
import requests
import json
import math
import re
domain = ''
domain_arr = []
path=''
path_arr = []
starts_with_http = re.compile('^http')
j = {}
tlds = []
file_name = 'angler_domains.txt'
def bigrams(input_list):
return zip(input_list, input_list[1:])
def probabilit... |
__author__ = 'zeph'
__hbase__ = "localhost"
__createtable__ = 'create'
__valuestable__ = 'values'
__compressed_nohistory__ = dict(
max_versions=1,
compression="gz", # FIXME https://github.com/twitter/hadoop-lzo/issues/56
)
import happybase
import time
import os
from datetime import datetime
from sqlhbase.popu... |
from collections import OrderedDict
from rest_framework import serializers
from rest_framework.fields import SkipField
from django.contrib.auth.models import User
import models
import field
import json
class ElementSerializer(serializers.ModelSerializer):
choices = field.ArrayAsStringField(required=False)
ans... |
# -*- coding: utf-8 -*-
"""
Classe for reading/writing SpikeTrains in a text file.
It is the simple case where different spiketrains are written line by line.
Supported : Read/Write
Author: sgarcia
"""
import os
import numpy as np
import quantities as pq
from neo.io.baseio import BaseIO
from neo.core import Segm... |
# -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... |
from flask import Blueprint, redirect, render_template, session, flash, url_for
from sqlalchemy import asc
from datetime import datetime
from ..forms.members import MemberForm
from ..forms.pages import DelPageForm, PageForm
from ..models.content import Content
from ..models.members import Members, Groups
from ..auth im... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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 o... |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hpe.com>
#
# 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/lic... |
import unittest
import json
import flask
from panoptes_aggregation import extractors
from panoptes_aggregation.extractors.test_utils import annotation_by_task
classification = {
'annotations': [{
'task': 'T0',
'value': [
{
'choice': 'AGOUTI',
'answers': {... |
from wpilib.command import CommandGroup
from wpilib.command import Command
# portcullis groups -------------------------------------------------
# A command group requires all of the subsystems that each member requires.
k_timeOut = 2
class MoveUp(CommandGroup):
def __init__(self, robot, name=None):
supe... |
'''
NeuroLearn datasets
===================
functions to help download datasets
'''
## Notes:
# Need to figure out how to speed up loading and resampling of data
__all__ = ['download_nifti',
'get_collection_image_metadata',
'download_collection',
'fetch_emotion_ratings',
'fetch_pain']
__author__ = ["Luk... |
#!/usr/bin/env python
from datasets import cp
from datasets import variables
from datasets import Camera
def loaddataset():
setglobalvariables()
loadcameras()
return getcameras(), loadconfiguration()
def setglobalvariables():
variables.current_dataset_path = variables.datasets_path + '/pets09'
... |
#! /usr/bin/python
# coding=UTF-8
# Denyhosts managements script v. 0.4a
# Works only with ipv4 addresses.
# You can search and remove IP addresses from denyhosts ban.
#
# NOTE! You should test the script first without real "TargetPaths".
# If you use other system than Debian then paths might be completely different.
... |
# Copyright (c) 2010 Brian Gordon
#
# 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, modify, merge, publish, distri... |
# -*- coding: utf-8 -*-
#! /usr/bin/env python
import os
import sys
network = 'irc.freenode.net'
port = 8001
nick = 'phe-log-bot' ## Change this, of course.
channels = ['#wikisource-fr'] # LOWERCASE ONLY
name = 'IRC Log Bot - http://code.google.com/p/pyirclogs/'
fd = open(os.path.expanduser('~/password/password-ircb... |
import os
import shutil
import sys
from pathlib import Path
from typing import List
import pytest
from _pytest.config import ExitCode
from _pytest.monkeypatch import MonkeyPatch
from _pytest.pytester import Pytester
from _pytest.tmpdir import TempPathFactory
pytest_plugins = ("pytester",)
class TestNewAPI:
def ... |
#
# Copyright (C) 2004, 2005 Red Hat, Inc.
# Author: Phil Knirsch, Thomas Woerner, Florian La Roche
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is d... |
# Copyright (C) 2014 ABRT Team
# Copyright (C) 2014 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... |
"""
Main ChemKED module
"""
# Standard libraries
from os.path import exists
from collections import namedtuple
from warnings import warn
from copy import deepcopy
import xml.etree.ElementTree as etree
import xml.dom.minidom as minidom
from itertools import chain
import numpy as np
# Local imports
from .validation imp... |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PySCAP is ... |
import collections
from itertools import dropwhile
import logging
from .plugin import SimStatePlugin
from ..errors import AngrError, SimEmptyCallStackError
l = logging.getLogger("angr.state_plugins.callstack")
class CallStack(SimStatePlugin):
"""
Stores the address of the function you're in and the value of... |
<<<<<<< HEAD
from django.conf import settings
from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.core import checks
from django.db import models
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps
from .m... |
"""
Extension that interacts with roguehostapd to print relevant information. For example,
information regarding automatic association attacks.
"""
from collections import defaultdict
import wifiphisher.common.constants as constants
class Roguehostapdinfo(object):
"""
Handles for printing KARMA attack infor... |
# 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)
import os
import xml... |
import MySQLdb, MySQLdb.cursors
import sqlalchemy.ext.serializer
import cPickle as pickle
from datetime import timedelta
from utilities import distance
from collections import defaultdict
import argparse
parser = argparse.ArgumentParser(description='Output db')
parser.add_argument('--csv', action='store_true', default... |
#!/bin/python
'''
fluxCal.py
Created by Seth Meeker on 11-21-2012
Modified on 02-16-2015 to perform absolute fluxCal with point sources
Opens ARCONS observation of a spectrophotometric standard star and
associated wavelength cal file, reads in all photons and converts to energies.
Bins photons to generate a spectru... |
#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 20.08.2017 16:01
:Licence MIT
Part of grammpy
"""
from unittest import TestCase, main
from grammpy import *
from grammpy.parsers import cyk
from grammpy.transforms import ContextFree, InverseContextFree
class S(Nonterminal): pass
class A(Nonterminal): pass
c... |
# Given a list of positive integers S = [s_i] and a positive integer t
# find if t can be written as the sum of a subset of elements of S
import numpy as np
def is_sum(t, S):
# is it np hard ?
# O(n**2 t)
# brute force 2**n
S = list(filter(lambda x:x>0, S))
n = len(S)
m = np.zeros((n, t), dtyp... |
"""charlex URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... |
#!/usr/bin/python
# $Id:$
'''In order to use the new features of OpenGL 3, you must explicitly create
an OpenGL 3 context. You can do this by supplying the `major_version` and
`minor_version` attributes for a GL Config.
This example creates an OpenGL 3 context, prints the version string to stdout,
and exits.... |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http://... |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... |
import datetime
import urlparse
from django.utils.encoding import smart_str
import jinja2
import waffle
from jingo import register
from tower import ugettext as _, ugettext_lazy as _lazy
from access import acl
from amo.helpers import impala_breadcrumbs
from amo.urlresolvers import reverse
from mkt.developers.helpe... |
import sys as _sys
import numpy as _np
from .dynqt import QtGui as _qt
from .dynqt import qt as _qt_driver
if _qt_driver.name() == 'PythonQt':
from .qimageview import QImage2ndarray as _temp
_qimageview = _temp.qimageview
else:
from .qimageview_python import qimageview as _qimageview
__version__ = "1.5"
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Version 1.0
import time
import os
from fabric.api import *
##
## Available environments
##
# def production():
# env.domain = 'sandbox.bitsteak.com.br'
# env.hosts = ['root@bitsteak.com']
# env.app_root = '/srv/sandbox.bitsteak.com.br/www/'
# env.git... |
import os
import glob
from ast import literal_eval
import numpy as np
import sympy
from sympy import pi, sin, cos, var
var('xi1, xi2')
var('x1t, x1r, x2t, x2r')
var('y1t, y1r, y2t, y2r')
subs = {
}
def List(*e):
return list(e)
printstr_12 = ''
printstr_full = ''
for i, filepath in enumerate(
glo... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2013 ecdsa@github
#
# 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... |
#! python3
# dlTAL.py - Downloads a specific range of "This American Life" eps
import requests, os
from bs4 import BeautifulSoup
# Starting URL
url = 'http://www.podtrac.com/pts/redirect.mp3/podcast.thisamericanlife.org/extended/'
# 'http://audio.thisamericanlife.org/jomamashouse/ismymamashouse/'
# 'http://w... |
from collections import namedtuple
from six import BytesIO, b
from unittest import TestCase
from warnings import simplefilter
from cfb import CfbIO
from cfb.constants import ENDOFCHAIN
from cfb.directory.entry import Entry, SEEK_CUR, SEEK_END
from cfb.exceptions import MaybeDefected, WarningDefect, FatalDefect, \
... |
import tensorflow as tf
import os
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('epoch', 1, 'Number of epoch')
tf.app.flags.DEFINE_integer('esize', 50, 'Size of examples')
tf.app.flags.DEFINE_integer('estep', 20, 'Length of step for grouping frames into examples')
tf.app.flags.DEFINE_integer('height', 240, ... |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Sale Start End Dates module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can ... |
# coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from datetime import datetime
from pprint import pformat
from six import iterit... |
# 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.
from bkr.inttest.server.selenium import WebDriverTestCase
from bkr.int... |
__author__ = "David Rusk <drusk@uvic.ca>"
import wx
class CertificateDialog(wx.Dialog):
def __init__(self, parent, handler, error_message):
super(CertificateDialog, self).__init__(parent, title="Certificate Error")
self.handler = handler
self.error_message = error_message
self._... |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... |
#!/usr/bin/env python
# This file is part of Elsim.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Elsim 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 ve... |
# -*- coding: utf-8 -*-
"""
This file is a part of python_translate package
(c) Adam Zieliński <adam@symfony2.guru>
For the full copyright and license information, please view the LICENSE and LICENSE_SYMFONY_TRANSLATION
files that were distributed with this source code.
"""
import ast
import codegen
from python_trans... |
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from account import models as amod
from . import templater
import datetime
def process_request(request):
'''Creates a reset password form to email a unique link to the user'''
user ... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <brett@belizebotanic.org>
# Copyright (c) 2012-2018 Mario Frasca <mario@anche.no>
#
# This file is part of ghini.desktop.
#
# ghini.desktop is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
import pytest
import re
import testutils
sdvars = testutils.securedrop_test_vars
testinfra_hosts = [sdvars.app_hostname, sdvars.monitor_hostname]
@pytest.mark.parametrize('sysctl_opt', [
('net.ipv4.conf.all.accept_redirects', 0),
('net.ipv4.conf.all.accept_source_route', 0),
('net.ipv4.conf.all.rp_filter', 1)... |
#!/usr/bin/python
# Author: Anton Gorev aka Veei
# Date: 2014-11-06
import sys
n = int(raw_input())
ys = []
sum = 0
first = True
minx = maxx = 0
miny = maxy = 0
for i in xrange(n):
b = [int(a) for a in raw_input().split(" ")]
ys += [b[1]]
sum += b[1]
if first or minx > b[0]:
minx = b[0]
i... |
# cOPYRIGht (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is... |
"""
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import os
import numpy as np
import json
thispath = os.path.dirname(os.path.abs... |
import os
import sys
neighborDict = {} #dictionary containing neighbors of each node
weightDict = {} #dictionary containing weights of edges
featureDict = {} #dictionary containing features of each node
featureDictTotal = {} #dictionay containing all listed features of each node
totalFeatureDict = {} #ditionary contai... |
from rpg.package_builder import PackageBuilder
from tests.support import RpgTestCase
from unittest import mock
class MockedSTDOUT(object):
def __init__(self, string):
self.string = string
def readline(self):
return self.string
class MockedSubprocess(object):
PIPE = None
STDOUT = N... |
# -*- coding:utf-8 -*-
#########################################
# Name: FBCallNotify
# Copyright (C): 2010 Maximilian Köhl
# License: GPLv3
#########################################
import socket
import notifyer
class Callmonitor():
def __init__(self, multiprocessmanager, numberconfig):
self.processmana... |
"""
Primary key changing capabilities and passive/non-passive cascading updates.
"""
from __future__ import with_statement
from sqlalchemy.testing import eq_, ne_, \
assert_raises, assert_raises_message
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, Strin... |
from __future__ import absolute_import, print_function, division
from io import BytesIO
from mock import Mock
import pytest
from netlib.exceptions import HttpException, HttpSyntaxException, HttpReadDisconnect, TcpDisconnect
from netlib.http import Headers
from netlib.http.http1.read import (
read_request, read_re... |
# -*- 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):
# Changing field 'Note.created'
db.alter_column('issues_note', 'created', self.gf('django.db.models.fields.... |
#
# linter.py
# Elm Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Brian Bugh
# Copyright (c) 2015 Brian Bugh
# Twitter: @brainbag
# Github: @bbugh
#
# License: MIT
#
"""This module exports the ElmLint plugin class."""
import json
import re
import os
from SublimeLinter.lint imp... |
import watson
from django.core.urlresolvers import reverse
from django.db import models
from us_ignite.constants import IMAGE_HELP_TEXT
from us_ignite.common.fields import AutoUUIDField, URL_HELP_TEXT
from us_ignite.resources import managers, search
from django_extensions.db.fields import (
AutoSlugField,
Cr... |
import pytest
from validr import T, SchemaError, Invalid
from . import case, compiler
@case({
T.union([T.int, T.list(T.int)]): [
(111, 111),
([111, 222], [111, 222]),
([], []),
[None, '', 'xxx'],
],
T.union([T.str, T.list(T.str)]).optional: [
([], []),
(None... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import copy
from snisi_core.indicators import (IndicatorTable, Indicator,
gen_report_indicator)
... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Service for tracking .isolateds and looking them up by builder and commit.
An .isolated file is a way to describe the dependencies of a specific build.
... |
#!/usr/bin/env python
# Toy Terrain Generator
import sys
# import and init pygame
import pygame
import random
pygame.init()
class PixelGrid:
def __init__(self, size, scale):
self.points = []
self.size = size
self.scale = scale
for i in range(size):
self.points.append([... |
from shiftschema.validators.abstract_validator import AbstractValidator
from shiftschema.result import Error
from shiftschema.exceptions import InvalidOption
class MultiChoice(AbstractValidator):
"""
MultiChoice validator
Accepts a list of values and checks if every item is a valid choice.
"""
in... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/licen... |
# 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 hashlib import ... |
"""
Configuration parser module.
Programmed by: Dante Signal31
email: dante.signal31@gmail.com
"""
import configparser
import http.client as http
import os
import urllib.parse as urlparse
import keyring
CONFIG_ROOT = os.path.expanduser("~/.geolocate")
CONFIG_FILE = "etc/geolocate.conf"
CONFIG_FILE_PATH = os.pa... |
# -*- coding: UTF-8 -*-
# Copyright 2013-2018 by Rumma & Ko Ltd.
# License: BSD, see file LICENSE for more details.
"""
This defines the :manage:`dump2py` management command.
.. management_command:: dump2py
Write a dump of your database to a set of Python modules. This dump
is useful for creating a daily backup or ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# KryPy documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 21 17:54:43 2013.
#
# 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
# autoge... |
from elasticsearch_dsl.connections import connections
from elasticsearch_dsl import (
Q,
DocType,
Text,
Date,
Integer,
Long,
Object,
Search,
MultiSearch,
A
)
from elasticsearch.helpers import bulk
from elasticsearch import Elasticsearch
from datetime import datetime, timedelta
fr... |
"""Loads and instantiates Celery, registers our tasks, and performs any other
necessary Celery-related setup. Also provides Celery-related utility methods,
in particular exposing a shortcut to the @task decorator."""
from __future__ import absolute_import
import datetime
from django.conf import settings
from django.c... |
# coding=latin-1
from database import db
from sqlalchemy.orm import relationship, backref, with_polymorphic
from sqlalchemy import Sequence, ForeignKey, UniqueConstraint
from cnddh.uploadsets import anexos_upload
import datetime
class Denuncia(db.Model):
__tablename__ = 'denuncias'
id = db... |
"""
Offline Manager for Xavier
"""
import logging
import jsonpickle
logger = logging.getLogger(__name__)
class Task(object):
def __init__(self, func):
self.func = func
self.path = '%s.%s' % (func.__name__, func.__module__)
self.publish_event = None
def __call__(self, *args, **kwargs... |
#!/usr/bin/env python3
#Program to log the gate events to database
import pymysql
from encryptor import Encryptor
class DatabaseHandler:
def __init__(self):
self._data = Encryptor.getData(Encryptor())
def connect(self):
try:
self._conn = pymysql.Connect(self._data['databaseHost'... |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... |
import ephem
from .base import Arbiter
from ..models import Facet, Element
class CelestialArbiter(Arbiter):
WEIGHT_DAY = 5
WEIGHT_NIGHT = 5
WEIGHT_MOON_FULL = 5
WEIGHT_MOON_NEW = 5
WEIGHT_MERCURY = 1
WEIGHT_VENUS = 1
WEIGHT_MARS = 1
WEIGHT_JUPITER = 1
WEIGHT_SATURN = 1
WEIGHT... |
#!/usr/bin/env python
##
# Copyright 2010--2013 Graham Percival
# This file is part of Artifastring.
#
# Artifastring 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... |
import scrapy
from scrapy.spiders import Spider
from scrapy import Request
import re
from scrapy.selector import Selector
from xiaomi_appstore_crawler.items import XiaomiAppstoreCrawlerItem
class XiaomiSpider(Spider):
name = "xiaomi"
allowed_domains = ["app.mi.com"]
start_urls = [
"http://app.mi.c... |
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from typing import List, Optional, Set
from zerver.decorator import require_realm_admin, to_non_negative_int, \
require_non_guest... |
'''
Commander Keen 1-3 level loader/saver
2014 <dr.kylstein@gmail.com>
'''
from __future__ import print_function
import math
import rlew
import file_gen_util as util
RLEW_FLAG = 0xFEFE
HEADER_FIELDS = ('width', 'height', 'plane_count', 'unk1', 'unk2', 'unk3',
'unk4', 'plane_size', 'unk5', 'unk6', 'u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.