src stringlengths 721 1.04M |
|---|
#xarequest.py
import os
import threading
import time
import win32com.client
from .abstract_component import AbstractQueryProviderComponent
from .abstract_component import AbstractSubscriptionProviderComponent
class XAQueryEvents:
def __init__(self):
self._event_object_connector = XAQueryEvents.event_obj... |
try:
import Image
except ImportError:
from PIL import Image, ImageDraw, ImageFont
from . import pytesseract
import requests
from io import BytesIO, StringIO
import time
import mahotas
import numpy as np
import logging
logger = logging.getLogger(__name__)
def downscale_image(im, max_dim=2048):
"""Shrink im unt... |
# @file cli.py
# @brief cli of whole tool
# README: Command line interface
# MODULE_ARCH:
# CLASS_ARCH:
# GLOBAL USAGE:
#standard
import cmd
#extend
#library
import lib.globalclasses as gc
from lib.const import *
##### Code section #####
#Spec: local variable maintain, about, user commands, test commands
#How/Need... |
#
# generic_create_variant.py
#
# Copy one of the variants from buildroot/platformio/variants into
# the appropriate framework variants folder, so that its contents
# will be picked up by PlatformIO just like any other variant.
#
import os,shutil,marlin
from SCons.Script import DefaultEnvironment
from platformio import... |
from gym.envs.classic_control import PendulumEnv, CartPoleEnv
import numpy as np
# MuJoCo may not be installed.
HalfCheetahEnv = HopperEnv = None
try:
from gym.envs.mujoco import HalfCheetahEnv, HopperEnv
except Exception:
pass
class CartPoleWrapper(CartPoleEnv):
"""Wrapper for the Cartpole-v0 environme... |
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
class Command(BaseCommand):
"""
Get/Delete list of contributors, non-contributors and total users
"""
option_list = BaseCommand.option_list + (
make_option... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the lichess.org fishnet client.
# Copyright (C) 2016-2017 Niklas Fiekas <niklas.fiekas@backscattering.de>
# See LICENSE.txt for licensing information.
import fishnet
import argparse
import unittest
import logging
import sys
import multiprocessing
t... |
๏ปฟimport urlparse
import traceback
import unittest
import json
from StringIO import StringIO
import datetime
import rdflib
import os
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0,parentdir)
from pycsvw import metadata
from pycsvw.main import CSVW
import urllib2
MAX_TESTS ... |
import core.levScanner as levScanner
import core.levParser as levParser
import core.levLexer as levLexer
import core.levExecute as executor
import core.levSystem as system
from core.levConsole import *
from core.levConfig import *
# Execute a level program
def run_console(p_file):
if p_file:
initCon... |
import numpy as np
from quadracheer.piessens import piessen_neg_one_to_one_nodes,\
piessen_method, piessens
from quadracheer.map import map_singular_pt, map_pts_wts
def test_piessen_neg_1_1():
# Example 1 from Piessens
f = lambda x: np.exp(x)
exact = 2.11450175
piessen_... |
import unittest
from cmr.queries import CollectionQuery
class TestCollectionClass(unittest.TestCase):
def test_archive_center(self):
query = CollectionQuery()
query.archive_center("LP DAAC")
self.assertIn("archive_center", query.params)
self.assertEqual(query.params["archive_cent... |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from builtins import str as unicode
from quark_runtime import *
_lazyImport.plug("inheritance.use_before_def")
import quark.reflect
class Bar(_QObject):
def _init(s... |
# -*- coding: utf8 -*-
#
# Copyright 2011 Kyrre Ness Sjรธbรฆk
# This file is part of AcdOpti.
#
# AcdOpti 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 you... |
import sys
import os
from numpy import nan
import pandas as pd
import argparse
#sys.stdin.reconfigure(encoding='latin-1',errors='replace') #'utf-8',errors='replace') #'ignore')
if __name__ == '__main__':
argparser = argparse.ArgumentParser('''
Extract eye-tracking time series from Dundee eye-trackin... |
import sys
from _pydevd_bundle.pydevd_constants import int_types, GENERATED_LEN_ATTR_NAME
from _pydevd_bundle.pydevd_resolver import MAX_ITEMS_TO_HANDLE, TOO_LARGE_ATTR
from _pydevd_bundle import pydevd_frame_utils
def get_frame():
var1 = 1
var2 = [var1]
var3 = {33: [var1]}
return sys._getframe()
de... |
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from linkedin.items import LinkedinItem
class LinkedinSpider(CrawlSpider):
"""
Define the crawler's start URIs, s... |
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017 CERN.
#
# REANA 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
# ver... |
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: gcp_compute
plugin_type: inventory
short_description: Google C... |
from __future__ import with_statement
import sys
from os.path import dirname, abspath
sys.path.append(dirname(dirname(abspath(__file__))))
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from paperchase.models import *
from paperchase.core import db
f... |
from copy import copy
import random
from helpers import shift
class OperationOrganism:
length = 150
def __init__(self,genome=None,target=None,population=None):
self.population = population
if genome:
self.genome = genome[:]
else:
self.genome = [(random.sample([1,... |
from django.db import models
#from django.conf import settings
#from config.storage import OverwriteStorage
#from utils.common import icon_size_name
from utils.connection import *
class CorporationApi(models.Model):
""" charactertype apis """
api = models.OneToOneField('apies.Api')
corporationid = model... |
"""
Django settings for hipsografia project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... |
#!/usr/bin/env python
#coding:utf-8
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.template import Context
from django.template.loader import get_template
from cerci_issue.models import Issue
import os
import shutil
from bs4 import BeautifulSoup
from djang... |
from collections import namedtuple
import itertools
import sys
def compute_shortest_paths(graph, starting_vertex):
"""
Given a graph (adj list) and starting vertex, compute path lengths to all
other verticies and return a hash where each hash key is the ending node and
the hash value is the distance of... |
"""
Downloads feeds, keys, packages and icons.
"""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
from zeroinstall import _, NeedDownload, logger
import os, sys
from zeroinstall import support
from zeroinstall.support import tasks, basedir, portable_rename
from ... |
#! /usr/bin/python
from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ServerEndpoint
import logging
import getopt
import sys
import os
import os.path
from client_factory import ClientFactory
from auth_manager import AuthManager
import game_id_sequence
def usage ():
print 'usage: %s... |
#!/usr/bin/env python
""" update local cfg
"""
import os
from DIRAC.Core.Base import Script
Script.setUsageMessage('\n'.join([__doc__.split('\n')[1],
'Usage:',
' %s [option|cfgFile] ... DB ...' % Script.scriptName]))
Script.parseCommandLine()
arg... |
from math import sqrt
class Point:
__slots__ = ['x', 'y']
def __init__(self, x, y):
self.x = x
self.y = y
@staticmethod
def distance (a, b):
return sqrt( (b.y - a.y)**2 + (b.x - a.x)**2 )
@staticmethod
def _weighted_average(a, dist, b):
x = (1 - dist) * a.x + d... |
import os
import getpass
import sys
import time
import numpy as np
import tensorflow as tf
from q2_initialization import xavier_weight_init
import data_utils.utils as du
import data_utils.ner as ner
from utils import data_iterator
from model import LanguageModel
class Config(object):
"""Holds model hyperparams and ... |
# 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 may ... |
"""
Models for bulk email
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration bulk_email --auto description_of_your_change
3. Add... |
import json
from base64 import b64encode, b64decode
from datetime import datetime
import numpy as np
import six
__all__ = [
'JsonBinary', 'JsonEncoder', 'JsonDecoder',
]
class JsonBinary(object):
"""
Wrapper class for binary objects.
In Python2, ordinary strings are binary strings, thus we cannot e... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'controller_view_widget_designer.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:... |
import pytest
from awx.api.versioning import reverse
from awx.main import models
@pytest.mark.django_db
def test_aliased_forward_reverse_field_searches(instance, options, get, admin):
url = reverse('api:unified_job_template_list')
response = options(url, None, admin)
assert 'job_template__search' in resp... |
'''
Created on Mar 31, 2016
@author: Tania Sennikova
'''
import pandas as pd
import csv
import numpy as np
from numpy import recfromcsv
from sklearn.preprocessing import LabelEncoder,OneHotEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier
from sk... |
"""
Tests for classes extending Field.
"""
# Allow accessing protected members for testing purposes
# pylint: disable=W0212
from mock import MagicMock, Mock
import unittest
import datetime as dt
import pytz
import warnings
from contextlib import contextmanager
from xblock.core import XBlock, Scope
from xblock.field... |
#!/Users/raymond/Projects/resume/env/bin/python2.7
#
# The Python Imaging Library.
# $Id$
#
# print image files to postscript printer
#
# History:
# 0.1 1996-04-20 fl Created
# 0.2 1996-10-04 fl Use draft mode when converting.
# 0.3 2003-05-06 fl Fixed a typo or two.
#
from __future__ import print_function... |
from __future__ import with_statement
from ConfigParser import SafeConfigParser, Error as ConfigParserError
from optparse import OptionParser
import os
import signal
import subprocess
import sys
import time
SERVICE_PREFIX = "service:"
NGINX_TEMPLATE_SUFFIX = ".template"
class _Settings(object):
VERBOSE = False
... |
'''
This file is part of python-libdeje.
python-libdeje 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.
python-libdeje is distribute... |
from __future__ import absolute_import, print_function
from celery.signals import task_postrun
from django.core.signals import request_finished
from django.db import models
from sentry import projectoptions
from sentry.db.models import Model, FlexibleForeignKey, sane_repr
from sentry.db.models.fields import Encrypted... |
import requests
import consts.paths as paths
import common.globals as globals
class APIClient(object):
"""Creates an API client object
"""
def __init__(self, path, params, method="GET"):
#Zillow specific key
self.zws_id = "X1-ZWz19tezrsrabv_5qhl2"
#Specific endpoint
self.p... |
# Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is distri... |
# -*- 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):
# Changing field 'TopStoryItem.object_id'
db.alter_column(u'djangocms_to... |
from opcode_factory import *
import pytest
def test_arith32_immediate():
# 0bdddnnnxxiiiiiiiidddnnniii0011011 ADD
instr = 0b00000000010101010010000100011011
assert add32_immediate(rd=1, rn=0, imm=0b01010101010) == instr
# 0bdddnnnxxiiiiiiiidddnnniii0111011 SUB
instr = 0b000000000101010... |
from django.db.models.loading import get_models
from django.core.management.sql import custom_sql_for_model
from sqlalchemy import create_engine
from django_sqlalchemy.backend import metadata, session
def reset(engine, app):
metadata.drop_all(engine, tables=_get_tables_for_app(app))
session.commit()
def creat... |
import os
from PIL import Image
import dota_file_parser
# data from dota2 files: resource/flash3/images/heroes
print 'Expecting hero icons to be in "heroes" (e.g. "heroes/antimage.png")'
print 'Expecting hero data to be in current folder (e.g. "npc_heroes.txt")'
hero_data = dota_file_parser.parse('npc_heroes.txt')
he... |
from .. import hooks
from .. import util
from ..extensions import db
from ..models import Post, Setting, get_settings, Context
from ..tasks import get_queue, async_app_context
from flask.ext.login import login_required
from flask import (
request, redirect, url_for, Blueprint, current_app,
)
import requests
impor... |
"""
Django settings for pizzeria project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... |
#-*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 One Click Software (http://oneclick.solutions)
# and Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you ca... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'resources/ui/inputdialog_value.ui'
#
# Created: Thu Jan 2 17:50:40 2014
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.... |
#!/usr/local/bin/python
# Copyright 2015 JChase II
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is... |
import os
# Configuration file for jupyterhub.
#------------------------------------------------------------------------------
# Configurable configuration
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#... |
#!/usr/bin/env python
import sys
import socket
import re
from IPy import IP
from dns.resolver import Resolver, NXDOMAIN, NoNameservers, Timeout, NoAnswer
from threading import Thread
RBLS = [
'aspews.ext.sorbs.net',
'b.barracudacentral.org',
'bl.deadbeef.com',
'bl.emailbasura.org',
'bl.spamcanniba... |
from __future__ import absolute_import
# rest framework imports
from rest_framework import permissions
from rest_framework import status
# multi device login imports
from disable_multidevice_login.login_manager import UserLoginState
from disable_multidevice_login.exceptions import MultiLogginFound
from disable_multid... |
"""Inserter"""
# ! to forbid other element to react during insert, they should not be in
# the same menu as the inserter, and maybe use _hide_mouse = True
from pygame import event, K_ESCAPE, K_RETURN, K_BACKSPACE, KEYDOWN, K_LEFT, K_RIGHT
from pygame.mouse import set_visible as mouse_set_visible
from pygame.key import... |
# Copyright 2011 Nicholas Bray
#
# 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... |
# --------------
# USER INSTRUCTIONS
#
# Write a function called stochastic_value that
# takes no input and RETURNS two grids. The
# first grid, value, should contain the computed
# value of each cell as shown in the video. The
# second grid, policy, should contain the optimum
# policy for each cell.
#
# Stay tuned fo... |
import pytest
from models.Models import Base_model
from models.Basic_stochastic_model import Basic_stochastic_model
from models.Stochastic_model_with_promotion import Stochastic_model_with_promotion
from models.Replication_model import Replication_model
from models.Stochastic_model_with_promotion_and_first_hiring impor... |
import io
import time
import hashlib
import collections
from six import add_metaclass
# http://mail.python.org/pipermail/python-list/2010-March/1239510.html
from calendar import timegm
from datetime import datetime, timedelta
from django.conf import settings
from django.http import HttpResponse, HttpRequest
from django... |
"""Unit and regression tests for Notin."""
import hashlib
import io
import os
import sys
import textwrap
import unittest
try:
from unittest import mock
except ImportError:
import mock
import pkg_resources
import notin
class CapturingTestCase(unittest.TestCase):
"""A test case that captures stderr."""... |
"""
Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>,
Brian Vinter <vinter@diku.dk>, Rune M. Friborg <runef@diku.dk>
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 restrict... |
#!/usr/bin/env python
#Imports the different modules that the script uses
import argparse
import subprocess
import textwrap
import portslicer
import fieldslicer
import combiner
import bro
#Create the command-line capability
parser = argparse.ArgumentParser(prog="Bro Log Utility Script",
description=textwrap.ded... |
# Copyright 2012 OpenStack Foundation
#
# 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 a... |
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
#
# MAUS 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.
#
# MAUS... |
# Copyright 2014-2016 Ivan Kravets <me@ikravets.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/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2016 Mike Rooney. 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
#
# htt... |
import numpy as np
try:
from matplotlib import lines
except ImportError:
pass
__all__ = ['CanvasToolBase', 'ToolHandles']
def _pass(*args):
pass
class CanvasToolBase(object):
"""Base canvas tool for matplotlib axes.
Parameters
----------
ax : :class:`matplotlib.axes.Axes`
Matpl... |
"""
Python implementation of the TIIP (Thin Industrial Internet Protocol) protocol.
"""
import json
from datetime import datetime as dt
from datetime import timedelta as td
import dateutil.parser as parser
# Python3 compability fixes
import sys
PY3 = sys.version_info > (3,)
if PY3:
long = int
... |
import importlib
import logging
import os
import time
import uuid
try:
from thread import get_ident
except ImportError:
from threading import get_ident
from kolibri.core.tasks import compat
from kolibri.core.utils.cache import process_cache
# An object on which to store data about the current job
# So far t... |
# 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... |
"""
Edit this file instead of editing settings.py.
"""
import os.path
HERE = os.path.dirname(__file__)
# #
# Database settings #
# #
# Default is to use twistranet with the suboptimal sqlite engine.
... |
# This file is part of nanothings.
#
# nanothings is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero GPL as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nanothings is distributed... |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
# -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright ยฉ 2015 Jรฉrรฉmy Bobbio <lunar@debian.org>
#
# diffoscope 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 Foundati... |
from django.shortcuts import render_to_response, redirect
from django.contrib import messages
from django.template import RequestContext
from django.contrib.auth import authenticate, login
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.conf import set... |
import datetime
from django.db import models
from asset.models import Asset, AssetGroup
from usermanagers.models import User, UserGroup
class PermLog(models.Model):
datetime = models.DateTimeField(auto_now_add=True)
action = models.CharField(max_length=100, null=True, blank=True, default='')
results = mo... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...styles import Styles
from ...workbook import Wo... |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.domain import Domain
from twilio.rest.accounts.v1 import V1
class Accounts(Domain):
def __init__(self, twilio):
"""
Initialize the Accounts Domain
:re... |
"""Views for items (modules)."""
from __future__ import absolute_import
import hashlib
import logging
from collections import OrderedDict
from datetime import datetime
from functools import partial
from uuid import uuid4
from django.conf import settings
from django.contrib.auth.decorators import login_required
from d... |
# QR_here.py displays the current URL encoded as a QR image.
import os, sys, inspect
#
# Much ugly bother to work with a local copy of pyqrcode
#
curpath = os.path.split(inspect.getfile(inspect.currentframe()))[0]
newpath = os.path.join(curpath, "../pyqrcode-read-only")
cmd_folder = os.path.realpath(os.path.abspath... |
from urllib2 import urlopen
import lxml.html
import requests
import json
import csv
# dataReports = ["DataRequest","DataExemption","DataAppeal","DataProcessTime","DataFeewaiver","DataPerson","DataBacklog","DataConsultant","RequestDisposition","RequestDenial","RequestPending","Exemption3Statutes","appealDisposition","... |
#!/usr/bin/python
import sys
import csv
import urllib
import urllib2
import json
import geojson
output = {}
files = sys.argv[1:]
for f in files:
fdata = open(f).read()
try:
data = geojson.loads(fdata)
except:
print 'failed to parse: ' + fdata
continue
for feature in data['features']:
woeid = s... |
# -*- coding: UTF-8 -*-
# chat_component.py
# Created by Francesco Porcari on 2010-09-08.
# Copyright (c) 2010 Softwell. All rights reserved.
from gnr.web.gnrwebpage import BaseComponent
from gnr.core.gnrlang import gnrImport, objectExtract
from gnr.core.gnrbag import Bag
class BatchMonitor(BaseComponent):
js_... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import datetime
from frappe import _
import frappe
import frappe.database
import frappe.utils
from frappe.utils import cint
import frappe.utils.user
from frappe import conf
from ... |
# Rekall Memory Forensics
# Copyright (C) 2011
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Michael Cohen <scudette@gmail.com>
#
# ******************************************************
#
# * This program is free software; you can redistribute it and/or
# * modify it under the terms of the GNU General Public... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wx
import json
import subprocess
import threading
import sys
def square_to_coord(square):
bottom_corner = (480, 0)
unit = 60
squarex = square[0]
squarey = square[1]-1
newx = (squarex*unit) - 60
newy = bottom_corner[0] - (unit + squarey*unit... |
from collections import namedtuple, Counter
from itertools import groupby
import re
from string import ascii_lowercase
Room = namedtuple('Room', ['name', 'id', 'chksum'])
def common_chars(text):
chars = ''
cnt = Counter(text)
del cnt['-']
for group in groupby(cnt.most_common(), key=lambda c: c[1]):
... |
from subprocess import call
import os
import json
BUILDER_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = os.path.join(BUILDER_PATH, '..')
FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts')
CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css')
SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss')
LESS_FOLDER_... |
# -*- coding: utf-8 -*-
import os, sys
# env
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djpsilobus.settings.shell')
import django
django.setup()
from django.conf import settings
from djpsilobus.core.utils import create_item
import argparse
YEAR = settings.YEAR
SESS = 'RA'
# set up command-line options
des... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/options_metadata.ui'
#
# Created: Fri May 24 09:20:07 2013
# by: PyQt4 UI code generator 4.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... |
from hashlib import sha1
from tornado.web import Application
from tornado.testing import AsyncHTTPTestCase
from tornado.test.util import unittest
from PIL import Image
from robohash.webfront import ImgHandler
class BaseImageHandlerTest(AsyncHTTPTestCase):
def get_app(self):
return Application(((r"/", Im... |
'''
Created on May 21, 2015
@author: scem
'''
from threading import Thread
import zmq
ONLINE = 'online'
OFFLINE = 'offline'
class Follower(Thread):
'''
classdocs
'''
def __init__(self, me='anonymous', host='localhost', port='7002', timeout=None):
self.me = me
... |
# -*- 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):
# Adding model 'Sprint'
db.create_table('artifacts_sprint', (
('id', self.gf('django.db.models.f... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-17 17:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Legis... |
#-*- coding: latin-1 -*-
# Agent pour choisir les pays de dรฉpart
# Adaptรฉ de l'agent de TicTacToe de Michel Gagnon
class Agent:
def __init__(self):
self.initQ()
def initQ(self):
self.nbQ = {}
self.q = {}
self.alpha = {}
def QValue(self,grid,action):
if (grid,action... |
#!/usr/bin/
#-*- coding: iso-8859-1 -*-
#===============================================================================
# __________ ________________ __ _______
# / ____/ __ \/ ____/ ____/ __ )/ / / / ___/
# / /_ / /_/ / __/ / __/ / __ / / / /\__ \
# / __/ / _, _/ /___/ /___/ /_/ / /_/ /___/ /... |
from django.contrib import admin
from django_calendar.models import Eleve, Professeur, Convention, Lieu, Periode
# Custom model admin
class EleveAdmin(admin.ModelAdmin):
exclude = ("user",)
list_display = ("username", "first_name", "last_name", "email", "phone")
search_fields = ("first_name", "last_name")
... |
#!/usr/bin/env python
import sys
import subprocess
import re
import difflib
failed = False
_ansi = re.compile(r'\x1b[^m]*m')
_help = '''claptests v1.4.8
Kevin K. <kbknapp@gmail.com>
tests clap library
USAGE:
\tclaptests [FLAGS] [OPTIONS] [ARGS] [SUBCOMMAND]
FLAGS:
-f, --flag tests flags
-F ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# 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 u... |
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.