text stringlengths 0 1.05M | meta dict |
|---|---|
from dummyprobe import DummyProbe
import subprocess
import re
import platform
import org.joda.time.DateTime as DateTime
import logging
logger = logging.getLogger(__name__)
class LinuxNetstatS(DummyProbe):
def initialize(self):
self.regexClass = re.compile(r'^([a-zA-Z0-9]+):$')
self.regexSubClass = re.compile(r'... | {
"repo_name": "filipealmeida/probespawner",
"path": "netstats.py",
"copies": "1",
"size": "2058",
"license": "unlicense",
"hash": -2877970635223615000,
"line_mean": 30.1818181818,
"line_max": 84,
"alpha_frac": 0.656462585,
"autogenerated": false,
"ratio": 3.013177159590044,
"config_test": false... |
from dummyprobe import DummyProbe
import subprocess
import re
import platform
import org.joda.time.DateTime as DateTime
import logging
logger = logging.getLogger(__name__)
#qActive Internet connections (w/o servers)
#Proto Recv-Q Send-Q Local Address Foreign Address State
class LinuxNetstatNTC(Du... | {
"repo_name": "filipealmeida/probespawner",
"path": "netstatntc.py",
"copies": "1",
"size": "2282",
"license": "unlicense",
"hash": 4101649128434704400,
"line_mean": 30.2602739726,
"line_max": 117,
"alpha_frac": 0.6393514461,
"autogenerated": false,
"ratio": 3.079622132253711,
"config_test": fa... |
from dummyprobe import DummyProbe
import subprocess
import re
import platform
import org.joda.time.DateTime as DateTime
#top - 19:39:32 up 2 days, 21:42, 7 users, load average: 1,99, 1,34, 0,92
#Threads: 811 total, 2 running, 776 sleeping, 0 stopped, 33 zombie
#%Cpu(s): 5,7 us, 3,8 sy, 0,0 ni, 89,4 id, 1,... | {
"repo_name": "filipealmeida/probespawner",
"path": "linuxtopprobe.py",
"copies": "1",
"size": "6816",
"license": "unlicense",
"hash": -1879543326747436800,
"line_mean": 37.5084745763,
"line_max": 213,
"alpha_frac": 0.6088615023,
"autogenerated": false,
"ratio": 2.823529411764706,
"config_test"... |
from fbuild.builders.c import guess_static
from fbuild.builders import find_program
from fbuild.config import c as c_test
from fbuild.target import register
from fbuild.record import Record
from fbuild.path import Path
import fbuild.db
from optparse import make_option
import re
def pre_options(parser):
group = p... | {
"repo_name": "kirbyfan64/rejit",
"path": "fbuildroot.py",
"copies": "1",
"size": "5316",
"license": "mpl-2.0",
"hash": 3925079143127997000,
"line_mean": 31.4146341463,
"line_max": 83,
"alpha_frac": 0.5949962378,
"autogenerated": false,
"ratio": 3.4452365521710955,
"config_test": true,
"has_n... |
from __future__ import with_statement
from pprint import pprint
#from databaseprobe import DatabaseProbe
from threading import Thread
from java.lang import Thread as JThread, InterruptedException
from java.util.concurrent import ExecutionException
from java.util.concurrent import Executors, TimeUnit
from java.util.con... | {
"repo_name": "filipealmeida/probespawner",
"path": "probespawner.py",
"copies": "1",
"size": "4245",
"license": "unlicense",
"hash": -2014425140416496000,
"line_mean": 29.9854014599,
"line_max": 104,
"alpha_frac": 0.6815076561,
"autogenerated": false,
"ratio": 3.675324675324675,
"config_test":... |
from __future__ import with_statement
import os.path
import threading
import sys
import logging
from logging.config import fileConfig
from java.util.concurrent import Callable
from com.ziclix.python.sql import PyConnection
from com.ziclix.python.sql import zxJDBC
import com.xhaus.jyson.JysonCodec as json
import org.... | {
"repo_name": "filipealmeida/probespawner",
"path": "cooldbprobe.py",
"copies": "1",
"size": "11251",
"license": "unlicense",
"hash": 1964503222536436200,
"line_mean": 49.4529147982,
"line_max": 183,
"alpha_frac": 0.511421207,
"autogenerated": false,
"ratio": 4.609176566980746,
"config_test": f... |
import mozdevice
import mozlog
import unittest
from sut import MockAgent
class MkDirsTest(unittest.TestCase):
def test_mkdirs(self):
subTests = [{'cmds': [('isdir /mnt/sdcard/baz/boop', 'FALSE'),
('info os', 'android'),
('isdir /mnt', 'TRUE'),
... | {
"repo_name": "vladikoff/fxa-mochitest",
"path": "tests/mozbase/mozdevice/tests/sut_mkdir.py",
"copies": "3",
"size": "3002",
"license": "mpl-2.0",
"hash": -6885986192066412000,
"line_mean": 38.5,
"line_max": 100,
"alpha_frac": 0.4570286476,
"autogenerated": false,
"ratio": 4.024128686327078,
"... |
import platform
from random import randint
import atexit
import errno
#import fcntl
import os
import random
import re
import signal
import socket
import subprocess
import sys
import threading
import time
import sys
import logging
logger = logging.getLogger(__name__)
ALIVE = True
class OpenTSDB():
def __init__(se... | {
"repo_name": "filipealmeida/probespawner",
"path": "opentsdblh.py",
"copies": "1",
"size": "6038",
"license": "unlicense",
"hash": -869015529125871700,
"line_mean": 26.3212669683,
"line_max": 171,
"alpha_frac": 0.6586618085,
"autogenerated": false,
"ratio": 3.06497461928934,
"config_test": tru... |
"""Any function from n inputs to m outputs"""
import logging
from itertools import zip_longest
import pypes.component
log = logging.getLogger(__name__)
def default_function(*args):
"pass"
return args
class NMFunction(pypes.component.Component):
"""
mandatory input packet attributes:
- data: f... | {
"repo_name": "Enucatl/pypes",
"path": "pypes/plugins/nm_function.py",
"copies": "1",
"size": "3356",
"license": "apache-2.0",
"hash": 5331688705115168000,
"line_mean": 33.2448979592,
"line_max": 75,
"alpha_frac": 0.4940405244,
"autogenerated": false,
"ratio": 4.584699453551913,
"config_test": ... |
# any
prefix_spec = '{: >25s}!!'
prefix_norm = '{} '.format(prefix_spec)
prefix_last = '{}L'.format(prefix_spec)
A1 = 'A-1'
E1 = 'E-1'
#soil
D1 = 'D-1'
D1Soil = 'D-1'
D1Interf = 'D-1'
# D1L = 'D-1'
D2Isotropic = 'D-2.Isotropic'
D2Orthotropic = 'D-2.Orthotropic'
D2Duncan = 'D-2.Duncan'
D3Duncan = 'D-3.Duncan'
D4Dunc... | {
"repo_name": "Ricyteach/candemaker",
"path": "src/candemaker/cid/prefix/prefix.py",
"copies": "1",
"size": "1228",
"license": "bsd-2-clause",
"hash": 2238863906915841800,
"line_mean": 20.5438596491,
"line_max": 45,
"alpha_frac": 0.674267101,
"autogenerated": false,
"ratio": 1.7174825174825175,
... |
# #### Any project wide helper stuff sits here
from django.db import models
# #### In case senders account currency is diff, debit_number != credit_number, conversion will be required
# Following mapping holds conversion of 1 bitcoin to currency in key
# ideally these should come from a third party service API but du... | {
"repo_name": "akash-dev-github/Transactions",
"path": "transactions/proj_utils.py",
"copies": "1",
"size": "1243",
"license": "mit",
"hash": 5905833292752801000,
"line_mean": 35.5588235294,
"line_max": 107,
"alpha_frac": 0.7304907482,
"autogenerated": false,
"ratio": 4.035714285714286,
"config... |
# Any recursive function can be transformed into an iterative function which
# uses an explicit stack. Here's an example:
# Basic stack class.
class Stack(object):
def __init__(self):
self.s = []
def __len__(self):
return len(self.s)
def __repr__(self):
return '[' + ', '.join([str... | {
"repo_name": "jcarreiro/jmc-python",
"path": "algorithms/recursion.py",
"copies": "1",
"size": "2054",
"license": "mit",
"hash": -2733920461054842400,
"line_mean": 28.3428571429,
"line_max": 82,
"alpha_frac": 0.517526777,
"autogenerated": false,
"ratio": 3.6161971830985915,
"config_test": fals... |
"""Any shareable docstring components for rolling/expanding/ewm"""
from textwrap import dedent
from pandas.core.shared_docs import _shared_docs
_shared_docs = dict(**_shared_docs)
def create_section_header(header: str) -> str:
"""Create numpydoc section header"""
return "\n".join((header, "-" * len(header))... | {
"repo_name": "datapythonista/pandas",
"path": "pandas/core/window/doc.py",
"copies": "3",
"size": "4151",
"license": "bsd-3-clause",
"hash": -5941213573762472000,
"line_mean": 33.8823529412,
"line_max": 87,
"alpha_frac": 0.6131052758,
"autogenerated": false,
"ratio": 4.002892960462874,
"config... |
""" Anything to do with threading and background maintainance """
from concurrent.futures import ThreadPoolExecutor
import threading
import time
from .const import Config
from .log import l
from .hashing import int2bytes
pool = ThreadPoolExecutor(max_workers=Config.WORKERS)
class ThreadPoolMixIn:
"""Mix-i... | {
"repo_name": "ganwell/dht3k",
"path": "dht3k/threads.py",
"copies": "1",
"size": "3870",
"license": "mit",
"hash": -6429798671365571000,
"line_mean": 28.7692307692,
"line_max": 73,
"alpha_frac": 0.5312661499,
"autogenerated": false,
"ratio": 4.271523178807947,
"config_test": true,
"has_no_ke... |
""" Any utility functions.
This module holds the owner data along with a handful of
command specific functions and helpers.
"""
import logging
import re
import shlex
from enum import Enum
from functools import wraps
from io import BytesIO
import aiohttp
import discord
from asyncio import subprocess as sub
member_m... | {
"repo_name": "PcBoy111/PC-BOT-V2",
"path": "pcbot/utils.py",
"copies": "1",
"size": "18822",
"license": "mit",
"hash": 3157133388312525000,
"line_mean": 35.2658959538,
"line_max": 126,
"alpha_frac": 0.6453618106,
"autogenerated": false,
"ratio": 4.022654413336183,
"config_test": false,
"has_... |
"""AoC 2015.01 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def chars(file, chunkSize=4096):
"""
Take a file object, read it in chuncks and iterate over it one character at a time.
Keyword arguments:
file --- a file object to iterate over
chunkSize ---... | {
"repo_name": "kav2k/AoC",
"path": "2015/01/solver.py",
"copies": "1",
"size": "1214",
"license": "mit",
"hash": -8682508721760082000,
"line_mean": 19.9310344828,
"line_max": 85,
"alpha_frac": 0.6276771005,
"autogenerated": false,
"ratio": 3.6787878787878787,
"config_test": false,
"has_no_key... |
"""AoC 2015.02 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def parseBox(line):
"""
Take a line of the form "NxNxN" and parse it into a sorted tuple (length, width, height).
Keyword arguments:
line --- a string to be parsed as box specifications
"""
... | {
"repo_name": "kav2k/AoC",
"path": "2015/02/solver.py",
"copies": "1",
"size": "1074",
"license": "mit",
"hash": 5000308988695905000,
"line_mean": 23.976744186,
"line_max": 91,
"alpha_frac": 0.6461824953,
"autogenerated": false,
"ratio": 3.4757281553398056,
"config_test": false,
"has_no_keywo... |
"""AoC 2015.03 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def chars(file, chunkSize=4096):
"""
Take a file object, read it in chuncks and iterate over it one character at a time.
Keyword arguments:
file --- a file object to iterate over
chunkSize ---... | {
"repo_name": "kav2k/AoC",
"path": "2015/03/solver.py",
"copies": "1",
"size": "2120",
"license": "mit",
"hash": 162078325013108350,
"line_mean": 25.5,
"line_max": 95,
"alpha_frac": 0.654245283,
"autogenerated": false,
"ratio": 3.6177474402730376,
"config_test": false,
"has_no_keywords": fals... |
"""AoC 2015.04 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
from hashlib import md5
def solver(file, progress=True, progress_step=10000):
"""
Take a file object with input and solve AoC 2015.04 problem on the input.
Outputs progress to STDERR unless silenced.
... | {
"repo_name": "kav2k/AoC",
"path": "2015/04/solver.py",
"copies": "1",
"size": "1509",
"license": "mit",
"hash": 5701901275762493000,
"line_mean": 25.9464285714,
"line_max": 80,
"alpha_frac": 0.6441351889,
"autogenerated": false,
"ratio": 3.6014319809069213,
"config_test": false,
"has_no_keyw... |
"""AoC 2015.05 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
import re
def nice1(string):
"""Check a string for being nice under 'old' rules."""
vowels = 0
twice = False
last = ""
for character in string:
if character in ["a", "e", "i", "o", "u"]:
... | {
"repo_name": "kav2k/AoC",
"path": "2015/05/solver.py",
"copies": "1",
"size": "1197",
"license": "mit",
"hash": 5603042090004325000,
"line_mean": 20,
"line_max": 77,
"alpha_frac": 0.5939849624,
"autogenerated": false,
"ratio": 3.2615803814713895,
"config_test": false,
"has_no_keywords": fals... |
"""AoC 2015.06 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
import re
GRID_SIZE = 1000
def execute(lights, instruction):
"""
Take an instruction as a string and apply it to a 2D array of boolean lights.
Modifies the array in-place.
Keyword arguments:
ligh... | {
"repo_name": "kav2k/AoC",
"path": "2015/06/solver.py",
"copies": "1",
"size": "2900",
"license": "mit",
"hash": 9685573776732788,
"line_mean": 28.5918367347,
"line_max": 100,
"alpha_frac": 0.6279310345,
"autogenerated": false,
"ratio": 3.2805429864253393,
"config_test": false,
"has_no_keywor... |
"""AoC 2015.07 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
import re
def parse(instruction):
"""
Take an instruction as a string and return a tuple (output wire, input specification).
Example input specifications:
* ("ID", "6") for constant input
* ("ID", ... | {
"repo_name": "kav2k/AoC",
"path": "2015/07/solver.py",
"copies": "1",
"size": "3381",
"license": "mit",
"hash": -3098581805348479000,
"line_mean": 29.1875,
"line_max": 88,
"alpha_frac": 0.6388642413,
"autogenerated": false,
"ratio": 3.503626943005181,
"config_test": false,
"has_no_keywords":... |
"""AoC 2015.08 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def unescape(string):
"""
Take a string according to challenge specifications, and perform unescape.
Keyword arguments:
string --- a string to unescape
"""
result = ""
index = 0
while index <... | {
"repo_name": "kav2k/AoC",
"path": "2015/08/solver.py",
"copies": "1",
"size": "1892",
"license": "mit",
"hash": -5207844015329671000,
"line_mean": 22.3580246914,
"line_max": 104,
"alpha_frac": 0.5998942918,
"autogenerated": false,
"ratio": 3.917184265010352,
"config_test": false,
"has_no_key... |
"""AoC 2015.09 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
from math import factorial
import re
def permute(list, index):
"""
Return index-th permutation of a list.
Keyword arguments:
list --- the list to be permuted
index --- index in range (0, factorial... | {
"repo_name": "kav2k/AoC",
"path": "2015/09/solver.py",
"copies": "1",
"size": "1966",
"license": "mit",
"hash": 289006748307965630,
"line_mean": 24.2051282051,
"line_max": 86,
"alpha_frac": 0.6307222787,
"autogenerated": false,
"ratio": 3.4131944444444446,
"config_test": false,
"has_no_keywo... |
"""AoC 2015.10 problem solver.
Takes input from STDIN by default.
(c) Alexander Kashev, 2017
"""
import sys
def look_and_say(string):
"""
Expand a string of digits according to look-and-say process in the problem.
Keyword arguments:
string --- a string to be processed
"""
result = ""
last = ""
coun... | {
"repo_name": "kav2k/AoC",
"path": "2015/10/solver.py",
"copies": "1",
"size": "1370",
"license": "mit",
"hash": -9060703970998854000,
"line_mean": 19.7575757576,
"line_max": 77,
"alpha_frac": 0.6175182482,
"autogenerated": false,
"ratio": 3.624338624338624,
"config_test": false,
"has_no_keyw... |
"""AoC 2018.01 problem solver.
Takes input from STDIN by default.
"""
import sys
def solver(file):
"""
Take a file object with input and solve AoC 2015.XX problem on the input.
Keyword arguments:
file --- a file object to read input from
"""
input = list(map(str.strip, file.readlines()))
answ... | {
"repo_name": "kav2k/AoC",
"path": "2018/02/solver.py",
"copies": "1",
"size": "1397",
"license": "mit",
"hash": 7347573241521392000,
"line_mean": 19.8507462687,
"line_max": 75,
"alpha_frac": 0.5526127416,
"autogenerated": false,
"ratio": 3.582051282051282,
"config_test": false,
"has_no_keywo... |
"""aoc_common
Common utility functions for Advent of Code solutions
"""
from __future__ import annotations
import pathlib
from itertools import islice, repeat
from typing import Iterable, TypeVar
def load_puzzle_input(day: int) -> str:
"""Return the puzzle input for the day’s puzzle"""
input_directory = pat... | {
"repo_name": "robjwells/adventofcode-solutions",
"path": "2016/python/aoc_common.py",
"copies": "1",
"size": "1763",
"license": "mit",
"hash": 4749158148049386000,
"line_mean": 26.0923076923,
"line_max": 73,
"alpha_frac": 0.6456558773,
"autogenerated": false,
"ratio": 3.6459627329192545,
"conf... |
"""aoc_common
Common utility functions for Advent of Code solutions
"""
import pathlib
from itertools import islice, repeat
from typing import Iterable, Iterator, List, Optional, TypeVar, Union
def load_puzzle_input(day: int) -> str:
"""Return the puzzle input for the day’s puzzle"""
input_directory = pathl... | {
"repo_name": "robjwells/adventofcode-solutions",
"path": "2019/python/aoc_common.py",
"copies": "1",
"size": "1782",
"license": "mit",
"hash": -9144941585234930000,
"line_mean": 26.8125,
"line_max": 79,
"alpha_frac": 0.6483146067,
"autogenerated": false,
"ratio": 3.6178861788617884,
"config_te... |
"""AoC Day 10
Usage:
day10.py <filename>
day10.py (-h | --help)
day10.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
from collections import defaultdict
class Instruction:
def __init__(self, from_bot, low_type, low_id, high_type, high_i... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day10/day10.py",
"copies": "1",
"size": "2752",
"license": "mit",
"hash": -1049943730662482800,
"line_mean": 26.797979798,
"line_max": 99,
"alpha_frac": 0.5439680233,
"autogenerated": false,
"ratio": 3.4923857868020303,
"config_test": false,
... |
"""AoC Day 11
Usage:
day11.py
day11.py (-h | --help)
day11.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import itertools
import copy
SG = 0
SM = 1
PG = 2
PM = 3
TG = 4
TM = 5
RG = 6
RM = 7
CG = 8
CM = 9
EG = 10
EM = 11
DG = 12
DM = 13
i... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day11/day11.py",
"copies": "1",
"size": "3997",
"license": "mit",
"hash": -6180672908468982000,
"line_mean": 23.8260869565,
"line_max": 86,
"alpha_frac": 0.4843632725,
"autogenerated": false,
"ratio": 3.630336058128974,
"config_test": false,
... |
"""AoC Day 12
Usage:
day12.py <filename>
day12.py (-h | --help)
day12.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
class Instruction:
COPY = 0
INC = 1
DEC = 2
JNZ = 3
def __init__(self, instruction_string):
ins... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day12/day12.py",
"copies": "1",
"size": "2852",
"license": "mit",
"hash": -5091384569756763000,
"line_mean": 25.9056603774,
"line_max": 79,
"alpha_frac": 0.5354137447,
"autogenerated": false,
"ratio": 3.762532981530343,
"config_test": false,
... |
"""AoC Day 13
Usage:
day13.py
day13.py (-h | --help)
day13.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import numpy as np
WALL = '#'
OPEN = ' '
def count_bits(num):
count = 0
while(num):
num &= num - 1
count += 1... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day13/day13.py",
"copies": "1",
"size": "2563",
"license": "mit",
"hash": 6117905751567799000,
"line_mean": 23.4095238095,
"line_max": 80,
"alpha_frac": 0.5298478346,
"autogenerated": false,
"ratio": 3.0259740259740258,
"config_test": false,
... |
"""AoC Day 14
Usage:
day14.py
day14.py (-h | --help)
day14.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import hashlib
import re
from collections import OrderedDict
def find_keys(stretch, salt, start, end, three_dict, five_dict):
thr... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day14/day14.py",
"copies": "1",
"size": "2131",
"license": "mit",
"hash": -5813199391896984000,
"line_mean": 22.4175824176,
"line_max": 67,
"alpha_frac": 0.5180666354,
"autogenerated": false,
"ratio": 3.398724082934609,
"config_test": false,
... |
"""AoC Day 16
Usage:
day16.py <input> <length>
day16.py (-h | --help)
day16.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def checksum(string):
string = list(string)
while True:
i = 0
checksum = []
while i ... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day16/day16.py",
"copies": "1",
"size": "1171",
"license": "mit",
"hash": -1196758724988947200,
"line_mean": 19.1896551724,
"line_max": 73,
"alpha_frac": 0.4671221178,
"autogenerated": false,
"ratio": 3.64797507788162,
"config_test": false,
... |
"""AoC Day 17
Usage:
day17.py
day17.py (-h | --help)
day17.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import hashlib
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
OPEN = ' '
CLOSED = 'X'
def calculate_open_doors(passcode):
doors = []
m =... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day17/day17.py",
"copies": "1",
"size": "2128",
"license": "mit",
"hash": 1385084371173802800,
"line_mean": 23.7441860465,
"line_max": 87,
"alpha_frac": 0.5065789474,
"autogenerated": false,
"ratio": 3.1294117647058823,
"config_test": false,
... |
"""AoC Day 18
Usage:
day18.py <filename> <num_rows>
day18.py (-h | --help)
day18.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
TRAP = '^'
SAFE = '.'
def tile_state(left, center, right):
if left == TRAP and center == TRAP and right == ... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day18/day18.py",
"copies": "1",
"size": "1546",
"license": "mit",
"hash": 3722772864896298000,
"line_mean": 23.935483871,
"line_max": 86,
"alpha_frac": 0.5614489004,
"autogenerated": false,
"ratio": 3.310492505353319,
"config_test": false,
"... |
"""AoC Day 19
Usage:
day19.py <num_elves>
day19.py (-h | --help)
day19.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def move_presents_from_across(presents):
dropped = 0
num_elves = len(presents)
i = 0
while i < len(present... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day19/day19.py",
"copies": "1",
"size": "1293",
"license": "mit",
"hash": -7927529908033005000,
"line_mean": 23.8653846154,
"line_max": 62,
"alpha_frac": 0.5630317092,
"autogenerated": false,
"ratio": 3.145985401459854,
"config_test": false,
... |
"""AoC Day 1
Usage:
day1.py <filename>
day1.py (-h | --help)
day1.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def get_directions(filename):
fn = open(filename, 'r')
directions = [x.strip() for x in fn.read().split(',')]
return... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day1/day1.py",
"copies": "1",
"size": "2085",
"license": "mit",
"hash": 4935492921131838000,
"line_mean": 23.8214285714,
"line_max": 72,
"alpha_frac": 0.5625899281,
"autogenerated": false,
"ratio": 3.6387434554973823,
"config_test": false,
"... |
"""AoC Day 20
Usage:
day20.py <filename>
day20.py (-h | --help)
day20.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def read_input_file(filename):
f = open(filename, 'r')
numbers = []
for i in f:
numbers.append(list(map... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day20/day20.py",
"copies": "1",
"size": "1518",
"license": "mit",
"hash": 4984235918004002000,
"line_mean": 22.3538461538,
"line_max": 69,
"alpha_frac": 0.5309617918,
"autogenerated": false,
"ratio": 3.481651376146789,
"config_test": false,
... |
"""AoC Day 2
Usage:
day2.py <filename>
day2.py (-h | --help)
day2.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import numpy as np
def parse_instructions(filename):
instructions = []
fn = open(filename, 'r')
for l in fn:
... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day2/day2.py",
"copies": "1",
"size": "2838",
"license": "mit",
"hash": 123733510677874830,
"line_mean": 26.0285714286,
"line_max": 69,
"alpha_frac": 0.5916138125,
"autogenerated": false,
"ratio": 3.1923509561304835,
"config_test": false,
"h... |
"""AoC Day 3
Usage:
day3.py <filename>
day3.py (-h | --help)
day3.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def is_triangle(t):
a = t[0]
b = t[1]
c = t[2]
if (a + b > c) and (a + c > b) and (b + c > a):
return Tr... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day3/day3.py",
"copies": "1",
"size": "1398",
"license": "mit",
"hash": -8273505580315922000,
"line_mean": 20.84375,
"line_max": 68,
"alpha_frac": 0.530758226,
"autogenerated": false,
"ratio": 3.1557562076749437,
"config_test": false,
"has_n... |
"""AoC Day 4
Usage:
day4.py <filename>
day4.py (-h | --help)
day4.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
import re
from docopt import docopt
from collections import defaultdict
def is_real_room(name, checksum):
name = name.translate(None, "-")
freq = ... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day4/day4.py",
"copies": "1",
"size": "2020",
"license": "mit",
"hash": 1329860324608635100,
"line_mean": 24.8974358974,
"line_max": 91,
"alpha_frac": 0.5252475248,
"autogenerated": false,
"ratio": 3.263327948303716,
"config_test": false,
"h... |
"""AoC Day 5
Usage:
day5.py <input>
day5.py (-h | --help)
day5.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import hashlib
def find_8ch_ordered_pw(input):
pw = ""
count = 0
while len(pw) < 8:
m = hashlib.md5()
m... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day5/day5.py",
"copies": "1",
"size": "1100",
"license": "mit",
"hash": 4861020407500950000,
"line_mean": 20.1538461538,
"line_max": 46,
"alpha_frac": 0.5063636364,
"autogenerated": false,
"ratio": 3.3033033033033035,
"config_test": false,
"... |
"""AoC Day 6
Usage:
day6.py <filename>
day6.py (-h | --help)
day6.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def update_char_count_dict(line, count_dict):
line = line.rstrip()
for i in range(len(line)):
if line[i] in coun... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day6/day6.py",
"copies": "1",
"size": "1100",
"license": "mit",
"hash": -4889100872572302000,
"line_mean": 21,
"line_max": 67,
"alpha_frac": 0.5718181818,
"autogenerated": false,
"ratio": 3.160919540229885,
"config_test": false,
"has_no_keyw... |
"""AoC Day 7
Usage:
day7.py <filename>
day7.py (-h | --help)
day7.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import re
def find_all_bab(ip):
bab = []
if len(ip) >= 3:
address = [ip[0], ip[1]]
for i in range(2, l... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day7/day7.py",
"copies": "1",
"size": "2488",
"license": "mit",
"hash": -6333497820819321000,
"line_mean": 22.4716981132,
"line_max": 92,
"alpha_frac": 0.4569935691,
"autogenerated": false,
"ratio": 3.43646408839779,
"config_test": false,
"h... |
"""AoC Day 8
Usage:
day8.py <width> <tall> <filename>
day8.py (-h | --help)
day8.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
import re
class Display:
def __init__(self, width, tall):
self.width = width
self.tall = tall... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day8/day8.py",
"copies": "1",
"size": "2433",
"license": "mit",
"hash": -7911872293658624000,
"line_mean": 29.037037037,
"line_max": 77,
"alpha_frac": 0.5318536786,
"autogenerated": false,
"ratio": 3.588495575221239,
"config_test": false,
"h... |
"""AoC Day 9
Usage:
day9.py <filename>
day9.py (-h | --help)
day9.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
def decompress_length_ver2(string):
length = 0
i = 0
while i < len(string):
if string[i] == '(':
... | {
"repo_name": "arink/advent-of-code",
"path": "2016/day9/day9.py",
"copies": "1",
"size": "1524",
"license": "mit",
"hash": -7464098797757518000,
"line_mean": 21.0869565217,
"line_max": 97,
"alpha_frac": 0.5144356955,
"autogenerated": false,
"ratio": 3.4247191011235953,
"config_test": false,
... |
"""A one line summary of the module or program, terminated by a period.
Leave one blank line. The rest of this docstring should contain an
overall description of the module or program. Optionally, it may also
contain a brief description of exported classes and functions and/or usage
examples.
Typical usage exampl... | {
"repo_name": "GreenSteam/pep257",
"path": "src/tests/test_cases/canonical_google_examples.py",
"copies": "3",
"size": "4176",
"license": "mit",
"hash": 3283959215609520600,
"line_mean": 37.6666666667,
"line_max": 79,
"alpha_frac": 0.6829501916,
"autogenerated": false,
"ratio": 3.8846511627906977... |
# a one-solution labyrinth generator
# outputs: text (debug) or bitmap (TGA)
# algorithm: dumb (blind) or smart (maintains a TODO list)
# Ange Albertini, BSD Licence 2013
# output functions #############################################################
def printmap():
for j in xrange(HEIGHT):
... | {
"repo_name": "angea/corkami",
"path": "misc/laby/laby.py",
"copies": "1",
"size": "3954",
"license": "bsd-2-clause",
"hash": 1656759654508526300,
"line_mean": 21.5357142857,
"line_max": 81,
"alpha_frac": 0.4367728882,
"autogenerated": false,
"ratio": 3.4472537053182215,
"config_test": false,
... |
a = open("Q11.txt")
import numpy as np
import operator
def mulprod(x):
return reduce(operator.mul, x, 1)
grid = []
for i in a.read().strip().split('\n'):
grid.append(map(int, i.strip().split(' ')))
grid = np.array(grid)
## horizental
max_sum = 0
for i in range(0,20):
for j in range(0,17):
cur = m... | {
"repo_name": "weiwang/project_euler",
"path": "python/Q11.py",
"copies": "1",
"size": "1218",
"license": "mit",
"hash": -3390894165758793000,
"line_mean": 26.0666666667,
"line_max": 67,
"alpha_frac": 0.4958949097,
"autogenerated": false,
"ratio": 2.465587044534413,
"config_test": false,
"has... |
a = open("starsin_new_all_ordered.txt",'r')
a = open("test4_selfg.txt",'r')
a = open("test14.txt",'r')
a = open("test18.txt",'r')
al = a.readlines()
bl = []
name = []
for each in al:
name.append(each.split()[1])
name_ind = []
name_ind_first = []
name_u = unique(name)
name = array(name)
for each in name_u:
pi... | {
"repo_name": "mkness/TheCannon",
"path": "code/ages.py",
"copies": "1",
"size": "1723",
"license": "mit",
"hash": 5521604477395461000,
"line_mean": 25.5076923077,
"line_max": 159,
"alpha_frac": 0.5983749275,
"autogenerated": false,
"ratio": 2.008158508158508,
"config_test": false,
"has_no_ke... |
a = open('test14_edited_own.txt', 'r')
ta,ga,feha =loadtxt('test14_edited_own.txt', usecols = (3,5,7), unpack =1)
tc,gc,fehc =loadtxt('test14_edited_own.txt', usecols = (4,6,8), unpack =1)
#a = open('test14.txt', 'r')
al = a.readlines()
name = []
bl = []
for each in al:
name.append(each.split()[1])
bl.append... | {
"repo_name": "mkness/TheCannon",
"path": "code/fitiso_apogeetempfeh.py",
"copies": "1",
"size": "4621",
"license": "mit",
"hash": -8588441183202854000,
"line_mean": 32.2446043165,
"line_max": 190,
"alpha_frac": 0.584938325,
"autogenerated": false,
"ratio": 2.0338908450704225,
"config_test": fa... |
# A OpenTraced client for a Python service that implements the store interface.
from __future__ import print_function
import time
import argparse
from builtins import input, range
import grpc
from jaeger_client import Config
from grpc_opentracing import open_tracing_client_interceptor, \
... | {
"repo_name": "yuewko/themis",
"path": "vendor/github.com/grpc-ecosystem/grpc-opentracing/python/examples/store/store_client.py",
"copies": "4",
"size": "7169",
"license": "apache-2.0",
"hash": -2520362107607347000,
"line_mean": 32.9763033175,
"line_max": 80,
"alpha_frac": 0.5960384991,
"autogenera... |
# A OpenTraced server for a Python service that implements the store interface.
from __future__ import print_function
import time
import argparse
from collections import defaultdict
from six import iteritems
import grpc
from concurrent import futures
from jaeger_client import Config
from grpc_opentracing import ope... | {
"repo_name": "johnbelamaric/themis",
"path": "vendor/github.com/grpc-ecosystem/grpc-opentracing/python/examples/store/store_server.py",
"copies": "4",
"size": "3747",
"license": "apache-2.0",
"hash": 3250750088118991400,
"line_mean": 29.7131147541,
"line_max": 79,
"alpha_frac": 0.6394448892,
"auto... |
"""aospy DataLoader objects"""
import logging
import os
import pprint
import warnings
import numpy as np
import xarray as xr
from .internal_names import (
ETA_STR,
GRID_ATTRS,
TIME_STR,
TIME_BOUNDS_STR,
)
from .utils import times, io
def _preprocess_and_rename_grid_attrs(func, grid_attrs=None, **kwa... | {
"repo_name": "spencerkclark/aospy",
"path": "aospy/data_loader.py",
"copies": "1",
"size": "27430",
"license": "apache-2.0",
"hash": 6683652013243506000,
"line_mean": 39.0437956204,
"line_max": 79,
"alpha_frac": 0.6043018593,
"autogenerated": false,
"ratio": 4.141627661180734,
"config_test": f... |
"""aospy DataLoader objects"""
import logging
import os
import pprint
import numpy as np
import xarray as xr
from .internal_names import (
ETA_STR,
GRID_ATTRS,
TIME_STR,
)
from .utils import times, io
def _preprocess_and_rename_grid_attrs(func, grid_attrs=None, **kwargs):
"""Call a custom preprocess... | {
"repo_name": "spencerahill/aospy",
"path": "aospy/data_loader.py",
"copies": "1",
"size": "25915",
"license": "apache-2.0",
"hash": 3075672740497129000,
"line_mean": 37.9114114114,
"line_max": 79,
"alpha_frac": 0.5997684739,
"autogenerated": false,
"ratio": 4.135152385511409,
"config_test": fa... |
"""aospy.Model objects associated w/ GFDL climate models."""
import datetime
from aospy import Model
from .. import runs
am2 = Model(
name='am2',
grid_file_paths=(
('/archive/Spencer.Hill/am2/am2clim_reyoi/gfdl.ncrc2-default-prod/'
'pp/atmos/atmos.static.nc'),
('/archive/Spencer.Hil... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/models/gfdl_models.py",
"copies": "1",
"size": "10250",
"license": "apache-2.0",
"hash": -2242017832286169600,
"line_mean": 30.1550151976,
"line_max": 81,
"alpha_frac": 0.5857560976,
"autogenerated": false,
"ratio": 2.377638598932962... |
"""aospy.Model objects corresponding to CMIP5 data."""
import datetime
import os
from aospy.model import Model
from .. import runs
root_dir = '/archive/pcmdi/repo/CMIP5/output/'
# BCC
bcc_csm1 = Model(
name='bcc_csm1-1',
description='',
# data_dir_struc='gfdl_repo',
# data_direc=os.path.realpath(os.... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/models/cmip5_models.py",
"copies": "1",
"size": "18439",
"license": "apache-2.0",
"hash": 5292037132025496000,
"line_mean": 29.7829716194,
"line_max": 91,
"alpha_frac": 0.6409783611,
"autogenerated": false,
"ratio": 2.314712528245041... |
"""aospy Model objects corresponding to observational & renalayses data."""
import datetime
from aospy.model import Model
from .. import runs
# Precipitation
cru = Model(
name='cru',
description='Univ. East Anglia Climate Research Unit obs',
grid_file_paths=('/archive/Spencer.Hill/obs/HadCRU/3.22/'
... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/models/obs_models.py",
"copies": "1",
"size": "8015",
"license": "apache-2.0",
"hash": 6435464503015499000,
"line_mean": 35.598173516,
"line_max": 86,
"alpha_frac": 0.6348097318,
"autogenerated": false,
"ratio": 2.7105174163003043,
... |
"""aospy.Run objects for observational data."""
import datetime
from aospy.run import Run
from aospy.data_loader import NestedDictDataLoader
# CRU
cru_v322 = Run(
name='v3.22',
description='CRU v3.22',
data_direc='/archive/Spencer.Hill/obs/HadCRU/3.22',
data_dur=113,
data_start_date=datetime.datet... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/obs_runs.py",
"copies": "1",
"size": "21332",
"license": "apache-2.0",
"hash": 2071836269344356600,
"line_mean": 42.7131147541,
"line_max": 79,
"alpha_frac": 0.5732233265,
"autogenerated": false,
"ratio": 2.6062309102015884,
"... |
"""aospy.Run objects for simulations from the GFDL HiRAM model."""
import datetime
from aospy import Run
from aospy.data_loader import GFDLDataLoader
hiram_cont = Run(
name='cont',
description=(
'1981-2000 HadISST climatological annual cycle of SSTs '
'and sea ice repeated annually, with PD a... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/hiram_runs.py",
"copies": "1",
"size": "6123",
"license": "apache-2.0",
"hash": 6103408727792456000,
"line_mean": 37.5094339623,
"line_max": 79,
"alpha_frac": 0.639229136,
"autogenerated": false,
"ratio": 2.940922190201729,
"c... |
"""aospy.Run objects for simulations from various GFDL models."""
import datetime
from aospy import Run
from aospy.data_loader import GFDLDataLoader
# SM2.1
sm2_cont = Run(
name='cont',
data_loader=GFDLDataLoader(
data_direc=('/archive/Yi.Ming/sm2.1_fixed/SM2.1U_Control-1860_lm2_aie'
... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/gfdl_runs.py",
"copies": "1",
"size": "8778",
"license": "apache-2.0",
"hash": -8567861114673584000,
"line_mean": 30.1276595745,
"line_max": 79,
"alpha_frac": 0.5926179084,
"autogenerated": false,
"ratio": 2.429559922502076,
"... |
"""aospy.Run objects for the CMIP5 Project."""
import datetime
from aospy import Run
onepctCO2 = Run(
name='1pctCO2',
description='Coupled; 1% increase in CO2 per year from PI',
)
abrupt4xCO2 = Run(
name='abrupt4xCO2',
description='Coupled; Instantaneous 4X CO2 increase',
)
amip = Run(
name='amip'... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/cmip5_runs.py",
"copies": "1",
"size": "1857",
"license": "apache-2.0",
"hash": -6651167933789053000,
"line_mean": 21.9259259259,
"line_max": 63,
"alpha_frac": 0.6596661282,
"autogenerated": false,
"ratio": 2.8394495412844036,
... |
"""aospy.Run objects library for simulations in GFDL AM2.1 model."""
import datetime
from aospy import Run
from aospy.data_loader import GFDLDataLoader
_old_runs_dataloader = GFDLDataLoader(
data_dur=16,
data_start_date=datetime.datetime(1983, 1, 1),
data_end_date=datetime.datetime(1998, 12, 31)
)
_new_r... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/am2_runs.py",
"copies": "1",
"size": "29101",
"license": "apache-2.0",
"hash": -5432856399557605000,
"line_mean": 34.3596597813,
"line_max": 79,
"alpha_frac": 0.6197037902,
"autogenerated": false,
"ratio": 2.718957301691115,
"... |
"""aospy.Run objects library for simulations in GFDL AM3 model."""
import datetime
from aospy import Run
from aospy.data_loader import GFDLDataLoader
_old_runs_dataloader = GFDLDataLoader(
data_start_date=datetime.datetime(1981, 1, 1),
data_end_date=datetime.datetime(2000, 12, 31),
data_dur=20
)
_new_runs... | {
"repo_name": "spencerahill/aospy-obj-lib",
"path": "aospy_user/runs/am3_runs.py",
"copies": "1",
"size": "10614",
"license": "apache-2.0",
"hash": -1755003917876972000,
"line_mean": 34.4983277592,
"line_max": 79,
"alpha_frac": 0.6277557942,
"autogenerated": false,
"ratio": 2.6966463414634148,
... |
# APACHE 2.0 LICENSE
# 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
... | {
"repo_name": "sonictt1/material_game_store",
"path": "WebStoreObjects.py",
"copies": "1",
"size": "1918",
"license": "apache-2.0",
"hash": -6641149519570625000,
"line_mean": 27.0606060606,
"line_max": 62,
"alpha_frac": 0.6402502607,
"autogenerated": false,
"ratio": 3.930327868852459,
"config_t... |
"""Apache Beam pipeline to run the prover.
This beam pipeline and DoFns runs the prover and creates proof-logs.
"""
from __future__ import absolute_import
from __future__ import division
# Import Type Annotations
from __future__ import print_function
import apache_beam as beam
from apache_beam.metrics import Metrics... | {
"repo_name": "tensorflow/deepmath",
"path": "deepmath/deephol/deephol_loop/prover_runner.py",
"copies": "1",
"size": "6658",
"license": "apache-2.0",
"hash": 2790716001988461000,
"line_mean": 35.7845303867,
"line_max": 79,
"alpha_frac": 0.6880444578,
"autogenerated": false,
"ratio": 3.4143589743... |
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import filecmp
import itertools
import logging
import os
import re
import shutil
import socket
import subprocess
import zope.interface
from acme import challenges
from letsencrypt import achallenges
from letsencrypt import ... | {
"repo_name": "g1franc/lets-encrypt-preview",
"path": "letsencrypt-apache/letsencrypt_apache/configurator.py",
"copies": "1",
"size": "47978",
"license": "apache-2.0",
"hash": 5661686477286642000,
"line_mean": 37.0475812847,
"line_max": 90,
"alpha_frac": 0.5995456251,
"autogenerated": false,
"rat... |
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import filecmp
import itertools
import logging
import os
import re
import shutil
import socket
import time
import zope.interface
from acme import challenges
from letsencrypt import errors
from letsencrypt import interfaces
... | {
"repo_name": "FuzzyHobbit/letsencrypt",
"path": "letsencrypt-apache/letsencrypt_apache/configurator.py",
"copies": "1",
"size": "54609",
"license": "apache-2.0",
"hash": 5659179938704364000,
"line_mean": 37.9507845934,
"line_max": 95,
"alpha_frac": 0.5928876193,
"autogenerated": false,
"ratio": ... |
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import filecmp
import logging
import os
import re
import shutil
import socket
import time
import zope.component
import zope.interface
from acme import challenges
from letsencrypt import errors
from letsencrypt import interf... | {
"repo_name": "thanatos/lets-encrypt-preview",
"path": "letsencrypt-apache/letsencrypt_apache/configurator.py",
"copies": "1",
"size": "65352",
"license": "apache-2.0",
"hash": 2488028904338446000,
"line_mean": 38.7276595745,
"line_max": 125,
"alpha_frac": 0.5788652222,
"autogenerated": false,
"r... |
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import fnmatch
import logging
import os
import re
import socket
import time
import zope.component
import zope.interface
from acme import challenges
from certbot import errors
from certbot import interfaces
from certbot impo... | {
"repo_name": "jsha/letsencrypt",
"path": "certbot-apache/certbot_apache/configurator.py",
"copies": "1",
"size": "79961",
"license": "apache-2.0",
"hash": 2641867605399568000,
"line_mean": 38.4285009862,
"line_max": 92,
"alpha_frac": 0.5836720401,
"autogenerated": false,
"ratio": 4.2131303019126... |
"""Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import itertools
import logging
import os
import re
import shutil
import socket
import subprocess
import zope.interface
from acme import challenges
from letsencrypt import achallenges
from letsencrypt import errors
from let... | {
"repo_name": "ruo91/letsencrypt",
"path": "letsencrypt-apache/letsencrypt_apache/configurator.py",
"copies": "2",
"size": "46229",
"license": "apache-2.0",
"hash": -6891212435212530000,
"line_mean": 36.9548440066,
"line_max": 90,
"alpha_frac": 0.599775033,
"autogenerated": false,
"ratio": 4.1980... |
apache_conf = """
# Sample apache config for Fabulous django deployment.
NameVirtualHost *:80
<VirtualHost *:80>
WSGIDaemonProcess %(project_name)s \
processes=2 threads=5 display-name=%(project_name)s
#
# URL mapping
#
WSGIScriptAlias / %(conf_path)s/wsgi.py
Alias /media/ %(media_pa... | {
"repo_name": "ryanwitt/django-liberace",
"path": "liberace/templates.py",
"copies": "1",
"size": "1716",
"license": "bsd-2-clause",
"hash": -8779147127072716000,
"line_mean": 23.5142857143,
"line_max": 69,
"alpha_frac": 0.6882284382,
"autogenerated": false,
"ratio": 3.5527950310559007,
"config... |
"""ApacheDVSNI"""
import logging
import os
from letsencrypt_apache import parser
class ApacheDvsni(object):
"""Class performs DVSNI challenges within the Apache configurator.
:ivar configurator: ApacheConfigurator object
:type configurator: :class:`~apache.configurator.ApacheConfigurator`
:ivar lis... | {
"repo_name": "felixrieseberg/lets-encrypt-preview",
"path": "letsencrypt_apache/dvsni.py",
"copies": "1",
"size": "7071",
"license": "apache-2.0",
"hash": 4050047115574304000,
"line_mean": 34.1791044776,
"line_max": 80,
"alpha_frac": 0.6284825343,
"autogenerated": false,
"ratio": 4.0176136363636... |
"""ApacheDVSNI"""
import os
from letsencrypt.plugins import common
from letsencrypt_apache import obj
from letsencrypt_apache import parser
class ApacheDvsni(common.Dvsni):
"""Class performs DVSNI challenges within the Apache configurator.
:ivar configurator: ApacheConfigurator object
:type configurato... | {
"repo_name": "rlustin/letsencrypt",
"path": "letsencrypt-apache/letsencrypt_apache/dvsni.py",
"copies": "28",
"size": "5735",
"license": "apache-2.0",
"hash": 6575487269193468000,
"line_mean": 32.5380116959,
"line_max": 80,
"alpha_frac": 0.6359197908,
"autogenerated": false,
"ratio": 3.904016337... |
"""ApacheDVSNI"""
import os
from letsencrypt.plugins import common
from letsencrypt_apache import parser
class ApacheDvsni(common.Dvsni):
"""Class performs DVSNI challenges within the Apache configurator.
:ivar configurator: ApacheConfigurator object
:type configurator: :class:`~apache.configurator.Apa... | {
"repo_name": "stewnorriss/letsencrypt",
"path": "letsencrypt-apache/letsencrypt_apache/dvsni.py",
"copies": "4",
"size": "5114",
"license": "apache-2.0",
"hash": 2907816355525054000,
"line_mean": 33.7891156463,
"line_max": 78,
"alpha_frac": 0.6384434885,
"autogenerated": false,
"ratio": 4.052297... |
"""ApacheLibcloud datastore."""
from datetime import datetime
from io import BytesIO
from itertools import islice
from cloud_browser.app_settings import settings
from cloud_browser.cloud import base, errors
from cloud_browser.common import SEP, requires
################################################################... | {
"repo_name": "ryan-roemer/django-cloud-browser",
"path": "cloud_browser/cloud/apache_libcloud.py",
"copies": "1",
"size": "5718",
"license": "mit",
"hash": 7292140827018596000,
"line_mean": 30.4175824176,
"line_max": 88,
"alpha_frac": 0.5772997552,
"autogenerated": false,
"ratio": 4.541699761715... |
from flask.ext.restful import reqparse
########################################################################################################################
# #
# ... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/resources/depict/base.py",
"copies": "1",
"size": "2812",
"license": "apache-2.0",
"hash": -8475538827221935000,
"line_mean": 57.5833333333,
"line_max": 120,
"alpha_frac": 0.6081081081,
"autogenerated": false,
"ratio": 4.32... |
from flask import Response
import base64
import zlib
# noinspection PyUnresolvedReferences
import sys
from openeye.oechem import *
from openeye.oedepict import *
############################
# Python 2/3 Compatibility #
############################
try:
from gzip import compress
except ImportError:
# Compr... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/common/util.py",
"copies": "1",
"size": "8398",
"license": "apache-2.0",
"hash": 871569826599552900,
"line_mean": 34.8888888889,
"line_max": 120,
"alpha_frac": 0.5579899976,
"autogenerated": false,
"ratio": 4.39916186485070... |
from oemicroservices.api import app
# FIXME Known 2015.Feb error: threaded=True will cause the OEDocking call in interaction.py to core dump
if __name__ == '__main__':
app.run(debug=False, threaded=False)
| {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "server.py",
"copies": "1",
"size": "1062",
"license": "apache-2.0",
"hash": -2187679873858167300,
"line_mean": 39.8461538462,
"line_max": 104,
"alpha_frac": 0.7598870056,
"autogenerated": false,
"ratio": 3.962686567164179,
"config_test":... |
from openeye.oechem import *
class OEHasResidueName(OEUnaryAtomPred):
"""
Predicate functor to get atoms with a specific residue name
"""
def __init__(self, resn):
"""
Default constructor
:param resn: The residue name
:type resn: str
:return:
"""
... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/common/functor.py",
"copies": "1",
"size": "2688",
"license": "apache-2.0",
"hash": 8019828669527212000,
"line_mean": 33.0253164557,
"line_max": 72,
"alpha_frac": 0.6752232143,
"autogenerated": false,
"ratio": 3.71270718232... |
from setuptools import setup
setup(
name='OEMicroservices',
version='1.2',
packages=['oemicroservices', 'oemicroservices.test', 'oemicroservices.common', 'oemicroservices.resources',
'oemicroservices.resources.depict', 'oemicroservices.resources.convert'],
url='https://github.com/OpenEye... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "setup.py",
"copies": "1",
"size": "1465",
"license": "apache-2.0",
"hash": -3204714593086559000,
"line_mean": 39.6944444444,
"line_max": 111,
"alpha_frac": 0.7467576792,
"autogenerated": false,
"ratio": 3.785529715762274,
"config_test": ... |
from unittest import TestCase
import os
from openeye.oechem import *
from oemicroservices.common.functor import generate_ligand_functor
# Define the resource files relative to this test file because setup.py will run from the root package directory
# but some IDEs will run the tests from within the tests directory.... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/test/test_misc.py",
"copies": "1",
"size": "1738",
"license": "apache-2.0",
"hash": -1692197566039932000,
"line_mean": 37.6222222222,
"line_max": 112,
"alpha_frac": 0.7359033372,
"autogenerated": false,
"ratio": 3.845132743... |
from unittest import TestCase
import os
try:
# Python 3.x
from urllib.parse import quote
except ImportError:
# Python 2.x
from urllib import quote
from oemicroservices.common.util import compress_string
from oemicroservices.api import app
# Define the resource files relative to this test file becaus... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/test/test_moleculeDepictor.py",
"copies": "1",
"size": "2754",
"license": "apache-2.0",
"hash": 2083266917536613400,
"line_mean": 39.5,
"line_max": 112,
"alpha_frac": 0.7171387073,
"autogenerated": false,
"ratio": 3.6867469... |
import json
from flask.ext.restful import Resource, request
from flask import Response
from openeye.oechem import *
from openeye.oedepict import *
from openeye.oegrapheme import *
from openeye.oedocking import *
from oemicroservices.resources.depict.base import depictor_base_arg_parser
from oemicroservices.common.f... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/resources/depict/interaction.py",
"copies": "1",
"size": "16191",
"license": "apache-2.0",
"hash": 8333972789464820000,
"line_mean": 47.915407855,
"line_max": 120,
"alpha_frac": 0.454882342,
"autogenerated": false,
"ratio":... |
import json
from flask.ext.restful import Resource, request
from flask import Response
from openeye.oechem import *
from openeye.oedepict import *
from oemicroservices.resources.depict.base import depictor_base_arg_parser
from oemicroservices.common.util import (
render_error_image,
get_image_mime_type,
... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/resources/depict/molecule.py",
"copies": "1",
"size": "8982",
"license": "apache-2.0",
"hash": -4955658497356552000,
"line_mean": 45.78125,
"line_max": 120,
"alpha_frac": 0.5160320641,
"autogenerated": false,
"ratio": 4.965... |
import json
# noinspection PyUnresolvedReferences
import sys
from flask.ext.restful import Resource, request
from flask import Response
from openeye.oechem import *
from oemicroservices.common.util import compress_string, read_molecule_from_string
############################
# Python 2/3 Compatibility #
##########... | {
"repo_name": "OpenEye-Contrib/OEMicroservices",
"path": "oemicroservices/resources/convert/convert.py",
"copies": "1",
"size": "8652",
"license": "apache-2.0",
"hash": 6899156891277649000,
"line_mean": 53.7594936709,
"line_max": 120,
"alpha_frac": 0.3973647712,
"autogenerated": false,
"ratio": 6... |
# Apache License 2.0
import sys
import os
import glob
import verify
class VerifyAll:
def verify_file(self, file, log):
class ErrorCounter:
def __init__(self):
self.count = 0
def error_handler(self, label, msg):
self.count += 1
retur... | {
"repo_name": "kryptine/ghilbert",
"path": "verify_all.py",
"copies": "2",
"size": "1574",
"license": "apache-2.0",
"hash": 7963067282689203000,
"line_mean": 26.6140350877,
"line_max": 79,
"alpha_frac": 0.5235069886,
"autogenerated": false,
"ratio": 4.077720207253886,
"config_test": false,
"h... |
''' Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,... | {
"repo_name": "ihateprog/Test",
"path": "getbiochembl.py",
"copies": "1",
"size": "20284",
"license": "apache-2.0",
"hash": -7155220196167023000,
"line_mean": 43.8761061947,
"line_max": 150,
"alpha_frac": 0.6580063104,
"autogenerated": false,
"ratio": 4.0406374501992035,
"config_test": false,
... |
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
impo... | {
"repo_name": "MJJoyce/climate",
"path": "examples/time_series_with_regions.py",
"copies": "2",
"size": "5020",
"license": "apache-2.0",
"hash": -8047421824674275000,
"line_mean": 33.6206896552,
"line_max": 120,
"alpha_frac": 0.7217131474,
"autogenerated": false,
"ratio": 2.7193932827735643,
"c... |
# Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
imp... | {
"repo_name": "huikyole/climate",
"path": "examples/time_series_with_regions.py",
"copies": "2",
"size": "5382",
"license": "apache-2.0",
"hash": -5687372764472458000,
"line_mean": 34.642384106,
"line_max": 80,
"alpha_frac": 0.6791155704,
"autogenerated": false,
"ratio": 2.9170731707317072,
"co... |
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
impo... | {
"repo_name": "riverma/climate",
"path": "examples/time_series_with_regions.py",
"copies": "2",
"size": "4892",
"license": "apache-2.0",
"hash": -8943550389226853000,
"line_mean": 33.695035461,
"line_max": 120,
"alpha_frac": 0.7205641864,
"autogenerated": false,
"ratio": 2.7027624309392264,
"co... |
# Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
imp... | {
"repo_name": "jarifibrahim/climate",
"path": "examples/multi_model_taylor_diagram.py",
"copies": "2",
"size": "5106",
"license": "apache-2.0",
"hash": 9039999506548922000,
"line_mean": 33.7346938776,
"line_max": 124,
"alpha_frac": 0.6627497062,
"autogenerated": false,
"ratio": 3.2920696324951644... |
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import datetime
impo... | {
"repo_name": "pwcberry/climate",
"path": "examples/multi_model_taylor_diagram.py",
"copies": "2",
"size": "5025",
"license": "apache-2.0",
"hash": 2719667160667418600,
"line_mean": 33.8958333333,
"line_max": 135,
"alpha_frac": 0.7064676617,
"autogenerated": false,
"ratio": 3.043609933373713,
"... |
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import dat... | {
"repo_name": "MBoustani/climate",
"path": "examples/subregions_portrait_diagram.py",
"copies": "2",
"size": "5313",
"license": "apache-2.0",
"hash": -3772879987851073500,
"line_mean": 35.4154929577,
"line_max": 126,
"alpha_frac": 0.6802183324,
"autogenerated": false,
"ratio": 2.854916711445459,
... |
# Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import da... | {
"repo_name": "jarifibrahim/climate",
"path": "examples/subregions_portrait_diagram.py",
"copies": "2",
"size": "5713",
"license": "apache-2.0",
"hash": 3883286699853921300,
"line_mean": 36.3422818792,
"line_max": 93,
"alpha_frac": 0.6325923333,
"autogenerated": false,
"ratio": 3.0682062298603654... |
#Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import dat... | {
"repo_name": "pwcberry/climate",
"path": "examples/subregions_portrait_diagram.py",
"copies": "2",
"size": "5162",
"license": "apache-2.0",
"hash": -1179751274766546700,
"line_mean": 35.1366906475,
"line_max": 112,
"alpha_frac": 0.6778380473,
"autogenerated": false,
"ratio": 2.8393839383938393,
... |
# Apache OCW lib immports
from ocw.dataset import Dataset, Bounds
import ocw.data_source.local as local
import ocw.data_source.rcmed as rcmed
import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
import ocw.utils as utils
import da... | {
"repo_name": "jarifibrahim/climate",
"path": "examples/subregions_rectangular_boundaries.py",
"copies": "2",
"size": "1712",
"license": "apache-2.0",
"hash": 8874012017345808000,
"line_mean": 31.568627451,
"line_max": 57,
"alpha_frac": 0.636682243,
"autogenerated": false,
"ratio": 2.371191135734... |
#Apache OCW lib immports
import ocw.data_source.local as local
import ocw.plotter as plotter
import ocw.utils as utils
from ocw.evaluation import Evaluation
import ocw.metrics as metrics
# Python libraries
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
from mpl_toolkits.basemap imp... | {
"repo_name": "pwcberry/climate",
"path": "examples/configuration_file_examples/metrics_and_plots.py",
"copies": "1",
"size": "9338",
"license": "apache-2.0",
"hash": -6898481135363852000,
"line_mean": 40.6392694064,
"line_max": 154,
"alpha_frac": 0.6157635468,
"autogenerated": false,
"ratio": 3.... |
"""ApacheParser is a member object of the ApacheConfigurator class."""
import copy
import fnmatch
import logging
import os
import re
import subprocess
import sys
import six
from certbot import errors
from certbot_apache import constants
logger = logging.getLogger(__name__)
class ApacheParser(object):
"""Class... | {
"repo_name": "jsha/letsencrypt",
"path": "certbot-apache/certbot_apache/parser.py",
"copies": "1",
"size": "27616",
"license": "apache-2.0",
"hash": 263746932729016600,
"line_mean": 36.9862448418,
"line_max": 91,
"alpha_frac": 0.5740874855,
"autogenerated": false,
"ratio": 4.195047850524078,
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.