text stringlengths 4 1.02M | meta dict |
|---|---|
from flask import request, render_template
from flask_paginate import Pagination, get_page_parameter
from .. import db
from . import gallery
@gallery.route('/<name>')
def gallery(name):
page = request.args.get(get_page_parameter(), type=int, default=1)
sql = "SELECT date,url FROM `gallery` WHERE name=%s ORDE... | {
"content_hash": "c98de9f36670c3232cddde71e0cc2328",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 100,
"avg_line_length": 31.20689655172414,
"alnum_prop": 0.5464088397790056,
"repo_name": "JR--Chen/flasky",
"id": "e6b286399771daf4396b63cd767fd4e3f1325fd3",
"size": "1810... |
from urllib.parse import urlencode, urlparse, parse_qsl
from django.shortcuts import render, get_object_or_404
from django.conf import settings
from haystack.query import SearchQuerySet
from haystack.views import FacetedSearchView
from .forms import RulingSearchForm
from .models import Ruling
default_sqs = (Search... | {
"content_hash": "820b5447e2de9bc05549a80cfe8f188c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 30.25,
"alnum_prop": 0.6495867768595042,
"repo_name": "netzwerkrecherche/auskunftsrecht",
"id": "63eb4adedcf5a391aa4e2004090b677bb29113a6",
"size": "... |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisNicBjStatusAvailable(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.nic.bj/status_available.txt"
host = "whois.nic.bj"
part = yawhois.record.Part(... | {
"content_hash": "083c173333fafa0187c3991b9a50fb93",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 95,
"avg_line_length": 34.38181818181818,
"alnum_prop": 0.6805922792173453,
"repo_name": "huyphan/pyyawhois",
"id": "dd36b25b275dd7e4c2df44bc128334d8cafce3ac",
"size": "215... |
from docker_registry_client import BaseClient
import pkg_resources
def test_base_client(registry):
cli = BaseClient('http://localhost:5000', api_version=2)
assert cli.catalog() == {'repositories': []}
def test_base_client_edit_manifest(docker_client, registry):
cli = BaseClient('http://localhost:5000', ... | {
"content_hash": "262e6164da4e88ddd1d0202606205839",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 70,
"avg_line_length": 29.693877551020407,
"alnum_prop": 0.6274914089347079,
"repo_name": "yodle/docker-registry-client",
"id": "6ac2bdfc503e590ca1d1017b694b6d4c2e6fbf21",
... |
import time
import datetime
import subprocess
import multiprocessing
import argparse
import TestConfig
import Configs
import ZfsApi
import Pid
import Common
import MonitorThread
import ReceiveThread
import Results
parser = argparse.ArgumentParser()
parser.add_argument('-v', '--verbose', action="store_true",
he... | {
"content_hash": "5ea8fb14eef407d2c2fa09f904658eb3",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 82,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.7394502516453736,
"repo_name": "datto/zfs-tests",
"id": "3861d31844cd9b755a241438fe61eb8506e0ba73",
"size": "2583... |
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... | {
"content_hash": "bf5dc8693f41d52e2f26178113cec9e5",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 103,
"avg_line_length": 39.382716049382715,
"alnum_prop": 0.5971786833855799,
"repo_name": "oostapenko84/python_training",
"id": "396255f605251004a31aa193d4368b72212b934a",
... |
import unittest
from popper.parser import WorkflowParser
from popper.cli import log
class TestWorkflow(unittest.TestCase):
def setUp(self):
log.setLevel("CRITICAL")
def tearDown(self):
log.setLevel("NOTSET")
def test_empty_file(self):
with open("/tmp/test.yml", "w"):
... | {
"content_hash": "7bde82f4e1329172df153cb75e36d06d",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 88,
"avg_line_length": 34.43103448275862,
"alnum_prop": 0.499749624436655,
"repo_name": "systemslab/popper",
"id": "afe1c028e99399ffd2fb834a00ddc76216d6c24c",
"size": "599... |
"""
genres.api
---
This module implements the Genres API.
"""
import logging
from . import finder, db
_db = None
def find(text):
"""
Tries to determine genres for the text.
"""
finder_obj = _create_finder()
return finder_obj.find(text)
def _get_database():
"""
Check if database has b... | {
"content_hash": "a8b21fda90b2874c4e6c41060ebf9e3d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 63,
"avg_line_length": 14.285714285714286,
"alnum_prop": 0.58,
"repo_name": "marteinn/genres",
"id": "ff97a1796973dc24ae2e0a3903069449e4c5c6b0",
"size": "625",
"binary": ... |
'''Unit tests for io.FileNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
import os
import StringIO
import unittest
from grit.node import misc
from grit.node import io
from grit.node import empty
from grit import grd_reader
from grit impor... | {
"content_hash": "ae66a9a351f66a03ff51a422e299c1f3",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 97,
"avg_line_length": 37.13103448275862,
"alnum_prop": 0.6028974739970282,
"repo_name": "JoKaWare/WTL-DUI",
"id": "6a7069b140d8a7bbeec78b68706410e9bb37d6ff",
"size": "557... |
'''
Test the output of a newly trained classifier.
'''
import numpy as np
import pandas as pd
import os, sys, glob, argparse
import cv2
import yaml
import pickle
sys.path.append('..')
from models.yolo_models import get_yolo_model, get_yolo_model_feats
from utils.decoder import decode
from utils.utils import md5check
... | {
"content_hash": "d742c3f662ba8fd317f5e419faba04e1",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 244,
"avg_line_length": 38.81578947368421,
"alnum_prop": 0.5001694915254238,
"repo_name": "ctorney/ungTracker",
"id": "9eff29c4457b91d7b1a1b21180484df6e77fedcf",
"size": "... |
'''
Created on Oct 2, 2012
@author: Rex White
'''
from optparse import OptionParser
from redhat_support_lib.api import API
import ConfigParser
import unittest
import os
import logging
__author__ = 'Rex White <rexwhite@redhat.com>'
class productTest(unittest.TestCase):
def setUp(self):
self.config = Conf... | {
"content_hash": "97321cc9404fd7bf7efeb9a8bda6f5e4",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 125,
"avg_line_length": 30.054347826086957,
"alnum_prop": 0.6007233273056057,
"repo_name": "redhataccess/redhat-support-lib-python",
"id": "4d7d00be648a6935a26693e7ebbc185ab5... |
import os
import logging
import sys
sys.path.insert(1, os.path.join(os.path.dirname(__file__), u'..'))
from tornado.ioloop import IOLoop
from tornado.httpserver import HTTPServer
from tornado.options import define, options
from tornado.httpclient import AsyncHTTPClient
from tormon import core
from tormon.core import ... | {
"content_hash": "28cf48b0d30523035a8ace5ae7c60904",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 87,
"avg_line_length": 29.516129032258064,
"alnum_prop": 0.6888888888888889,
"repo_name": "jnosal/tormon",
"id": "f29d3db3accb0b78d1a404b67209ea5e72641610",
"size": "2745",... |
import os, pprint, sys, math, numpy
from optparse import OptionParser
from netCDF4 import Dataset
def dir_entries(dir_path='', subdir=False, *args):
'''Return a list of file names found in directory 'dir_path'
If 'subdir' is True, recursively access subdirectories under 'dir_path'.
Additional arguments, if any, are... | {
"content_hash": "cdd81ed75f9f82edd2cbf2a1cf3795ae",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 128,
"avg_line_length": 37.71264367816092,
"alnum_prop": 0.7206644315757391,
"repo_name": "muellermichel/pyWRF-NMM",
"id": "626c32a7c16f2f8d91f090093d3927a406cda465",
"siz... |
import json
import os
import subprocess
import sys
env_var = 'GITLAB_SECRET_FILE_QUAY_CREDENTIALS'
if env_var not in os.environ:
print('Error: could not find environment variable ' + env_var)
sys.exit(1)
print('Starting quay.io login process...')
with open(os.environ[env_var], 'r') as f:
keys = json.load... | {
"content_hash": "898f30296f0a7454b423fd979d20458a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 105,
"avg_line_length": 33.6,
"alnum_prop": 0.6642857142857143,
"repo_name": "BD2KGenomics/slugflow",
"id": "1faa83e22a846e200159135de9e59792ce8485c1",
"size": "1452",
"b... |
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's URL is
# what goes here. E.g. If this directory is the directory for February, this script gets
# run on March 1, and this URL ... | {
"content_hash": "d418df0debb0d91e48162bb44d5d09e0",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 199,
"avg_line_length": 45.07692307692308,
"alnum_prop": 0.6808873720136519,
"repo_name": "foobarbazblarg/stayclean",
"id": "074b2a3fc7063bffde7d92858a4e87db60225c3b",
"siz... |
import numpy as np
import re
import itertools
from collections import Counter
"""
Original taken from https://github.com/dennybritz/cnn-text-classification-tf
"""
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_sent... | {
"content_hash": "7bdad5a7b82e5e144af322c7af89663a",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 108,
"avg_line_length": 37.42016806722689,
"alnum_prop": 0.6406916685380643,
"repo_name": "rouseguy/europython2016_dl-nlp",
"id": "9dffa0838475d1981b61209ea1b077852d7e5669",... |
import logging
import random
import string
import collections
import re
from pyzabbix import ZabbixAPI, ZabbixAPIException
class ZabbixConn(object):
"""
Zabbix connector class
Defines methods for managing Zabbix users and groups
"""
def __init__(self, config, ldap_conn):
self.ldap_conn... | {
"content_hash": "814239e82bb9a714756ef3de2cb7087c",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 125,
"avg_line_length": 32.04066985645933,
"alnum_prop": 0.5585007093257672,
"repo_name": "dnaeon/zabbix-ldap-sync",
"id": "7dfc3c3e58b299da2923ec1a427fef234c3229b1",
"siz... |
import json, cgi, os, sys, hashlib, time
from urllib.parse import *
from pymongo import *
from urllib import *
# from app.report.report import *
from datetime import datetime, timedelta
from libs.perm.perm import *
from libs.table.table import create_empty_row_
from libs.contents.contents import get_doc, get_mt
fr... | {
"content_hash": "ab0f662f6408995661cc61d9bf865e45",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 148,
"avg_line_length": 37.82616822429907,
"alnum_prop": 0.5797796116025102,
"repo_name": "alikzao/tao1",
"id": "fedcf004ae68d7285627c28f4b2a947d542f9040",
"size": "21343"... |
from django.shortcuts import render_to_response
from django.template import RequestContext
from humans.models import HumanGroup, Snippet
def humans_txt(request, template='humans.txt'):
snippet = Snippet.objects.random_snippet()
groups = HumanGroup.objects.exclude(members__isnull=True)
return render_to_re... | {
"content_hash": "f6e36d08ae26329395e3ee5dc1211a3b",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 61,
"avg_line_length": 29.31578947368421,
"alnum_prop": 0.6768402154398564,
"repo_name": "valeriansaliou/django-humans",
"id": "67376bf9ffd96708fefee57d3b506f3febf44699",
"... |
import argparse
from ghost import Ghost, Session
parser = argparse.ArgumentParser(description="Login to CRRC application.")
parser.add_argument("--baseUrl", required=True, help="Enter base URL for CRRC application. (eg. http://localhost:3000/)" )
parser.add_argument("--user", required=False, default="admin", help="Ent... | {
"content_hash": "b83202836ea452ce39b7ab12627829e7",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 127,
"avg_line_length": 50.34782608695652,
"alnum_prop": 0.7236614853195165,
"repo_name": "sptrakesh/crrc",
"id": "1b937bda6da5804d525dba87ba9eb14de071d921",
"size": "1181"... |
import sys
from functools import partial
from itertools import imap,starmap,repeat,izip,chain, ifilter
from operator import itemgetter, attrgetter, lt
from collections import Counter
from pbcore.io import BasH5Reader
from misc import identityFunc
if not len(sys.argv) >= 2:
sys.exit("zmwstats.py in.bas.h5 [in2.b... | {
"content_hash": "85fb12c38ca453b54b6915543573a131",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 97,
"avg_line_length": 29.454545454545453,
"alnum_prop": 0.6712962962962963,
"repo_name": "jgurtowski/ectools",
"id": "e8a17805ec55f43c05f6e3609f9124f3a920d52a",
"size": "1... |
import time
import re
import threading
import dbus
import dbus.service
import dbus.mainloop.glib
import ConfigParser
from imaplib import *
class MailWatcher(dbus.service.Object):
def __init__(self, name, session):
dbus.service.Object.__init__(self, name, session)
@dbus.service.signal('com.flocke.MailWatcher', si... | {
"content_hash": "010af984cbea66cf753c4a9469a75503",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 126,
"avg_line_length": 27.5625,
"alnum_prop": 0.7063492063492064,
"repo_name": "flocke/scripts",
"id": "31441638f8baeb9739be6d84df1b1aa52780f6db",
"size": "4037",
"binar... |
daemon = {
'deftDB_host' : 'ATLAS_DEFT',
'jediDB_host' : 'ATLAS_PANDA',
'deftDB_INTR' : 'INTR',
'deftDB_ADCR' : 'ADCR',
'jediDB_ADCR' : 'ADCR',
'deftDB_reader' : 'atlas_deft_r',
'deftDB_writer' : 'atlas_deft_w',
# tables
# DEFT
't_prodmanager_request' : 't_prodmanage... | {
"content_hash": "63ce00779e174a565d5463abea862fc1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 68,
"avg_line_length": 40.53846153846154,
"alnum_prop": 0.5569259962049335,
"repo_name": "PanDAWMS/panda-bigmon-atlas",
"id": "c300d970126ce04c0d431a40d9e3912b9b93985f",
"s... |
"""This program wraps an arbitrary command and prints "1" if the command ran
successfully."""
import subprocess
import sys
if not subprocess.call(sys.argv[1:]):
print 1
else:
print 0
| {
"content_hash": "6abb2a972003d48d6e3755552428975f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 76,
"avg_line_length": 18.9,
"alnum_prop": 0.7354497354497355,
"repo_name": "patrickm/chromium.src",
"id": "6f0daec3a751bdf4f043274f1196193929b5dd4b",
"size": "374",
"bin... |
from nltk.corpus import wordnet as wn
synsets = wn.synsets('wing')
print ([str(syns.part_holonyms() ) for syns in synsets])
| {
"content_hash": "ed95a2d2a05f07550f18aceba7aa7b65",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 56,
"avg_line_length": 41.333333333333336,
"alnum_prop": 0.7338709677419355,
"repo_name": "Shokr/nltk_tutorial",
"id": "99f4f41e600fa29fe0c2e3d1e62da93056de81ad",
"size": "1... |
from __future__ import absolute_import
from .base_model_ import Model
from datetime import date, datetime
from typing import List, Dict
from ..util import deserialize_model
class Project(Model):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
... | {
"content_hash": "99588e1c4f2663d4df9f5eaf14c09bff",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 190,
"avg_line_length": 25.307407407407407,
"alnum_prop": 0.5356358846773013,
"repo_name": "ttraulsen/project-manager",
"id": "c5f6d5b715f9f2f6c081b55ef6a154e2c8d652df",
"... |
import properties
class Parser(object):
def __init__(self, parse_type, options):
self.parse_type = parse_type
self.options = options
self.css_class = options.TITLE_CLASS
def parse(self, string):
return Title(string.strip(), self.css_class)
class Title(object):
def __init__(self, title, css_cl... | {
"content_hash": "6b0036f3e5ed69274a890c29a5d14448",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 25.321428571428573,
"alnum_prop": 0.6544428772919605,
"repo_name": "Kashomon/pyrite",
"id": "f1837842bb4c991f4f13a23d5219baa5c1f2467e",
"size": "835"... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.condenser_equipment_and_heat_exchangers import HeatExchangerFluidToFluid
log = logging.getLogger(__name__)
class TestHeatExchangerFluidToFluid(unittest.TestCase):
def setUp... | {
"content_hash": "1bbe65c0e4637efe0bcc6dfae9ce667d",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 187,
"avg_line_length": 61.58771929824562,
"alnum_prop": 0.7300954280017091,
"repo_name": "rbuffat/pyidf",
"id": "bef3e33c5519b6b7a87beb990fc6e009fef33132",
"size": "7021"... |
from xml.dom import minidom
from os import walk
import ConfigParser
import csv
from string import split
from string import strip
from time import gmtime, localtime, asctime
from os.path import join, dirname, exists, abspath
#log errors stuff
from traceback import format_exception
from sys import exc_info
#this is th... | {
"content_hash": "ec5a67f8733bda54bb607badf0f528f0",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 95,
"avg_line_length": 27.2183908045977,
"alnum_prop": 0.5629222972972973,
"repo_name": "ActiveState/code",
"id": "a754d2adf4be6a689346bffdd3dd91ee83328ab9",
"size": "2368"... |
from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(
name='montab',
description='Like Alt-Tab, but for monitors',
long_description=readme(),
license='MIT',
url='https://github.com/rabinv/montab',
author='Rabin Vincent',
author_email='r... | {
"content_hash": "8e4f6f2e250d5cde7f8304412ad6cc48",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 58,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.5989717223650386,
"repo_name": "rabinv/montab",
"id": "1b7effa86043afb793163195c2e70e3398e90524",
"size": "778",
... |
from electrum_mona.i18n import _
fullname = 'Ledger Wallet'
description = 'Provides support for Ledger hardware wallet'
requires = [('btchip', 'github.com/ledgerhq/btchip-python')]
registers_keystore = ('hardware', 'ledger', _("Ledger wallet"))
available_for = ['qt', 'cmdline']
| {
"content_hash": "c2f6c38d33c69967bd673108e8cf0477",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 63,
"avg_line_length": 40,
"alnum_prop": 0.7214285714285714,
"repo_name": "wakiyamap/electrum-mona",
"id": "bdf337edebc83796b2f3a958e4091c333f2ea8f4",
"size": "280",
"bina... |
__all__ = [
'brogressbar',
'rowgressbar',
]
import sys
import time
def format_interval(t):
mins, s = divmod(int(t), 60)
h, m = divmod(mins, 60)
if h:
return '%d:%02d:%02d' % (h, m, s)
else:
return '%02d:%02d' % (m, s)
def format_meter(n, total, elapsed):
# n - number of f... | {
"content_hash": "bfd66b1c654d4614605cc4c7c8068c13",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 79,
"avg_line_length": 27.376712328767123,
"alnum_prop": 0.5068801601200901,
"repo_name": "tpn/tpn",
"id": "4812eb46f76577d83bb2a1c17949dd9b3f79e7f0",
"size": "8039",
"b... |
question_list = [
# (mark, count, [directories])
(1, 3, 'eop/chapter3/linear_search_io_'),
]
practice_mode = True
standalone = False
logged = False
log_dir = ''
| {
"content_hash": "7747ae999ac69956ac61c33685255ec2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 42,
"avg_line_length": 18.22222222222222,
"alnum_prop": 0.6524390243902439,
"repo_name": "stryder199/RyarkAssignments",
"id": "fa72393b0a6362ae9eba55d0204a7c0655bb2acd",
"si... |
from django.http import HttpResponse
import csv
def format_csv(data, file_name):
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename="' + file_name + '.csv"'
writer = csv.writer(response)
writer.writerow(["Location","Name","Room","Date","1"])
fo... | {
"content_hash": "a1a4539dbe71612684114bc293169d56",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 94,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.6517857142857143,
"repo_name": "DukeOfNewYork/Django-Asset-Database",
"id": "df1f9910e4878aa42ced8e4b59771dd5e0cebf... |
import httplib2
import json
import os
import hashlib
import io
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from apiclient import discovery
from apiclient.http import MediaIoBaseDownload
# Print something to the console and log it to the log file
def log_and_print(log_file, log_entry, newl... | {
"content_hash": "51462f0f8da62d81f32b709fecbee122",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 164,
"avg_line_length": 49.24742268041237,
"alnum_prop": 0.5812574139976275,
"repo_name": "com6056/LetItRain-475-2161_Good_Rodgers",
"id": "dbe7ed9dd6579111bb3ec68cc5f89933e... |
from jnpr.junos.exception import ConnectNotMasterError
from jnpr.junos.exception import RpcError
def facts_chassis(junos, facts):
"""
The following facts are assigned:
facts['2RE'] : designates if the device can support two RE, not that it
has them
facts['RE_hw_mi'] : designat... | {
"content_hash": "90339400d9e8c1cb0c3627a6029d40ee",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 86,
"avg_line_length": 35.1764705882353,
"alnum_prop": 0.6114827201783724,
"repo_name": "Juniper/py-junos-eznc",
"id": "dfe06f78d81d3a27d6f1ea52ce19210aecb80ad9",
"size": "... |
from __future__ import unicode_literals
from django.conf import settings
S3DIRECT_UNIQUE_RENAME = getattr(settings, "S3DIRECT_UNIQUE_RENAME", None)
S3DIRECT_ROOT_DIR = getattr(settings, "S3DIRECT_ROOT_DIR", '')
| {
"content_hash": "135d75d0d801750c1d25ccebe3a68cd0",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 74,
"avg_line_length": 42.4,
"alnum_prop": 0.7688679245283019,
"repo_name": "hovel/django-s3direct",
"id": "35d459f10151ed777b16fae9a75417db655bc714",
"size": "226",
"bina... |
"""An example for using tf_estimator_evaluation."""
from absl import app
from absl import flags
from absl import logging
import numpy as np
import tensorflow as tf
from tensorflow import estimator as tf_estimator
from tensorflow.compat.v1 import estimator as tf_compat_v1_estimator
from tensorflow_privacy.privacy.priva... | {
"content_hash": "25fecc997a1e822964b3f0ee9a6e042e",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 137,
"avg_line_length": 40.20666666666666,
"alnum_prop": 0.7041949925385508,
"repo_name": "tensorflow/privacy",
"id": "b3b4ffa9bd085effd3300bb33018a0d2096e6337",
"size": "... |
import sys
from io import StringIO
from lager_ml_common import _NUM_FEATURES, convert_lager_to_numbers, convert_numbers_to_lager, expand_gesture_num_to_target
if (len(sys.argv) < 3):
print("lager_expander [GESTURE_FILE] [TARGET_LENGTH]")
exit()
orig_gesture_file = open(sys.argv[1], "r");
expanded_filename = sys.ar... | {
"content_hash": "0edafe88a6d21a9803d73ea093b78c86",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 123,
"avg_line_length": 32.13636363636363,
"alnum_prop": 0.7284299858557284,
"repo_name": "andresodio/lager",
"id": "4ce42cb0eaa24337fd2fe9bcfc74c93d0650b092",
"size": "794... |
"""
File: mp3numberify.py
Author: Greenblast
Github: https://github.com/Greenblast
Description: Numberifying mp3 files in a given path
"""
import os
import sys
from mutagen.mp3 import EasyMP3
ARGS_COUNT = 2
def organize(path):
for f in os.listdir(path):
if f.endswith("mp3"):
a = EasyMP3(os.pa... | {
"content_hash": "b35b18d039b0d251ffc3aa7159dcc56d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 84,
"avg_line_length": 21.675675675675677,
"alnum_prop": 0.5947630922693267,
"repo_name": "GreenBlast/dotfiles",
"id": "5797276874f26f8ba600bd64bd74cdc36e4ea0f8",
"size": "... |
"""
Tests for the nested_choice_calcs.py file.
"""
import unittest
import warnings
from collections import OrderedDict
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from scipy.sparse import issparse
import numpy.testing as npt
import pylogit.nested_choice_calcs as nlc
import pylogit.neste... | {
"content_hash": "f7720d8c38d7756b0a3648cf93f1389f",
"timestamp": "",
"source": "github",
"line_count": 855,
"max_line_length": 79,
"avg_line_length": 44.33567251461988,
"alnum_prop": 0.5645659113092568,
"repo_name": "timothyb0912/pylogit",
"id": "4b636db577811e0dff035f72ed6938fc78d84372",
"size": ... |
from __future__ import unicode_literals
import mds
import json, logging, time, sys, Queue
from socketIO_client import SocketIO
logger = logging.getLogger(__name__)
logger.debug('mdsVolumio2 module loading')
class mdsVolumio2Comms(mds.playerComms):
def __init__(self, ipaddr, port):
self.ipaddr = ipaddr
self.por... | {
"content_hash": "76a82503609518672f2bbb74c0fb7f09",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 130,
"avg_line_length": 25.197080291970803,
"alnum_prop": 0.6665701042873696,
"repo_name": "dhrone/pydPiper",
"id": "a1e490638e41baaf9ece78cb28ce05c2970925da",
"size": "35... |
import asyncio
def async_test(loop):
def real_decorator(f):
def func_wrapper(*args, **kwargs):
coro = asyncio.coroutine(f)
future = coro(*args, **kwargs)
loop.run_until_complete(future)
return func_wrapper
return real_decorator
| {
"content_hash": "5795f3ce22df327883a2949e51015f1c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 43,
"avg_line_length": 26.363636363636363,
"alnum_prop": 0.596551724137931,
"repo_name": "incnone/necrobot",
"id": "81c4c02e06969834bd456051698c95ed96dcb860",
"size": "290"... |
import itertools
import networkx as nx
from pgmpy.base import UndirectedGraph
class DirectedGraph(nx.DiGraph):
"""
Base class for all Directed Graphical Models.
Each node in the graph can represent either a random variable, `Factor`,
or a cluster of random variables. Edges in the graph represent th... | {
"content_hash": "95ec14cf22b039cd219d72e3f3d79bc2",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 93,
"avg_line_length": 30.46629213483146,
"alnum_prop": 0.519454176654988,
"repo_name": "khalibartan/pgmpy",
"id": "68ee7d4c521b49b197d96510a1c2d47a881ecb9b",
"size": "108... |
import abc
from oslo_utils import uuidutils
import osprofiler.profiler
import osprofiler.web
from requests_mock.contrib import fixture as mock_fixture
import six
import testtools
from neutronclient import client
from neutronclient.common import exceptions
AUTH_TOKEN = 'test_token'
END_URL = 'test_url'
METHOD = 'GET... | {
"content_hash": "66809e7e5cbb74c8f67bcd4c37135929",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 34.6875,
"alnum_prop": 0.6334334334334334,
"repo_name": "noironetworks/python-neutronclient",
"id": "d76e9bce977ddd443e274993988bc531847cbd97",
"siz... |
from django.db import models
from wq.db.patterns import models as patterns
class IdentifiedModel(patterns.LabelModel):
slug = models.SlugField()
name = models.CharField(max_length=255)
class FilterableModel(patterns.LabelModel):
name = models.CharField(max_length=10)
parent = models.ForeignKey(
... | {
"content_hash": "6bdf99bee9985d20629e05faa7f6092e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 25.642857142857142,
"alnum_prop": 0.716991643454039,
"repo_name": "wq/wq.db",
"id": "f021d851cc177e6110aaccbdaa2bc323c1b3c0c1",
"size": "1795",
"bi... |
"""Helpful functions when parsing JSON blobs."""
from __future__ import print_function
import json
import re
import sys
from chromite.lib import osutils
assert sys.version_info >= (3, 6), 'This module requires Python 3.6+'
def AssertIsInstance(instance, expected_type, description):
"""Raise an error if |instan... | {
"content_hash": "f0941a8d2da78759edd23136642789e5",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 28.45,
"alnum_prop": 0.6790861159929701,
"repo_name": "endlessm/chromium-browser",
"id": "51988ca44b195253c8905f2119cef54f672290bf",
"size": "3035",... |
import unittest
from apache.aurora.client import base
from gen.apache.aurora.api.ttypes import (
PopulateJobResult,
Response,
ResponseCode,
ResponseDetail,
Result,
TaskConfig
)
class TestBase(unittest.TestCase):
def test_format_response_with_message(self):
resp = Response(responseCode... | {
"content_hash": "493b220b68273b95268bf30ae8cd0b8e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 100,
"avg_line_length": 39.22222222222222,
"alnum_prop": 0.7320113314447592,
"repo_name": "kidaa/aurora",
"id": "1a560088279ac945cce14d02454e50b8483771e4",
"size": "2313",
... |
from flask import Flask, render_template, jsonify
from stock_scraper import get_data
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/data")
def data():
return jsonify(get_data())
if __name__ == "__main__":
app.run(debug=True)
| {
"content_hash": "711c8db45fb629abc870f3dc4e769e14",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 49,
"avg_line_length": 18.3125,
"alnum_prop": 0.6518771331058021,
"repo_name": "HiroIshikawa/21playground",
"id": "be002b1923accb2c6c726248515455faed0d09ea",
"size": "293",... |
import numpy as np
from numpy import diff, concatenate
import gc
from .goodsectionsresults import GoodSectionsResults
from ..timeframe import TimeFrame
from ..utils import timedelta64_to_secs
from ..node import Node
from ..timeframe import list_of_timeframes_from_list_of_dicts, timeframe_from_dict
class GoodSections(... | {
"content_hash": "186fa2dc2de6fd1a2eafae62224b2784",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 82,
"avg_line_length": 35.23728813559322,
"alnum_prop": 0.6270642937309604,
"repo_name": "nilmtk/nilmtk",
"id": "8f82fea7c22e3649698402fbf3a48a1aac2a2062",
"size": "6237",... |
from mock import Mock, patch
from django.core.exceptions import NON_FIELD_ERRORS
from django.http.response import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory
from ..views import PleaOnlineForms
from ..models import Case, Court
from ..standardisers import standar... | {
"content_hash": "e11d1361fba45bc9511faffb0c9ba363",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 99,
"avg_line_length": 41.46195652173913,
"alnum_prop": 0.5548564687377113,
"repo_name": "ministryofjustice/manchester_traffic_offences_pleas",
"id": "94f40a22aaf91ec24b78c2... |
"""
This file is part of Urban Mediator software.
Copyright (c) 2008 University of Art and Design Helsinki
See the file LICENSE.txt for copying permission.
Module for database queries. Used mostly by model.py
but also for low-level things in code.py
"""
import web
import config
import re
import d... | {
"content_hash": "68b9601ebf0eba67bc10d7871e2dfd41",
"timestamp": "",
"source": "github",
"line_count": 1342,
"max_line_length": 133,
"avg_line_length": 33.70715350223547,
"alnum_prop": 0.5407759478280093,
"repo_name": "rnd0101/urbanmediator",
"id": "3d1c4db44be4ce4b8659cb015f957b9b2efaa6f2",
"size... |
import json
from pymel.core import confirmDialog, menu, menuBarLayout, objExists, PyNode, selected
from .. import _core as core
from .._add import alt
_WEIGHTS = {}
@alt.name('Save Weights Locally', 'Weights')
def saveWeightsLocally():
''' Save the weights on the selected objects in a global var for use in thi... | {
"content_hash": "af732325b91f03bb85b7c61882d366ff",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 94,
"avg_line_length": 27.44578313253012,
"alnum_prop": 0.602721685689201,
"repo_name": "patcorwin/fossil",
"id": "e7fdd192b81169b36705c15b919799bb4f42a02e",
"size": "2278"... |
"""Script to get, put and delete secrets stored in credstash."""
import argparse
import getpass
from homeassistant.util.yaml import _SECRET_NAMESPACE
REQUIREMENTS = ['credstash==1.14.0', 'botocore==1.7.34']
def run(args):
"""Handle credstash script."""
parser = argparse.ArgumentParser(
description=(... | {
"content_hash": "a4c8b893d2c8418d0802693d76e37634",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 34.84722222222222,
"alnum_prop": 0.5894778796333201,
"repo_name": "ewandor/home-assistant",
"id": "12516e55c7df007d43c7a627dc2384d2ad19f9be",
"size":... |
'''#!/Users/lily/.virtualenvs/[lily]/lib/python2.7'''
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_orthg.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "fca1c0f392408f2ab3930c15586a4461",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 76,
"avg_line_length": 28.7,
"alnum_prop": 0.7003484320557491,
"repo_name": "LighthouseHPC/lighthouse",
"id": "9247adfb32ba7d5af7c3fe516f83c9acfb5fc727",
"size": "309",
"... |
"""Train the Joint CTC-Attention model (TIMIT corpus)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join, isfile, abspath
import sys
import time
import tensorflow as tf
from setproctitle import setproctitle
import yaml
import shuti... | {
"content_hash": "0b9cda145c38379df46755c375c57b5e",
"timestamp": "",
"source": "github",
"line_count": 446,
"max_line_length": 114,
"avg_line_length": 46.412556053811656,
"alnum_prop": 0.5108695652173914,
"repo_name": "hirofumi0810/tensorflow_end2end_speech_recognition",
"id": "8d4945860928ebaedb678... |
class QueryMixin:
"""The default query object used for models, and exposed as
:attr:`~SQLAlchemy.Query`. This can be subclassed and
replaced for individual models by setting the :attr:`~Model.query_class`
attribute. This is a subclass of a standard SQLAlchemy
:class:`~sqlalchemy.orm.query.Query` cl... | {
"content_hash": "2eedcec537109f50e2daf627e05bfa8a",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 77,
"avg_line_length": 34.35766423357664,
"alnum_prop": 0.5755258126195029,
"repo_name": "tazo90/lux",
"id": "04a45d376bdf2335f114e1e2c49694c0bebba512",
"size": "4708",
... |
from TASSELpy.java.util.Iterator import Iterator
from TASSELpy.utils.Overloading import javaOverload,javaGenericOverload,javaConstructorOverload
from TASSELpy.utils.helper import make_sig
java_imports = {'ListIterator':'java/util/ListIterator',
'Object':'java/lang/Object'}
class ListIterator(Iterator)... | {
"content_hash": "bf196460fb75cb8c2c65542977d7f0c1",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 95,
"avg_line_length": 32.27049180327869,
"alnum_prop": 0.6182372364744729,
"repo_name": "er432/TASSELpy",
"id": "d9cd1dd218574e6d63b48d40012e3a06ab4ae71d",
"size": "3937"... |
from . import util as _util
from .engine import create_engine
from .engine import create_mock_engine
from .engine import engine_from_config
from .inspection import inspect
from .schema import BLANK_SCHEMA
from .schema import CheckConstraint
from .schema import Column
from .schema import ColumnDefault
from .schema impor... | {
"content_hash": "2443e51bc1a6afe66bebc77e629afb2a",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 63,
"avg_line_length": 25.606666666666666,
"alnum_prop": 0.7781827649049726,
"repo_name": "monetate/sqlalchemy",
"id": "232d24364cbb5f3746f8331c8ad94b441ba6f674",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('teacher', '0002_auto_20170621_0741'),
]
operations = [
migrations.AddField(
model_name='exam',
name='marks_per_question',
... | {
"content_hash": "a9ec2bc77c6998c477608148f7c9d331",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 61,
"avg_line_length": 23.91304347826087,
"alnum_prop": 0.5709090909090909,
"repo_name": "sehgalayush1/labquiz",
"id": "a074a57c9438cb81e7563ac3863abcd5f339fd28",
"size": "... |
import SocketServer
import socket
import random
class ThermometerHandler(SocketServer.BaseRequestHandler):
# Collection of temperatures
#temperatures = ["11","18","20","5","70"]
def handle(self):
self.data = self.request.recv(1024).strip()
print "{} wrote :".format(self.client_address[0])
... | {
"content_hash": "48bd6debd4571dc0c81b20df20616b11",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 67,
"avg_line_length": 32.916666666666664,
"alnum_prop": 0.6341772151898735,
"repo_name": "stephenoken/-SNMP-Management-Station-for-Wireless-Indoor-Network",
"id": "87a8481d7... |
from quick_orm.core import Database
from sqlalchemy import Column, String
class DefaultModel:
name = Column(String(70))
__metaclass__ = Database.MetaBuilder(DefaultModel)
class User:
pass
class Group:
pass
Database.register()
if __name__ == '__main__':
db = Database('sqlite://')
... | {
"content_hash": "577da682be41b9f0f8ca19d3588777ee",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 50,
"avg_line_length": 20.192307692307693,
"alnum_prop": 0.6304761904761905,
"repo_name": "tylerlong/quick_orm",
"id": "a1e092fb40b7f25b9a5d42443770c9f089bc9e91",
"size": "... |
"""Definition provenance collector. Handle multiple files/visitors"""
from __future__ import (absolute_import, print_function,
division, unicode_literals)
import sys
import weakref
from collections import defaultdict
from future.builtins import map as cvmap
from future.utils import viewitems... | {
"content_hash": "a4e8f08e5d5617ef484bddb796e7941c",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 127,
"avg_line_length": 39.85454545454545,
"alnum_prop": 0.5978558394160584,
"repo_name": "gems-uff/noworkflow",
"id": "7427f8f0cf2e317fb72d7bd3033bfc601c4cee1f",
"size": ... |
from setuptools import setup
setup(name='pylgnetcast',
version='0.3.1',
description='Client for the LG Smart TV running NetCast 3 or 4.',
url='https://github.com/wokar/pylgnetcast',
license='MIT',
packages=['pylgnetcast'],
install_requires=[],
... | {
"content_hash": "f64137a4281360a721d758a66f6bd538",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 77,
"avg_line_length": 34.4,
"alnum_prop": 0.563953488372093,
"repo_name": "wokar/pylgnetcast",
"id": "5dcdb450389db39cd33c3c9e61afc0c79c939fae",
"size": "345",
"binary":... |
import os
def mk_reports_dir(report_dir):
"""create directory structure for a new report"""
# approximation of `mkdir -p`
# https://mail.python.org/pipermail/python-dev/2010-July/102092.html
try:
os.makedirs(report_dir)
except OSError, e:
if e.errno == 17:
mk_reports_dir... | {
"content_hash": "581b53f1e882cdbb789168c1e6ae4d24",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 80,
"avg_line_length": 27.20689655172414,
"alnum_prop": 0.5893536121673004,
"repo_name": "kennethd/data-in-the-mines",
"id": "fb21d4e3600fb133a13f2ec41cc6afb855bc9b5e",
"si... |
import cPickle as pickle
import datetime
import uuid
from twext.python.log import Logger
from twext.who.expression import MatchType, MatchFlags, Operand
from twisted.application import service
from twisted.application.strports import service as strPortsService
from twisted.internet.defer import inlineCallbacks, return... | {
"content_hash": "704f9824b88de8bb3af130b19f288957",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 79,
"avg_line_length": 34.16783216783217,
"alnum_prop": 0.61123618501842,
"repo_name": "trevor/calendarserver",
"id": "3fcd4c242222ff1b35ac933aac0170eb74c91a1e",
"size": "... |
"""empty message
Revision ID: 885ec8d01cfc
Revises: 82edf10df5bc
Create Date: 2017-02-05 00:06:21.245761
"""
# revision identifiers, used by Alembic.
revision = '885ec8d01cfc'
down_revision = '82edf10df5bc'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"content_hash": "237855c98add9203d6e3b12f3fa98866",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 23.46153846153846,
"alnum_prop": 0.6901639344262295,
"repo_name": "whittlbc/jarvis",
"id": "2a5f6f0f199adbb9bf78afb1aaffabb1908d7562",
"size": "610",... |
'''
This is going the be the different word class
used to help evaluate which words are
different, and which are not.
'''
class DiffWord:
# all the words should be DiffWords
def __init__(self, OWord="", isDiff=True, idex=[-1, -1]):
# default constructor for a word for some reason.
self.wor... | {
"content_hash": "f5b3b7ef4ff9f84d6215ac576dcf978b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 25.743589743589745,
"alnum_prop": 0.6125498007968128,
"repo_name": "faroos3/QuoteR",
"id": "14da66001f24ef850df5ca90e3f08272a42b8c7d",
"size": "1004"... |
"""
inlining/optimization test (the print statements should all print constant values and there shouldnt be any loads, though the stores might not be eliminated. also all refcounting should be elided.)
"""
l = []
l.append(123)
l.append(321)
print l[0], len(l)
l[1] = 666
print l[1]
| {
"content_hash": "19b1134f6b9694e252787f9a09040b7d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 198,
"avg_line_length": 28.4,
"alnum_prop": 0.7288732394366197,
"repo_name": "kmod/icbd",
"id": "5d3d104dad0d929c057a8c913bc0b707c2d135fd",
"size": "284",
"binary": false... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from django.http import HttpResponse
from django.utils.translation import pgettext as _
def test_view(request):
return HttpResponse(_('view context', 'test view string'))
| {
"content_hash": "3c1a56c90d721f30c3912d82668c5934",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 62,
"avg_line_length": 29.5,
"alnum_prop": 0.7627118644067796,
"repo_name": "kmichel/po-localization",
"id": "10081ee5540383e00b6a93e10669564e0e19da40",
"size": "311",
"b... |
"""Fichier contenant le type instrument."""
from .base import BaseType
class Instrument(BaseType):
"""Type d'objet: instrument.
"""
nom_type = "instrument"
| {
"content_hash": "189acc179e43c878730eac9b6dfa6516",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 43,
"avg_line_length": 16.818181818181817,
"alnum_prop": 0.6162162162162163,
"repo_name": "vlegoff/tsunami",
"id": "783af518ada29d12c3e8f9e9a52a3984e7b18dce",
"size": "1755... |
"""ECC secp256k1 crypto routines
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
"""
import ctypes
import ctypes.util
import hashlib
import sys
ssl = ctypes.cdll.LoadLibrary(ctypes.util.find_library ('ssl') or 'libeay32')
ssl.BN_new.restype = ctypes.c_v... | {
"content_hash": "d9e2f23c33b122ebcc22548d53521de9",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 130,
"avg_line_length": 34.86057692307692,
"alnum_prop": 0.6400496483243691,
"repo_name": "hideoussquid/aureus-12-bitcore",
"id": "ec7fb690292cc4eccde1ac91536e937ac3393188",... |
from ..math import vectorops,so3,se3
class SimLogger:
"""A CSV logger for a simulation. """
def __init__(self,sim,state_fn,contact_fn=None,colliding='all',saveheader=True):
"""
Logs a simulation to a CSV file.
Arguments:
sim (Simulator): the klampt.Simulator object you wis... | {
"content_hash": "1e72dfc2b7d3edd17f53a90889ebfef2",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 135,
"avg_line_length": 42.319526627218934,
"alnum_prop": 0.4951062639821029,
"repo_name": "krishauser/Klampt",
"id": "12551dac49b630a63df3d55edfa7f3eb1e1766e0",
"size": "... |
__author__ = "Raffaele Mazzitelli"
__credits__ = ["Raffaele Mazzitelli"]
__maintainer__ = "Raffaele Mazzitelli"
__email__ = "it.escube@gmail.com"
__status__ = "Test"
from lib.cloud_lib.cloud_spooler import CloudSpooler
from pprint import pprint
import sys
import json
import readline
import os
import magic
import time
... | {
"content_hash": "b6319e4f682b864e4845b9fecf7911ba",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 104,
"avg_line_length": 30.95,
"alnum_prop": 0.5454361873990307,
"repo_name": "escube/GoogleCloudSpooler",
"id": "55deb46f5f1a400c3c0b2af81243ba5ed447f28a",
"size": "4971"... |
"""
Pocket Class
for lap_joint script
Pocket:
.type string name of pocket type
.joint Joint corresponding Joint object
.post Post parent Post object
.index Integer currently 0 or 1. index of pocket in list self.joint.pockets
.origin ... | {
"content_hash": "e0a3c675fa6e6a85aeca72b21ed41356",
"timestamp": "",
"source": "github",
"line_count": 742,
"max_line_length": 180,
"avg_line_length": 32.4177897574124,
"alnum_prop": 0.6954352706410576,
"repo_name": "twastvedt/FRAMEWORK",
"id": "a6feb8dbbe1e23410b135c1fac6621679db544b3",
"size": "... |
import os
import fcntl
import socket
from .poller import POLL_EVENT_TYPE
class PipeNotifier(object):
def __init__(self, poller, callback = None):
self.__callback = callback
self.__pipeR, self.__pipeW = os.pipe()
flag = fcntl.fcntl(self.__pipeR, fcntl.F_GETFD)
fcntl.fcntl(self.__p... | {
"content_hash": "f5e3c8e3be64013e15dd0e5fbaf26087",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 86,
"avg_line_length": 30.4375,
"alnum_prop": 0.5995893223819302,
"repo_name": "bakwc/PySyncObj",
"id": "652ab4cfdb3e54b560d0610f0859d03aa2c3bfbe",
"size": "974",
"binary... |
"""
test_models
----------------------------------
Tests for bpz models
"""
from django.test import TestCase
from bpz.models import Case, HomeOwnersAssociation
class CaseTestCase(TestCase):
def test_str(self):
case = Case(case_id='BOA-21745')
self.assertEqual(str(case), 'BOA-21745')
class Ho... | {
"content_hash": "544e6f587d45182a6eca65186b0446da",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 56,
"avg_line_length": 21.807692307692307,
"alnum_prop": 0.6313932980599647,
"repo_name": "codefortulsa/BPZAround.me",
"id": "f5c505556c0ddd62f8736f86ffb40e5cadda5f81",
"si... |
import math
orientations = [(1, 0), (0, 1), (-1, 0), (0, -1)]
def turn_heading(heading, inc, headings=orientations):
return headings[(headings.index(heading) + inc) % len(headings)]
def turn_right(heading):
return turn_heading(heading, -1)
def turn_left(heading):
return turn_heading(heading, +1)
d... | {
"content_hash": "6889f206b4a23ac60c4f4ceef3ce5c45",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 24.78181818181818,
"alnum_prop": 0.5810711665443874,
"repo_name": "gokul-uf/aima-python",
"id": "45bce40f3067f2cfed93fa1784ac228b47164f35",
"size": "... |
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
import google.auth # type: ignore
from google.auth import credentials as... | {
"content_hash": "59f842245d5d13e395c0d1c47c061569",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 101,
"avg_line_length": 36.551515151515154,
"alnum_prop": 0.6131653125518156,
"repo_name": "googleapis/google-cloud-python",
"id": "b2121f5c1760c08f6da1365fade0ec9a7112c2c5"... |
import unittest
from . import issues
class InboundMessageStub(object):
"""
Stub InboundEmailMessage class.
(google.appengine.api.mail.InboundEmailMessage)
"""
def __init__(self):
self.subject = u'It doesn\'t work'
def bodies(self, content_type):
return iter([(u'plain/text... | {
"content_hash": "644c211f177d4f0ef259ebf87b2341aa",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 76,
"avg_line_length": 28.14,
"alnum_prop": 0.6254442075337597,
"repo_name": "kdwyer/issue-forwarder",
"id": "768c08ce72b7b5f5a255b87154a967da7dadf189",
"size": "2814",
... |
import datetime
from news_website.extensions import db
from news_website.models.relationships import topics_newses
from news_website.database import (
Model,
SurrogatePK,
)
class News(SurrogatePK, Model):
__tablename__ = 'newses'
title = db.Column(db.Text, default='')
abstract = db.Column(db.Text... | {
"content_hash": "6bf9507611cb5173546eb11588b96c64",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 105,
"avg_line_length": 38.25,
"alnum_prop": 0.6873638344226579,
"repo_name": "binking/News_website",
"id": "ab7c6dfd5b848e862222e4519cd277f416e90e1d",
"size": "918",
"bi... |
from numpy import mean,cov,double,cumsum,dot,linalg,array,rank,size,flipud
from pylab import *
import numpy as np
import matplotlib.pyplot as pp
#from enthought.mayavi import mlab
import scipy.ndimage as ni
import roslib; roslib.load_manifest('sandbox_tapo_darpa_m3')
import rospy
#import hrl_lib.mayavi2_util as mu
im... | {
"content_hash": "c6cf5fe2acabf1567920f885127e7df9",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 664,
"avg_line_length": 34.6241134751773,
"alnum_prop": 0.6224907824662024,
"repo_name": "tapomayukh/projects_in_python",
"id": "50c180908735373455cd9d9879d87e04646f9dd6",
... |
from django import forms
class AddToCartForm(forms.Form):
quantity = forms.DecimalField(initial=1)
def __init__(self, data=None, *args, **kwargs):
typ = kwargs.pop('typ')
# validate only when correct button was pressed
if data and not typ in data:
data = None
self.c... | {
"content_hash": "7cac2080efd52595d5db7d2e8953f97e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 84,
"avg_line_length": 34.48275862068966,
"alnum_prop": 0.615,
"repo_name": "fusionbox/satchless",
"id": "60f2863c9d714af7ca2d4ccf465d256d02adaa89",
"size": "1023",
"bina... |
from setuptools import setup
from setuptools.command.test import test as TestCommand # noqa
import os
import re
import sys
name = 'djes'
package = 'djes'
description = "Connecting Django and elasticsearch-dsl"
url = "https://github.com/theonion/djes"
author = "Chris Sinchok"
author_email = 'csinchok@theonion.com'
li... | {
"content_hash": "a10cfd93ac1973dfa458f20bddf255de",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 90,
"avg_line_length": 24.603960396039604,
"alnum_prop": 0.6169014084507042,
"repo_name": "theonion/djes",
"id": "3a97b12e44a3c70c71716853f8ee04ced6b9ea6e",
"size": "2532"... |
"""Tests for `tf.data.Dataset.map()`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import functools
import threading
import time
import warnings
from absl.testing import parameterized
import numpy as np
from tensorflow.core.framewo... | {
"content_hash": "21161130c1d5e1c79f9b517fb131fa3f",
"timestamp": "",
"source": "github",
"line_count": 1452,
"max_line_length": 80,
"avg_line_length": 37.180440771349865,
"alnum_prop": 0.6559478383284555,
"repo_name": "frreiss/tensorflow-fred",
"id": "c01e3b15170da0b3379e52afddbad5fd815cacf9",
"si... |
"""
WSGI config for {{ cookiecutter.project_name }} project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via t... | {
"content_hash": "26af5da4571a6b24f162b6f537b2542d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 46.0625,
"alnum_prop": 0.7910447761194029,
"repo_name": "savioabuga/cookiecutter-django-1.7.7",
"id": "d362a44c44085e883bab5231c37efc72b5d80c37",
"si... |
"""Module containing the element class."""
import pytac
from pytac.data_source import DataSourceManager
from pytac.exceptions import DataSourceException, FieldException
class Element(object):
"""Class representing one physical element in an accelerator lattice.
An element has zero or more devices (e.g. quadr... | {
"content_hash": "5060d3770564e07e44d1f09ee5270db0",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 85,
"avg_line_length": 33.75975975975976,
"alnum_prop": 0.5653798256537983,
"repo_name": "willrogers/pytac",
"id": "591f39ea9089f08fad8f592577f07eaf23c6c065",
"size": "112... |
__author__ = 'Joe Linn'
import pylastica.aggregation.abstractaggregation as abstract
class Global(abstract.AbstractAggregation):
pass | {
"content_hash": "e15111ac7ea71ae0d589d137e7640aed",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 20,
"alnum_prop": 0.7857142857142857,
"repo_name": "jlinn/pylastica",
"id": "3547f70d6e1381e7552f08d6b2927ef265bf7b99",
"size": "140",
"binary": fal... |
from . import AWSObject, AWSProperty
from .validators import boolean, double, integer_range, positive_integer
class GrokClassifier(AWSProperty):
props = {
'Classification': (basestring, True),
'CustomPatterns': (basestring, False),
'GrokPattern': (basestring, True),
'Name': (basest... | {
"content_hash": "c7aa285e3a5b3451e6cb215d1acbc661",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 77,
"avg_line_length": 25.013698630136986,
"alnum_prop": 0.5913472070098577,
"repo_name": "pas256/troposphere",
"id": "381ba4005aa7ac016207bfb598217bc8747851cc",
"size": "... |
"""Implement rdf post-processors for running data through a chain of parsers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
import re
import stat
from future.builtins import str
from future.utils import with_metaclass
from grr_response_cor... | {
"content_hash": "c630d4bdb272b88eb672599e26066e2f",
"timestamp": "",
"source": "github",
"line_count": 566,
"max_line_length": 80,
"avg_line_length": 31.680212014134277,
"alnum_prop": 0.6576878032457755,
"repo_name": "dunkhong/grr",
"id": "232b04021fb5b61feca6188a4278a5ae8f18446f",
"size": "17953"... |
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# --... | {
"content_hash": "3a7968cec2d18359545e7c5ef7f9a0e3",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 98,
"avg_line_length": 33.068345323741006,
"alnum_prop": 0.7067333840965953,
"repo_name": "arkphp/database",
"id": "509cc57123da15eec36a5481a917f3713be5112e",
"size": "961... |
from chronicle import Messenger
from chronicle.responders.scribes import TextScribe
class TestClass(object):
zero = 0
def successor(self, number):
return number + 1
test_object = TestClass()
scribe = TextScribe('TextLogging.txt')
messenger = Messenger(test_object, scribe)
messenger.zero
messenge... | {
"content_hash": "e5faa6aebc56b4f2c27f02f5926b72d4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 22.625,
"alnum_prop": 0.7458563535911602,
"repo_name": "nkashy1/chronicle",
"id": "b1fcb1362ca4f73f9aab4d86e02ca1a7fad48a95",
"size": "362",
"binar... |
"""
:platform: Unix, Windows
:synopsis: Este módulo implementa un algoritmo genético para crear al mejor villano.
.. module:: mejorVillano
.. module author::
Garrido Valencia Alan
Sánchez Baños Margarito
Torres Ortiz Luis Miguel
Zuñiga Hernandez Jonatan
"""
from random import randint
class Villain:... | {
"content_hash": "e4773ef22f1056dbf2e960efdf1f3925",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 106,
"avg_line_length": 36.46341463414634,
"alnum_prop": 0.6644370122630993,
"repo_name": "allanstone/InteligenciaArtificial",
"id": "641f8f7d515b9eb2dcab9f6ea469bbf02571402... |
model.add(Conv2D(8, kernel_size=(3, 3),
activation='relu',
input_shape=(40,1200,3)))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(16, kernel_size=(3, 3),
activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(24, kernel_size=(3, 3),
activation='sigmoid'))
model.... | {
"content_hash": "29695437f4815739c2432f77949a77cc",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 94,
"avg_line_length": 34.166666666666664,
"alnum_prop": 0.6959349593495935,
"repo_name": "alex-ta/Fontinator",
"id": "064fbb72f406ca8d2bc1dcf50a9aebe5172c1f95",
"size": "9... |
class Config:
draw_coverage = False
draw_textures = False
draw_grid = False
draw_overdraw = False
draw_texTypes = ['hght', 'mate', 'grass.extm', 'water.extm']
draw_texType = "hght"
draw_channels = ['all', 'r', 'g', 'b', 'a']
draw_channel = "all"
disable_alpha = False
@staticm... | {
"content_hash": "d758d2e550304cc30bac6e6ffaf98abc",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 95,
"avg_line_length": 31.88888888888889,
"alnum_prop": 0.578397212543554,
"repo_name": "simply-jos/birth-of-the-toolkit",
"id": "f1188b66b244a827f3554a90dcae8acd9dccc110",
... |
"""Payload management for sending Ansible files and test content to other systems (VMs, containers)."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import atexit
import os
import stat
import tarfile
import tempfile
import time
from . import types as t
from .config import (... | {
"content_hash": "8cc38e69e54d36d7c3857b7a81b7ffa2",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 146,
"avg_line_length": 36.71544715447155,
"alnum_prop": 0.6616474756421612,
"repo_name": "thaim/ansible",
"id": "0a6754f51348e9b26acd46a52fa041de5c1deca7",
"size": "4516"... |
from a10sdk.common.A10BaseClass import A10BaseClass
class SlbServerStatistics(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param out_bytes: {"type": "number", "format": "number"}
:param in_bytes: {"type": "number", "format": "number"}
:param p_conn: {"type": ... | {
"content_hash": "b203305349ce8ceb87fe17735180c631",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 521,
"avg_line_length": 33.697916666666664,
"alnum_prop": 0.5811437403400309,
"repo_name": "a10networks/a10sdk-python",
"id": "b7564de3a76a05fe502fb6313f4b1d8c15672d3e",
"s... |
from .jeeves import RunBot
if __name__ == "__main__":
RunBot()
| {
"content_hash": "37461dab6425f519d45e975a58dd1f85",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 26,
"avg_line_length": 17,
"alnum_prop": 0.5588235294117647,
"repo_name": "havokoc/MyManJeeves",
"id": "14808df9dbb6b7214e2b4f8daeef747ccbb7c832",
"size": "68",
"binary": ... |
import numpy as np
import itertools as it
class XyzError(Exception):
pass
class Reader(object):
def __init__(self, filename, **kwargs):
self.filename = filename
self.file = open(filename, 'r')
@property
def natoms(self):
f = open(self.filename, 'r')
natoms = int(f.n... | {
"content_hash": "d968e68650495251f4c121699d18ef96",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 76,
"avg_line_length": 22.443037974683545,
"alnum_prop": 0.5318668922729837,
"repo_name": "jp43/lsdmap",
"id": "9a8554c15c6cf8c7e0c58dab8a0dcd9972b8fd21",
"size": "1773",
... |
import mock
from django.http import Http404
from django.test import TestCase
from cradmin_legacy import cradmin_testhelpers
from devilry.devilry_account.models import PermissionGroup
from devilry.devilry_admin.views.common.bulkimport_users_common import AbstractTypeInUsersView
class AbstractTypeInUsersViewTestMixin(... | {
"content_hash": "5c2d2e243f350c8e0998609eecc5349f",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 111,
"avg_line_length": 48.34782608695652,
"alnum_prop": 0.633318345323741,
"repo_name": "devilry/devilry-django",
"id": "094bc256a8ef83d95aa8d9f19ba7ca2439188455",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.