code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google Inc.
# 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 ... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# 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... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | Python |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | Python |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | Python |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... | Python |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | Python |
'''
Module which prompts the user for translations and saves them.
TODO: implement
@author: Rodrigo Damazio
'''
class Translator(object):
'''
classdocs
'''
def __init__(self, language):
'''
Constructor
'''
self._language = language
def Translate(self, string_names):
print string_names | Python |
'''
Module which brings history information about files from Mercurial.
@author: Rodrigo Damazio
'''
import re
import subprocess
REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*')
def _GetOutputLines(args):
'''
Runs an external process and returns its output as a list of lines.
@param args: the argume... | Python |
'''
Module which parses a string XML file.
@author: Rodrigo Damazio
'''
from xml.parsers.expat import ParserCreate
import re
#import xml.etree.ElementTree as ET
class StringsParser(object):
'''
Parser for string XML files.
This object is not thread-safe and should be used for parsing a single file at
a time... | Python |
#!/usr/bin/python
'''
Entry point for My Tracks i18n tool.
@author: Rodrigo Damazio
'''
import mytracks.files
import mytracks.translate
import mytracks.validate
import sys
def Usage():
print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0]
print 'Commands are:'
print ' cleanup'
print ' translate'
p... | Python |
'''
Module which compares languague files to the master file and detects
issues.
@author: Rodrigo Damazio
'''
import os
from mytracks.parser import StringsParser
import mytracks.history
class Validator(object):
def __init__(self, languages):
'''
Builds a strings file validator.
Params:
@para... | Python |
'''
Module for dealing with resource files (but not their contents).
@author: Rodrigo Damazio
'''
import os.path
from glob import glob
import re
MYTRACKS_RES_DIR = 'MyTracks/res'
ANDROID_MASTER_VALUES = 'values'
ANDROID_VALUES_MASK = 'values-*'
def GetMyTracksDir():
'''
Returns the directory in which the MyTrac... | Python |
#/usr/bin/env python
from optparse import OptionParser
import httplib, urllib
import os, fnmatch, shutil, re
usage = """usage: %prog [options] command
Commands:
build build the script
debug print the header to include js files
clean remove any built files
"""
par... | Python |
#!/usr/bin/env python
USAGE = '''Usage: testasciidoc.py [OPTIONS] COMMAND
Run AsciiDoc conformance tests specified in configuration FILE.
Commands:
list List tests
run [NUMBER] [BACKEND] Execute tests
update [NUMBER] [BACKEND] Regenerate and update test data
Options:
-f, ... | Python |
#!/usr/bin/env python
"""
asciidocapi - AsciiDoc API wrapper class.
The AsciiDocAPI class provides an API for executing asciidoc. Minimal example
compiles `mydoc.txt` to `mydoc.html`:
import asciidocapi
asciidoc = asciidocapi.AsciiDocAPI()
asciidoc.execute('mydoc.txt')
- Full documentation in asciidocapi.txt.
... | Python |
#!/usr/bin/env python
'''
a2x - A toolchain manager for AsciiDoc (converts Asciidoc text files to other
file formats)
Copyright: Stuart Rackham (c) 2009
License: MIT
Email: srackham@gmail.com
'''
import os
import fnmatch
import HTMLParser
import re
import shutil
import subprocess
import sys
import traceb... | Python |
#!/usr/bin/env python
'''
NAME
music2png - Converts textual music notation to classically notated PNG file
SYNOPSIS
music2png [options] INFILE
DESCRIPTION
This filter reads LilyPond or ABC music notation text from the input file
INFILE (or stdin if INFILE is -), converts it to classical music notation... | Python |
#!/usr/bin/env python
'''
NAME
code-filter - AsciiDoc filter to highlight language keywords
SYNOPSIS
code-filter -b backend -l language [ -t tabsize ]
[ --help | -h ] [ --version | -v ]
DESCRIPTION
This filter reads source code from the standard input, highlights language
keywords and ... | Python |
#!/usr/bin/env python
'''
NAME
latex2png - Converts LaTeX source to PNG file
SYNOPSIS
latex2png [options] INFILE
DESCRIPTION
This filter reads LaTeX source text from the input file
INFILE (or stdin if INFILE is -) and renders it to PNG image file.
Typically used to render math equations.
Requ... | Python |
#!/usr/bin/env python
import os, sys, subprocess
from optparse import *
__AUTHOR__ = "Gouichi Iisaka <iisaka51@gmail.com>"
__VERSION__ = '1.1.4'
class EApp(Exception):
'''Application specific exception.'''
pass
class Application():
'''
NAME
graphviz2png - Converts textual graphviz notation to PNG fi... | Python |
#!/usr/bin/env python
"""
asciidoc - converts an AsciiDoc text file to HTML or DocBook
Copyright (C) 2002-2010 Stuart Rackham. Free use of this software is granted
under the terms of the GNU General Public License (GPL).
"""
import sys, os, re, time, traceback, tempfile, subprocess, codecs, locale, unicodedata, copy
... | Python |
#!/usr/bin/env python
"""
asciidocapi - AsciiDoc API wrapper class.
The AsciiDocAPI class provides an API for executing asciidoc. Minimal example
compiles `mydoc.txt` to `mydoc.html`:
import asciidocapi
asciidoc = asciidocapi.AsciiDocAPI()
asciidoc.execute('mydoc.txt')
- Full documentation in asciidocapi.txt.
... | Python |
#!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | Python |
# -*- coding: utf-8 -*-
#! /usr/bin/env python
from PySide.QtCore import Qt
_ADD, _DELETE, _INSERT = range(3)
_ROOT, _DEPTH, _WIDTH = range(3)
def int_to_checkstate(i):
i = int(i)
return {
0 : Qt.CheckState.Unchecked,
1 : Qt.CheckState.PartiallyChecked,
2 : Qt.CheckStat... | Python |
# -*- coding: utf-8 -*-
from PySide import QtCore, QtGui, QtWebKit
from operator import attrgetter
from config import *
from utils import unescape
#from post_widget import PostView
class QWorker(QtCore.QThread):
signal = QtCore.Signal(str)
signal_update_status_bar = QtCore.Signal(tuple)
signal_updat... | Python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled.ui'
#
# Created: Mon Apr 23 15:15:26 2012
# by: pyside-uic 0.2.13 running on PySide 1.1.0
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui, QtWebKit
from list_widget import ListWidget
i... | Python |
# -*- coding: utf-8 -*-
#! /usr/bin/env python
from PySide import QtCore, QtGui, QtWebKit
from PySide.QtCore import SIGNAL, QSettings, QSize, QPoint, QAbstractListModel, QModelIndex, Qt
from PySide.QtWebKit import QWebSettings
import logging, time, os
from pprint import pprint
from datetime import datetime
from ui_au... | Python |
# -*- coding: utf-8 -*-
#! /usr/bin/env python
import sys, re, os
import urllib2, urllib, cookielib
import logging
import xml.etree.ElementTree as ET
from config import *
from utils import *
logger = logging.getLogger('fer_fetcher')
#Post: post_id, thread_title, author, author_id, timestamp, forum_id, thread_id, un... | Python |
# -*- coding: utf-8 -*-
### Access information
USERNAME = ''
PASSWORD = ''
AUYH_KEY = ''
#SITE_URL='http://forum.exler.ru/'
SITE_URL='http://club443.ru/'
FORUMLIST_URL= SITE_URL + 'ib_client/cltp2z01.php?forumlist=1'
THREADLIST_URL= SITE_URL + 'ib_client/cltp2z01.php?forum=%s&tlimit=100'
POSTLIST_URL= SITE_U... | Python |
# -*- coding: utf-8 -*-
#! /usr/bin/env python
from PySide import QtCore, QtGui
class ListWidget(QtGui.QListWidget):
def __init__(self, parent):
super(ListWidget, self).__init__(parent)
def set_items(self, items):
if self.count():
for i in range(self.count()):
sel... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2008 Mariano Reingart"
from distutils.core import setup
import py2exe
import sys
# includes for py2exe
includes=['e... | Python |
{'application':{'type':'Application',
'name':'Template',
'backgrounds': [
{'type':'Background',
'name':'bgTemplate',
'title':u'Aplicativo Factura Electr\xf3nica (PyRece)',
'size':(592, 487),
'menubar': {'type':'MenuBar',
'menus': [
... | Python |
import wsaa
import os,sys
from subprocess import Popen, PIPE
from base64 import b64encode
def sign_tra(tra,cert,privatekey):
"Firmar PKCS#7 el TRA y devolver CMS (recortando los headers SMIME)"
# Firmar el texto (tra)
out = Popen(["openssl", "smime", "-sign",
"-signer", cert,... | Python |
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program 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, or (at your option) any later
# version.
#
# This program is distributed in t... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"""
__version__ = "$Revision: 1.3 $"
__date__ = "$Date: 2005/04/05 18:44:54 $"
"""
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2008 Mariano Reingart"
from distutils.core import setup
import py2exe
impor... | Python |
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program 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, or (at your option) any later
# version.
#
# This program is distributed in ... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs (WSMTXCA)"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
from distutils.core import setup
import py2exe
import glob, sys
# includes for py2e... | Python |
#!/usr/bin/env python
# $Header: //info.ravenbrook.com/project/jili/version/1.1/code/spacepar.py#1 $
# Python 2.3.3
# Tool to analyse and correct all the errors of the form
# "'(' is preceded with whitespace" produced by the Checkstyle tool.
# it does this by processing the style.txt file output by Checkstyle.
# ... | Python |
#!/usr/bin/env python
# $Header: //info.ravenbrook.com/project/jili/version/1.1/code/addpackage.py#1 $
# Created using python 2.3.3 documentation as reference.
# Add package declaration to java files
import fileinput
import sys
def doit(name) :
f = fileinput.input(name, inplace=1)
packaged = False
wh... | Python |
#!/usr/bin/env python
# $Header: //info.ravenbrook.com/project/jili/version/1.1/code/brace.py#1 $
# Python 2.3.3
# Script to move braces
import os
import re
import string
import sys
# See [JLS2] 3.9
javaKeyword = [
'abstract', 'default', 'if', 'private', 'this',
'boolean', '... | Python |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | Python |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | Python |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | Python |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | Python |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
curr_file_name = 'A-large-practice'
#curr_file_name = 'A-small-practice'
#curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_dividing_func(input_lines):
total... | Python |
'''
Created on 19/05/2014
@author: dingliangl
'''
from cj_lib import *
from properties import *
import math
import fractions
curr_file_name = 'A-large-practice'
#curr_file_name = 'A-small-practice'
#curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_dividing_func(i... | Python |
'''
Created on 23/05/2014
@author: dingliangl
'''
from cj_lib import *
from properties import *
import math
import fractions
#curr_file_name = '-large-practice'
#curr_file_name = '-small-practice'
curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_dividing_func(input_l... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
#curr_file_name = 'A-large-practice'
#curr_file_name = 'A-small-practice'
curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_div... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
curr_file_name = 'B-large-practice'
#curr_file_name = 'B-small-practice'
#curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_div... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
#curr_file_name = '-large-practice'
#curr_file_name = '-small-practice'
curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_divid... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
curr_file_name = 'D-large-practice'
#curr_file_name = 'D-small-practice'
#curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
#for a sequen... | Python |
'''
Created on Dec 12, 2012
@author: dingliangl
'''
# store some common properties that might be relative to local environment, so
# leave svn peace.
default_file_name = 'test'
default_input_file_path = r'G:\Project\codejam_inout_2\test.in'
default_output_file_path = r'G:\Project\codejam_inout_2\test.ou... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
curr_file_name = 'C-large-practice'
#curr_file_name = 'C-small-practice'
#curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_div... | Python |
'''
CodeJam Python Lib for Festony, By Festony
Created on 2012-12-12
@author: festony
'''
import time
import inspect
import os.path
import shutil
import properties
from properties import *
__all__ = [ \
'run_proc', \
'accumulate', \
'get_full', \
'g... | Python |
'''
CodeJam Practice
Created on 2012-12-20
@author: festony
'''
from cj_lib import *
from properties import *
import math
import fractions
#curr_file_name = '-large-practice'
#curr_file_name = '-small-practice'
curr_file_name = 'test'
# map(int, input_lines.pop(0).split(' '))
def input_divid... | Python |
'''
Created on Dec 12, 2012
@author: dingliangl
'''
# store some common properties that might be relative to local environment, so
# leave svn peace.
default_file_name = 'test'
default_input_file_path = r'D:\CodeJam\inout\test.in'
default_output_file_path = r'D:\CodeJam\inout\test.out'
default_working_... | Python |
'''
CodeJam Python Lib for Festony, By Festony
Created on 2012-12-12
@author: festony
'''
import time
import inspect
import os.path
import shutil
import properties
from properties import *
__all__ = [ \
'run_proc', \
'accumulate', \
'get_full', \
'g... | Python |
'''
Created on 2014-4-4
@author: festony
'''
| Python |
'''
Created on 2014-4-4
@author: festony
'''
class AmebaDiv1:
def count(self, X):
U = list(set(X))
S = U[:]
for ini in U:
s = ini
for x in X:
if x == s:
s += x
if s in S:
... | Python |
'''
Created on 2014-4-4
@author: festony
'''
class MinimumSquare:
def getMaxSquareSide(self, x, y):
minx = min(x)
maxx = max(x)
miny = min(y)
maxy = max(y)
disx = maxx - minx
disy = maxy - miny
dis = max(disx, disy)
... | Python |
'''
Created on 17/03/2014
@author: dingliangl
'''
class SurroundingGameEasy:
def isDom(self, x, y, s):
if s[y][x]:
return True
if x > 0 and not s[y][x-1]:
return False
if x < len(s[0]) - 1 and not s[y][x+1]:
return False
i... | Python |
#!/usr/bin/env python
#
# Small Python utility that reads an ABAQUS file and creates an image of the
# model.
#
# ABAQUS entities supported:
# Shells:
# S4, S4R, S4RS, S3, S3R, S3RS, M3D4, M3D4R, M3D3, S8R, S8R5, M3D8,
# M3D8R, M3D6, SFM3D4, SFM3D4R, SFM3D3
# Bars:
# B31, CONN3D2
# Solids: TODO
#
# This utility requir... | Python |
import os, time
class MyException(Exception):
pass
def passing(*args):
pass
def sleeping(s):
time.sleep(s)
os.environ['ROBOT_THREAD_TESTING'] = str(s)
return s
def returning(arg):
return arg
def failing(msg='xxx'):
raise MyException, msg
if os.name == 'java':
from java.lang import... | Python |
#!/usr/bin/env python
"""Helper script to run all Robot Framework's unit tests.
usage: run_utest.py [options]
options:
-q, --quiet Minimal output
-v, --verbose Verbose output
-d, --doc Show test's doc string instead of name and class
(implies verbosity)
-h, --help ... | Python |
import os
THIS_PATH = os.path.dirname(__file__)
GOLDEN_OUTPUT = os.path.join(THIS_PATH, 'golden_suite', 'output.xml')
GOLDEN_OUTPUT2 = os.path.join(THIS_PATH, 'golden_suite', 'output2.xml')
GOLDEN_JS = os.path.join(THIS_PATH, 'golden_suite', 'expected.js')
| Python |
#!/usr/bin/env python
import fileinput
import os
import sys
import robot
from robot.result.jsparser import create_datamodel_from
BASEDIR = os.path.dirname(__file__)
def run_robot(outputdirectory, testdata, loglevel='INFO'):
robot.run(testdata, log='NONE', report='NONE',
tagstatlink=['force:http://g... | Python |
import os
import sys
from distutils.sysconfig import get_python_lib
def egg_preinstall(temp_robot_path, scripts):
"""Updates platform specific startup scripts.
Run as part of the easy_install egg creation procedure. This is the only
way to get the scripts updated when the easy_install is used. Updates th... | Python |
#!/usr/bin/env python
import sys
import os
from distutils.core import setup
import robot_postinstall
execfile(os.path.join(os.path.dirname(__file__),'src','robot','version.py'))
# Maximum width in Windows installer seems to be 70 characters -------|
DESCRIPTION = """
Robot Framework is a generic test automation fra... | Python |
#!/usr/bin/env python
"""A script for running Robot Framework's acceptance tests.
Usage: run_atests.py interpreter [options] datasource(s)
Data sources are paths to directories or files under `robot` folder.
Available options are the same that can be used with Robot Framework.
See its help (e.g. `pybot --help`) fo... | Python |
import subprocess
import os
import signal
import ctypes
import time
class ProcessManager(object):
def __init__(self):
self._process = None
self._stdout = ''
self._stderr = ''
def start_process(self, *args):
args = args[0].split() + list(args[1:])
self._process = subpr... | Python |
from robot.libraries.BuiltIn import BuiltIn
BIN = BuiltIn()
def start_keyword(*args):
if BIN.get_variables()['${TESTNAME}'] == 'Listener Using BuiltIn':
BIN.set_test_variable('${SET BY LISTENER}', 'quux')
| Python |
import os
import tempfile
import time
class ListenAll:
ROBOT_LISTENER_API_VERSION = '2'
def __init__(self, *path):
if not path:
path = os.path.join(tempfile.gettempdir(), 'listen_all.txt')
else:
path = ':'.join(path)
self.outfile = open(path, 'w')
def sta... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.