src stringlengths 721 1.04M |
|---|
# (\
# ( \ /(o)\ caw!
# ( \/ ()/ /)
# ( `;.))'".)
# `(/////.-'
# =====))=))===()
# ///'
# //
# '
from __future__ import with_statement
import datetime
import decimal
import logging
import operator
import os
import re
import threading
import time
from co... |
# This script tests the synchronous camera file playing.
# Created by Toni Sagrista
import time, os
from py4j.java_gateway import JavaGateway, GatewayParameters
gateway = JavaGateway(gateway_parameters=GatewayParameters(auto_convert=True))
gs = gateway.entry_point
# Prints to both Gaia Sky and Python logs
def printa... |
import iso8601
import logging
from datetime import datetime
from time import mktime, time
from openprocurement.auction.core import Planning
from openprocurement.auction.design import startDate_view, endDate_view
from openprocurement.auction.systemd_msgs_ids import \
DATA_BRIDGE_PLANNING_TENDER_ALREADY_PLANNED as A... |
# Copyright 2018-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
import argparse
import sys
from openpyxl import load_workbook
import config
from sample import Sample
from family import update_family, family_ped
# CLI
parser = argparse.ArgumentParser(description="Convert OGT xlsx to PED file")
parser.add_argument("orderform",
help="OGT order form with sample ID, status and... |
import urllib2
"""
This script was only created to extract a several
photos, in jpg format, from an internal website.
It was a very quick script I made only for the
purpose decribe before.
"""
web_not_found = 0
web_found = 0
for num_photo in range(7277, 7630):
web_page = r'http://ntpnoapps0301.corp.codetel.com.d... |
"""
Django settings for fusilier project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import o... |
# 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 u... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants_test.pants_run_integration_test import PantsRunIntegrationTest
class TestNai... |
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 option) any later version.
#
# wger W... |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# 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 agr... |
# coding=utf-8
from __future__ import division, absolute_import, print_function, unicode_literals
import ujson
from datetime import datetime
import calendar
class Listen(object):
""" Represents a listen object """
def __init__(self, user_id=None, timestamp=None, artist_msid=None, album_msid=None,
... |
class InfluxQueryHelper(object):
def __init__(self):
self.where_clause = ''
self.limit_clause = ''
self.query = ''
def build_query(self, base_query, **kwargs):
where_clause_dict = {}
if 'start' in kwargs:
start = kwargs['start']
if isinstance(... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio 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... |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... |
# coding: utf-8
#
# Copyright 2018 The Oppia 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 requi... |
# Copyright 2016 Sam Parkinson <sam@sam.today>
#
# This file is part of Something for Reddit.
#
# Something for Reddit 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 ... |
# -*- coding: utf-8 -*-
# -*- Channel CanalPelis -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import re
import sys
import urllib
import urlparse, base64
from core import httptools
from core import scrapertools
from core import servertools
from core.item import Item
from core ... |
import cPickle
import csv
import math
import cv2
import numpy as np
import expressivity
import face_extractor
import filter
from trash import utility_positional
def draw_face(image, pts, color, thickness=1):
open_ranges = [[0, 17], [17, 22], [22, 27], [27, 31], [31, 36]]
closed_ranges = [[36, 42], [42, 48],... |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from unittest.mock import patch, Mock
import pytest
import yaml
from asphalt.core import command
DerivedApplication = None
def test_quickstart_application(monkeypatch, tmpdir, capsys):
def mock_input(text):
if text == 'Project name: ':
return 'Example Project'
elif text == 'Top leve... |
import smtplib
import sys
import traceback
from email.Utils import formatdate
from email.mime.text import MIMEText
from time import time
from urlparse import parse_qsl
from django.utils.http import urlencode
import settings_local as settings
# This has to be imported after the settings so statsd knows where to log ... |
import copy
import importlib
import warnings
from satella.coding.recast_exceptions import rethrow_as
from satella.configuration import sources
from satella.configuration.sources.base import BaseSource
from satella.exceptions import ConfigurationError, ConfigurationMisconfiguredError
__all__ = [
'load_source_from_... |
# https://www.codewars.com/kata/next-bigger-number-with-the-same-digits/train/python
def next_bigger(n):
import itertools
# Print the arguments
print('n = {}'.format(n))
# Define default result as -1
result = -1
# Convert the number to a list of digits
numbers = [int(d) for d in str(n)]
print('numbers = {}'... |
import random
from fixtures import generator_data
GENDER_NEUTRAL = 0
GENDER_MALE = 1
GENDER_FEMALE = 2
def random_generator(selector, generator_id=None, max_value=10):
if generator_id is None:
generator_id = random.randrange(max_value)
return selector(generator_id)
class Name:
glue = ""
d... |
"""
Additional functions and demos for Burgers' equation.
"""
import sys, os
from clawpack import pyclaw
from clawpack import riemann
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import animation
from IPython.display import HTML
import numpy as np
from utils import riemann_tools
from . import burge... |
def addr(r, a, b):
return r[a]+r[b]
def addi(r, a, b):
return r[a]+b
def mulr(r, a, b):
return r[a]*r[b]
def muli(r, a, b):
return r[a] * b
def banr(r, a, b):
return r[a] & r[b]
def bani(r, a, b):
return r[a] & b
def borr(r, a, b):
return r[a] | r[b]
def bori(r, a, b):
ret... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
def selection_fn(model):
return list(enumerate(["Corge", "Grault", "Wheee", "Moog"]))
def compute_fn(records):
for record in records:
record.value = 3
def inverse_f... |
"""Provide summary statistics on data."""
from plugin import Statistics
from numpy import min, max, mean, median, std
class Summary(Statistics):
"""Plugin to display summary statistics"""
name = "Summary"
def Main(self, model):
"""Calculate summary statistics"""
self.model = model
f... |
# -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... |
# -*- coding: utf-8 -*-
"""
Tree Rendering.
* :any:`RenderTree` using the following styles:
* :any:`AsciiStyle`
* :any:`ContStyle`
* :any:`ContRoundStyle`
* :any:`DoubleStyle`
"""
import six
class AbstractStyle(object):
def __init__(self, vertical, cont, end):
"""
Tree Render St... |
# -*- coding: utf-8 -*-
# Copyright(C) 2010 Christophe Benz, Romain Bignon
#
# 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, version 3 of the License.
#
# This program is distributed in the ho... |
# @Author: dileep
# @Last Modified by: dileep
import json
import os
import random
import pytest
from microbial_ai.io import ModelTable
from microbial_ai.metabolism import Microbe
CURRPATH = os.path.dirname(__file__)
@pytest.fixture(scope="module")
def model_table():
return ModelTable(db_uri=f"sqlite:///{CURRP... |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
"""
Logging setup.
2008-04-17 [k]: umieszczanie loga w tempie jeżeli jest frozen lub wybrany
katalog jest ro.
"""
__author__ = "Karol Będkowski"
__copyright__ = "Copyright (c) Karol Będkowski, 2006-2010"
__version__ = "2011-04-24"
__all__ = ['logging_setup']
import os.pa... |
from django.core.management.commands.inspectdb import \
Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self)... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 23 2016 at 10:37UTC
@author: Mathias Aschwanden (mathias.aschwanden@gmail.com)
"""
import os
import pdb
import copy
import time as time_module
import datetime
import numpy as np
import dill as pickle
import matplotlib.pyplot as plt
from attrdict import AttrDict
import m... |
#!/usr/bin/env python3.4
import sys
import urllib.request, urllib.error, urllib.parse
import pandas
import numpy
import csv
from clint.textui import colored
# c1 (diseaseId, name, hpoName, STY, MESH, diseaseClassName, doName, type, OMIM ),
query="""
DEFINE
c0='/data/gene_disease_summary',
c1='/data/diseases',
c2... |
#
# Copyright 2012 ibiblio
#
# 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.txt
#
# Unless required by applicable law or agreed to in writing... |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
from openerp.exceptions import ValidationError
class Attendance(models.Model):
_inherit="hr.attendance"
validate = fields.Boolean(string='Validate', help='Check to let Odoo validate if this attendance-event is plausible.', default=True)
valid = field... |
# -*- coding: utf-8 -*-
# -- This file is part of the Apio project
# -- (C) 2016-2019 FPGAwars
# -- Author Jesús Arroyo
# -- Licence GPLv2
# -- Derived from:
# ---- Platformio project
# ---- (C) 2014-2016 Ivan Kravets <me@ikravets.com>
# ---- Licence Apache v2
from email.utils import parsedate_tz
from math import cei... |
"""define decorators for use across app."""
from datetime import date
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Union
from flask import g, render_template, request
from database import EnumSymbol
from mod_auth.models import User
def get_menu_entries(user: Optional[User], t... |
# -*- coding: utf-8 -*-
"""
Source objects abstract online news source websites & domains.
www.cnn.com would be its own source.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import logging
from urllib.parse import urljoin, urlsplit, urlunsp... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pydrill documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 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
# aut... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import traceback
import ray
from collections import namedtuple
from ray.rllib.agents import get_agent_class
# Ray resources required to schedule a Trial
Resources = namedtuple("Resources", ["cpu",... |
# Copyright 2004,2009 Toby Dickenson
# Changes 2014 (c) Bjorn Pettersen
#
# 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 ... |
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
import mock
from django.test import TestCase, RequestFactory
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from paperclip.models import Attachment, Fil... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011 Frédéric Bertolus.
# Copyright (C) 2009-2011 Matthieu Bizien.
#
# This file is part of Perroquet.
#
# Perroquet 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 ... |
"""
Contains the SQLInterp class.
Most of your interaction with sql_interp will be through this class.
"""
from esc_types import Esc, ListEsc, DictEsc
__all__ = ['SQLInterp']
class SQLInterp(object):
"""
The main sql_interp object.
"""
def __init__(self, new_types=None):
self.type_map = {
... |
# Copyright 2014 (C) Raster Software Vigo (Sergio Costas)
#
# This file is part of DeVeDe-NG
#
# DeVeDe-NG 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)... |
#!/usr/bin/env python2
#
# This file is part of the dune-hdd project:
# https://github.com/pymor/dune-hdd
# Copyright Holders: Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import division, print_function
import numpy as np
from functools import parti... |
from __future__ import absolute_import, print_function, division
import theano
from theano.tests import unittest_tools as utt
import numpy
from theano.tensor.nnet.bn import batch_normalization
def test_BNComposite():
try:
orig = theano.config.compute_test_value
theano.config.compute_test_value =... |
# sorting some stuff 2
# https://www.youtube.com/watch?v=-xXvxj0SaQ4
import sys
import random
import time
# import timeit
# v pripade max. recursion limitu
# sys.setrecursionlimit(1500)
# viz. https://stackoverflow.com/questions/3323001/maximum-recursion-depth
nums = list()
n = 10
for i in range(0, n):
# print(... |
import pygame
from pygame import rect
from constants import *
from part import Wall, Brick
class World:
world = [[None for x in range(26)] for y in range(19)]
def __init__(self):
self.brick = pygame.image.load("pictures/brick.jpeg")
self.wall = pygame.image.load("pictures/wall.png")
... |
import copy
from lxml import etree
from xdict import utils
from xdict import hdict_object
def get_lxml_etree_root_type():
html_text='<html><boby></body></html>'
root = etree.HTML(html_text)
return(type(root))
def attrib_str_to_dict(attrib_str):
html_text = ''
html_text = ''.join(('<div... |
"""
"""
class SimpleAttribute:
"""
"""
def __init__(self, name, options=['SI Units', 'English Units']):
pass
class NamedAttribute:
"""
"""
def __init__(self, name, type_, value=None, separator='=',
max_length=None):
pass
class TagAttribute:
"""
... |
# Copyright 2015-2016 Palo Alto Networks, 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... |
#!/usr/bin/env python3
"""https://adventofcode.com/2016
--- Day 15: Timing is Everything ---
The halls open into an interior plaza containing a large kinetic sculpture. The
sculpture is in a sealed enclosure and seems to involve a set of identical
spherical capsules that are carried to the top and allowed to bounce t... |
from cfn_pyplates import core, functions
from ec2 import BlockDevice, BlockDeviceMapping
from errors import RespawnResourceError
class MetricsCollection(core.JSONableDict):
"""
Creates a Metrics Collection
:param granularity: String
:param kwargs: metrics - [ String, ... ]
"""
... |
"""
Shutterfly Data Sink
"""
import logging
log = logging.getLogger("modules.Shutterfly")
import conduit
import conduit.utils as Utils
from conduit.datatypes import Rid
import conduit.dataproviders.Image as Image
import conduit.Exceptions as Exceptions
import conduit.datatypes.Photo as Photo
Utils.dataprovider_add_di... |
#!/usr/bin/env python2
import json
import argparse
import collections
import clang.cindex
from clang.cindex import TypeKind
from clang.cindex import CursorKind
Function = collections.namedtuple('Function', ['name', 'returnType', 'argumentTypes'])
Constant = collections.namedtuple('Constant', ['name', 'value'])
def g... |
#!/usr/bin/python
""" This program will retype volumes
"""
import os
from optparse import OptionParser
import random
import sys
import time
from cinderclient import client as cinderclient
from novaclient.v2 import client as novaclient
USER = os.getenv('OS_USERNAME')
TENANT = os.getenv('OS_TENANT_NAME')
PASSWORD = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os, sys, sqlite3, datetime, urllib, gzip, requests
from time import sleep
from flask import Flask, render_template, g, request, redirect, url_for, send_from_directory, session, flash, jsonify, make_response, Markup, Response
from flask_login import LoginManager, Us... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import argparse
from model.gegan import GEGAN
parser = argparse.ArgumentParser(description='Train')
parser.add_argument('--experiment_dir', dest='experiment_dir', required=True,
... |
"""
Selects number of distinct revisions.
Usage:
session_stats (-h|--help)
session_stats <input> <output>
[--debug]
[--verbose]
Options:
-h, --help This help message is printed
<input> Path to input file to process.
<output> Where output will be writte... |
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... |
import ray
from ray.new_dashboard.memory_utils import (
ReferenceType, decode_object_ref_if_needed, MemoryTableEntry, MemoryTable,
SortingType)
"""Memory Table Unit Test"""
NODE_ADDRESS = "127.0.0.1"
IS_DRIVER = True
PID = 1
OBJECT_ID = "7wpsIhgZiBz/////AQAAyAEAAAA="
ACTOR_ID = "fffffffffffffffff66d17ba010000c... |
# -------------------------------------------------------------------------
# * This is an ANSI C library that can be used to evaluate the probability
# * density functions (pdf's), cumulative distribution functions (cdf's), and
# * inverse distribution functions (idf's) for a variety of discrete and
# * cont... |
# -*- coding: utf-8 -*-
'''active knives'''
from threading import local
from collections import deque
from contextlib import contextmanager
from stuf.utils import clsname
from knife._compat import loads, optimize
class _ActiveMixin(local):
'''active knife mixin'''
def __init__(self, *things, **kw):
... |
# encoding: 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):
# Adding model 'Classifier'
db.create_table('userpypi_classifier', (
('id', self.gf('djang... |
# Portions are Copyright (C) 2005 Roman V. Kiseliov
# Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
from arelle.xlwt.BIFFRecords import BiffRecord
from struct import *
def _size_col(sheet, col):
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# compiled font is a binary blob:
# 1. magic (MFNT) - 4 bytes
# 2. number of symbols - 4 bytes
# 3. font y advance - 4 bytes
# 4. an array of glyphs (offset_x, offset_y, width, height, tx, ty, tx2, ty2, x_advance) - 36 * number of symbols
# (iiIIffffI)
# 5. png texture
imp... |
from __future__ import print_function, division
from collections import Counter, defaultdict
import itertools
from itertools import izip, cycle
import json
from math import log
import random
from sys import stderr
import screed
mutrate = 1/1000
barcodes = [
"AAAA",
"CCCC",
"GGGG",
"TTTT",
]
def mut... |
from deltas.segmenters import MatchableSegment
from revscoring.datasources import Datasource
from revscoring.datasources.meta import indexable
class Revision:
def __init__(self, name, revision_datasources):
super().__init__(name, revision_datasources)
self.sentences = Datasource(
se... |
from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop
from Components.config import ConfigSubsection,... |
#!/usr/bin/python3
###################################
# for Linux #
###################################
import os
import time
source_dir = ['/root/data']
target_dir = '/root/backup'
today_log_dir = target_dir + os.sep + time.strftime('%y%m%d')
success_count = 0
fail_count = 0
if not os.path.exi... |
from mivs import *
def href(url):
return ('http://' + url) if url and not url.startswith('http') else url
class ReviewMixin:
@property
def video_reviews(self):
return [r for r in self.reviews if r.video_status != c.PENDING]
@property
def game_reviews(self):
return [r for r in se... |
__author__ = 'rischan'
import constants
from datetime import datetime
import time
from util import setup_api
import tweepy
from tweepy import Cursor, TweepError
import sys
# constants
consumer_key = constants.consumer_key
consumer_secret = constants.consumer_secret
access_key = constants.access_key
access_secret = co... |
#***************************************************************************
#* *
#* Copyright (c) 2014 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""Script to validate dtFabric format definitions."""
import argparse
import glob
import logging
import os
import sys
from dtfabric import errors
from dtfabric import reader
from dtfabric import registry
class DefinitionsValidator(object):... |
class Config:
def __init__(self, path):
self.path = path
self.options = {}
self.votes = []
self.tunes = []
self.available_rcon_commands = []
self.rcon_commands = []
def read(self):
with open(self.path) as f:
lines = f.readlines()
... |
from __future__ import division
import time
import cython_random as random
import preflop_equity
from utility import MathUtils
from game import GameData
from hand_simulator import HandSimulator
from bet_sizing import BetSizeCalculator
from fear import Fear
from timer import Timer
class Brain(BetSizeCalculator, Fear... |
from network import Listener, Handler, poll
handlers = {} # map client handler to user name
names = {} # map name to handler
subs = {} # map tag to handlers
def broadcast(msg):
for h in handlers.keys():
h.do_send(msg)
class MyHandler(Handler):
count = 0;
def on_open(self):
handlers[sel... |
__I_MSG = { # ASMAxxxI
33 : lambda info, line: 'Storage alignment for {0} unfavorable'.format(line[info[1]:info[2]]),
}
__N_MSG = { # ASMAxxxN
}
__W_MSG = { # ASMAxxxW
45 : lambda info, line: 'Register or label not previously used - {0}'.fo... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2016-2018 Cyril Desjouy <ipselium@free.fr>
#
# This file is part of cpyvke
#
# cpyvke 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 vers... |
from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime, timedelta
import re
from time import timezone
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import p... |
"""Creates ACME accounts for server."""
import datetime
import functools
import hashlib
import logging
import os
import shutil
import socket
import josepy as jose
import pyrfc3339
import pytz
import six
import zope.component
from cryptography.hazmat.primitives import serialization
from acme import fields as acme_fiel... |
#!/usr/bin/env python
# Modified to always use the installation path to store and read the client_secrets.json and pyu-oauth2.json file
import httplib
import httplib2
import os
import random
import sys
import time
from apiclient.discovery import build
from apiclient.errors import HttpError
from apiclient.http import ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2011 Umeå University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
#!/usr/bin/env python
import os
import setuptools
import token_auth
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setuptools.setup(
name="django-token-auth",
version=token_a... |
# 类型自动推断
counter = 100
miles = 1000.0
name = 'runjob'
print(counter)
print(miles)
print(name)
# 多个变量同时赋值
a = b = c = 1
print(a,b,c)
a,b,c = 1,2,'hello'
print(a,b,c)
'''
标准的数据类型:
Number,String,List,Tuple,Sets,Dictionary
Number:
int,float,bool,complex
'''
a,b,c,d=20,5.5,True,4+3j
print(type(a),type(b),type(c),type(... |
#!/usr/bin/env python3
##
# mdwebsite
#
# Purpose:
# Tool for building and deploying a static website with support for Markdown files.
#
# Author:
# Dan Kissam, teeheehee@gmail.com
#
# Version:
# Refer to VERSION.md
import sys
import logging
import buildtool
import configtool
def printHelp():
print("""\
Usage: ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------------------------------... |
""" Multicast DNS Service Discovery for Python
Copyright (C) 2003, Paul Scott-Murphy
Copyright (C) 2009, Alexander Solovyov
This module provides a framework for the use of DNS Service Discovery
using IP multicast. It has been tested against the JRendezvous
implementation from <a href="http://stran... |
# -*- coding: utf-8 -*-
from django.db import models
from educar import get_descripciones_ebooks
# Create your models here.
class Alumno(models.Model):
apellido = models.CharField(max_length=100)
nombre = models.CharField(max_length=100)
colegio = models.ForeignKey('Colegio')
curso = models.ForeignKe... |
#!/usr/bin/python
##################
# AndorCam.py
#
# Copyright David Baddeley, 2009
# d.baddeley@auckland.ac.nz
#
# 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... |
# Lint as: python3
#!/usr/bin/env python
# Copyright 2021 The CARFAC Authors. All Rights Reserved.
#
# This file is part of an implementation of Lyon's cochlear model:
# "Cascade of Asymmetric Resonators with Fast-Acting Compression"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... |
#!/usr/bin/python
# Derived from the UM2 version by an anonymous contributor...
#
# http://umforum.ultimaker.com/index.php?/topic/5951-um2-calibration-utility-leveling-ringsgcode/?p=54694
#
# ...who wisely says: "I accept NO liability for any damage done by
# using either version or any derivatives. USE AT YOUR OWN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.