text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Created on Wed Mar 12 12:48:33 2014
@author: ibackus
"""
# External modules
import pynbody
SimArray = pynbody.array.SimArray
import numpy as np
import os
import cPickle as pickle
# ICgen modules
import calc_rho_zr
import calc_temp
import pos_class
import make_snapshot
import ICgen_settings
import make_sigma
impo... | {
"content_hash": "472a4e51be14c192bf2c5e499ec63267",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 95,
"avg_line_length": 28.949367088607595,
"alnum_prop": 0.5099475295146481,
"repo_name": "dflemin3/ICgen",
"id": "8ddfb9f0df5ef582ca18d4d06d05a6b82e040ef1",
"size": "9172... |
import bibtexparser
#from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import *
import codecs
#import sys
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
HTML = 1
LATEX = 2
def customizations(record):
"""Use some functions delivered by the library
:param record: a record
... | {
"content_hash": "63c71135985f036a7a127be4606a4544",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 138,
"avg_line_length": 38.5,
"alnum_prop": 0.5776873728680958,
"repo_name": "memkite/DeepLearningBibliography",
"id": "2ee7c8674e93659f71bd3a761a152748d70f6e5f",
"size": ... |
"""Messaging library for Python"""
from __future__ import absolute_import
from collections import namedtuple
version_info_t = namedtuple(
'version_info_t', ('major', 'minor', 'micro', 'releaselevel', 'serial'),
)
VERSION = version_info_t(3, 0, 7, '', '')
__version__ = '{0.major}.{0.minor}.{0.micro}{0.releaseleve... | {
"content_hash": "71bdbc3d150bbceb1699940d0006cbdd",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 77,
"avg_line_length": 35.47663551401869,
"alnum_prop": 0.5879873551106428,
"repo_name": "andresriancho/kombu",
"id": "37c9cc1c7df9ca575960343f44fb430caaf3b8d4",
"size": "... |
"""
* *******************************************************
* Copyright (c) VMware, Inc. 2016, 2018. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHE... | {
"content_hash": "a56cd3417f7704341cb795afeb0d099b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 122,
"avg_line_length": 33.88059701492537,
"alnum_prop": 0.6352422907488987,
"repo_name": "tianhao64/vsphere-automation-sdk-python",
"id": "3752c8b4f90c0ca562a1401d755dc161ae... |
"""Functions for document tokenization."""
import string
import regex as re
# This is designed to match:
# - unicode separators (spaces, paragraph separators, etc.)
# - unicode symbols (math symbols, currency symbols, etc.)
# - other symbols (control characters, formatting indicators, etc.)
# These typically will get... | {
"content_hash": "2aa6bdaf0108d7852f3909c5995c06a5",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 30.69811320754717,
"alnum_prop": 0.6644130301167793,
"repo_name": "jamesmishra/nlp-playground",
"id": "2a1873ae342c30d52b75f1d1e7bddddc0d7717cd",
"s... |
import sys
if len(sys.argv) < 2:
print "mostocc.py column_in_fort.38"
sys.exit(0)
# get occupancy from fort.38 column 8
OccTable = {}
fort38 = open("fort.38").readlines()
column = int(sys.argv[1])
for line in fort38:
# get confID
fields = line.split()
if len(fields[0]) == 14:
confID = fields[0]
... | {
"content_hash": "6b67061affe7833a5bfc1cd11c37e2b9",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 65,
"avg_line_length": 23.62264150943396,
"alnum_prop": 0.6269968051118211,
"repo_name": "MarilyGunnersLab/MCCE",
"id": "3b60496e00c29bdc863b6013c12dfce61f01543c",
"size": ... |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from... | {
"content_hash": "5e99e89a03f1b2196cdf2bac00e8511f",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 70,
"avg_line_length": 31.4,
"alnum_prop": 0.6874734607218683,
"repo_name": "yoshiweb/keras-mnist",
"id": "0689c072547f81306cca07dad461df4f0850c7f6",
"size": "2369",
"bin... |
"""Tests for the 'ihate' plugin"""
from _common import unittest
from beets import importer
from beets.library import Item
from beetsplug.ihate import IHatePlugin
class IHatePluginTest(unittest.TestCase):
def test_hate(self):
match_pattern = {}
test_item = Item(
genre='TestGenre',
... | {
"content_hash": "7c85e09a843518c59971e18830229705",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 74,
"avg_line_length": 34.44,
"alnum_prop": 0.648664343786295,
"repo_name": "accesso/beets",
"id": "b9c6eb114a8dc1cb2101d40214fb09b7474a1c6b",
"size": "1722",
"binary": f... |
'''
Created on Jan 28, 2014
@author: rkourtz
'''
import boto.route53
import nuodbTools.aws
import inspect, json, os, random, string, sys, time
class Cluster:
def __init__(self,
alert_email = "alert@example.com",
aws_access_key = "",
aws_secret = "",
... | {
"content_hash": "6c6fe9f38002ab5e19fe141efbff9326",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 235,
"avg_line_length": 43.27150537634409,
"alnum_prop": 0.5496676399329068,
"repo_name": "nuodb/nuodbTools",
"id": "4c30234356a4113c49d39887ae04040a38838d25",
"size": "16... |
import github.GithubObject
import github.AuthorizationApplication
class Authorization(github.GithubObject.CompletableGithubObject):
"""
This class represents Authorizations as returned for example by http://developer.github.com/v3/todo
"""
@property
def app(self):
"""
:type: :cla... | {
"content_hash": "86b69127ffb447e4fbeb99dcc78ef1a7",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 205,
"avg_line_length": 36.67741935483871,
"alnum_prop": 0.6197009674582233,
"repo_name": "ARMmbed/yotta_osx_installer",
"id": "b1ff7314d419bc7ace04f0b92f17c38f7319db59",
... |
def can_build(plat):
return plat == 'android'
def configure(env):
if env['platform'] == 'android':
env.android_add_dependency("compile 'com.google.android.gms:play-services-plus:9.8.0'")
env.android_add_dependency("compile 'com.google.android.gms:play-services-drive:9.8.0'")
env.android... | {
"content_hash": "3df9497cc07c941940e8541dfe59007a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 96,
"avg_line_length": 49.36363636363637,
"alnum_prop": 0.6795580110497238,
"repo_name": "jlopezcur/GodotGooglePlayGameServices",
"id": "90a3a661f546c312e54e393868386ec43f541... |
"""Find the software stack and version for each MN in a DataONE environment.
The results are printed to stdout and written to a CSV file.
The MNs are checked concurrently, while checks are issued to each MN serially. This
gives each MN the most time to return something sensible but does end up slowing down
the script... | {
"content_hash": "53ffefd9a2025c57ebe01640fbcb41c3",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 96,
"avg_line_length": 32.013698630136986,
"alnum_prop": 0.6314933675652546,
"repo_name": "DataONEorg/d1_python",
"id": "ebcb7abb2817547b86eb4331e54d53d0ae06ba7c",
"size":... |
import numpy as np
import moldesign as mdt
from moldesign import data, utils
from moldesign import units as u
from . import toplevel, AtomContainer, AtomList, AtomArray, AtomCoordinate, Bond
class AtomDrawingMixin(object):
""" Functions for creating atomic visualizations.
Note:
This is a mixin class... | {
"content_hash": "3c5e0ffa093d02d501afc7d7c7b6ffb9",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 100,
"avg_line_length": 38.18069815195072,
"alnum_prop": 0.5945466279444982,
"repo_name": "tkzeng/molecular-design-toolkit",
"id": "8a8b3a93820714f1bf1ecb6d8c3b558d9427cf97"... |
"""
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
try:
# Available in Python 3.1+
import importlib
except ImportError:
# Will be removed in Django 1.9
from django.utils import importlib
try... | {
"content_hash": "fbdd07e0959b593628b6b869f7d4adf8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.7218844984802432,
"repo_name": "dadasoz/dj-translate",
"id": "66ea244a7c6c06017e26473487bafdb5ed4411b2",
"size": ... |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
if __name__ == '__main__':
# When running this file in isolation, we need to set up the configuration
# before importing 'template'.
settings.configure()
from datetime import date, datetime, timedelta
import time
im... | {
"content_hash": "f3a4c9052a0b3a7ae955700aaeb7218c",
"timestamp": "",
"source": "github",
"line_count": 1699,
"max_line_length": 388,
"avg_line_length": 65.37257210123602,
"alnum_prop": 0.5152879317175064,
"repo_name": "aleida/django",
"id": "4aa71f97094e9328d1c1a965e6b44c7795a3f557",
"size": "1112... |
import sys
import cv
import glob
def detect(image):
image_size = cv.GetSize(image)
# create grayscale version
grayscale = cv.CreateImage(image_size, 8, 1)
cv.CvtColor(image, grayscale, cv.CV_BGR2GRAY)
# create storage
storage = cv.CreateMemStorage(0)
# equalize histogram
cv.EqualizeH... | {
"content_hash": "93adb8b6cccef496d24ecdafe2cb58d1",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 98,
"avg_line_length": 24.719298245614034,
"alnum_prop": 0.5862313697657914,
"repo_name": "masgari/peach",
"id": "8377c035ab41458934a4b739c7f6b0eef13f0b9b",
"size": "1409",... |
"""
8. Pressure increasing test
This test requires that the profile has pressures that are monotonically increasing (assuming the pressures are ordered from smallest to largest).
Action: If there is a region of constant pressure, all but the first of a consecutive set of constant pressures should be flagged as bad dat... | {
"content_hash": "9c9dc686472e7ba4a63351e20104e989",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 415,
"avg_line_length": 30.46268656716418,
"alnum_prop": 0.6046055854973053,
"repo_name": "castelao/CoTeDe",
"id": "636a42f2e9594d1354ec79e61f4753775709d29b",
"size": "2152... |
'''
PingPHP AST nodes
'''
indentLevel = 0
outputString = []
def indent():
global indentLevel
indentLevel += 1
def outdent():
global indentLevel
indentLevel -= 1
def append(val):
global outputString
if isinstance(val, list):
outputString.extend(val)
else:
outputString.a... | {
"content_hash": "2f55e769d8b8fe8381c2025e46df91e0",
"timestamp": "",
"source": "github",
"line_count": 1152,
"max_line_length": 87,
"avg_line_length": 22.489583333333332,
"alnum_prop": 0.553960166743863,
"repo_name": "zxylvlp/PingPHP",
"id": "cb25aba9e6142f3b37be94bc933dae340450e527",
"size": "259... |
'''
Button
======
.. image:: images/button.jpg
:align: right
The :class:`Button` is a :class:`~kivy.uix.label.Label` with associated actions
that are triggered when the button is pressed (or released after a
click/touch). To configure the button, the same properties (padding,
font_size, etc) and
:ref:`sizing syst... | {
"content_hash": "bd46ca99dec3d55156f961e96a7ab073",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 33.56204379562044,
"alnum_prop": 0.6846454980426272,
"repo_name": "matham/kivy",
"id": "96123c668bb00c8031acc1744355814a3989f2e1",
"size": "4598",
... |
class Serie():
"""Model of a TV serie."""
pass
| {
"content_hash": "a24c8c370b368b8306694fef20e3cb75",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 30,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.5272727272727272,
"repo_name": "Rolinh/pydeo",
"id": "ed00f28b2e827409361ecd78c07eb094f063a7cd",
"size": "55",
"... |
import copy
import time
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
from webob import exc
from neutron.api.v2 import attributes
from neutron.common import constants
from neutron import context
from neutron.db import agents_db
from neutron.db import db_base_plugin_v... | {
"content_hash": "b917ef8012cf508688d28b118630494f",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 75,
"avg_line_length": 37.559006211180126,
"alnum_prop": 0.6194807342483877,
"repo_name": "NeCTAR-RC/neutron",
"id": "abc28b9aaf45dd2c81ca03b46bc4050434e5f314",
"size": "6... |
import pecan
import re
from designate import exceptions
from designate import schema
from designate.api.v2.controllers import rest
from designate.api.v2.views import floatingips as floatingips_views
from designate.central import rpcapi as central_rpcapi
central_api = central_rpcapi.CentralAPI()
FIP_REGEX = '^(?P<re... | {
"content_hash": "92c29caa22f3f940148a60f9caeb19be",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 73,
"avg_line_length": 31.04,
"alnum_prop": 0.625,
"repo_name": "NeCTAR-RC/designate",
"id": "ae373b7f140a7adc9da66143b758c54f56401044",
"size": "2983",
"binary": false,
... |
import cmd
import os
import sys
import time
import traceback
from typing import Optional, List, Iterator, Tuple, Dict
from pyramids.categorization import Category
from pyramids.model import Model
from pyramids.rules.parse_rule import ParseRule
try:
from graphviz import Digraph
except ImportError:
Digraph = No... | {
"content_hash": "5a31d5d9d2961b2745f5ccd028e40273",
"timestamp": "",
"source": "github",
"line_count": 1065,
"max_line_length": 100,
"avg_line_length": 42.12769953051643,
"alnum_prop": 0.5585967102037177,
"repo_name": "hosford42/pyramids",
"id": "76223d37da5ca5ce8fac6c9aa23a7fce439112ed",
"size": ... |
"""Provides the Session class and related utilities."""
import weakref
from .. import util, sql, engine, exc as sa_exc
from ..sql import util as sql_util, expression
from . import (
SessionExtension, attributes, exc, query,
loading, identity
)
from ..inspection import inspect
from .base import (
obje... | {
"content_hash": "68850ecd6862f1912c2a4035dadcb2fd",
"timestamp": "",
"source": "github",
"line_count": 2359,
"max_line_length": 83,
"avg_line_length": 39.45485375158966,
"alnum_prop": 0.6021015536025098,
"repo_name": "alex/sqlalchemy",
"id": "21768626876478dfe6bd6d05b9c20b943ff159f3",
"size": "933... |
from hashlib import md5
from app import app
from app import oid,lm,db
from flask import render_template, flash, redirect, session, url_for, request, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from forms import LoginForm
from models import User, ROLE_USER, ROLE_ADMIN
from flask i... | {
"content_hash": "d33ae6e3fe856aee3afc2f1a1d308944",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 99,
"avg_line_length": 24,
"alnum_prop": 0.6806615776081425,
"repo_name": "youxun/learning",
"id": "b35881163ffa73eccafc5b64006e1a0850338ffd",
"size": "3176",
"binary": ... |
from pwn import *
# Create an instance of the process to talk to
io = gdb.debug('./challenge')
# Attach a debugger to the process so that we can step through
pause()
# Load a copy of the binary so that we can find a JMP ESP
binary = ELF('./challenge')
# Assemble the byte sequence for 'jmp esp' so we can search for ... | {
"content_hash": "6f45950e5eab83848a05c54d206b588b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 24.29787234042553,
"alnum_prop": 0.702276707530648,
"repo_name": "idkwim/tutorial",
"id": "aad25fc962c44aa14811b3b994922e5295958a07",
"size": "1188",... |
import socket #for sockets
import sys #for exit
try:
#create an AF_INET, STREAM socket (TCP)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, msg:
print 'Failed to create socket. Error code: ' + str(msg[0]) + ' , Error message : ' + msg[1]
sys.exit();
print 'Socket Creat... | {
"content_hash": "4b401cd12d455409113d72e223803a9f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 96,
"avg_line_length": 24.310344827586206,
"alnum_prop": 0.649645390070922,
"repo_name": "janusnic/21v-python",
"id": "812fe4d95ab2dd4e1f0bc7753fab675cf06d9260",
"size": "7... |
import warnings
from tencentcloud.common.abstract_model import AbstractModel
class CompareMetricsData(AbstractModel):
"""结构化对比指标(准确率/召回率)数据
"""
def __init__(self):
r"""
:param ShortStructAccuracy: 短文准确率
:type ShortStructAccuracy: str
:param ShortStructRecall: 短文召回率
... | {
"content_hash": "e6db112d6b87cf43a0c9cda7f565e650",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 84,
"avg_line_length": 30.198630136986303,
"alnum_prop": 0.6085280108868224,
"repo_name": "tzpBingo/github-trending",
"id": "8f811079e926991844f47ad5a603f72f52e8c7fe",
"si... |
import requests,sys
from bs4 import BeautifulSoup
from SenseCells.tts import tts
from GreyMatter.utils import clean_msg
# Google News
fixed_url = 'https://news.google.com/'
news_headlines_list = []
news_details_list = []
r = requests.get(fixed_url)
data = r.text
soup = BeautifulSoup(data, "html.parser")
for news_bo... | {
"content_hash": "9ce0f7893b4eebc776ea4f5992b85960",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 132,
"avg_line_length": 35.5625,
"alnum_prop": 0.6511423550087874,
"repo_name": "sjsucohort6/amigo-chatbot",
"id": "9443cdfcabaff01c94d20ac4c416559b77f576d9",
"size": "1138... |
from couchdbkit import Consumer
def get_recent_changes(db, limit=500):
c = Consumer(db)
changes = c.fetch(limit=limit, descending=True, include_docs=True)['results']
for row in changes:
yield {
'id':row['id'],
'rev': row['changes'][0]['rev'],
'domain': row['doc'... | {
"content_hash": "263d61e097d44634c3a35a6a4fb85324",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 33.15384615384615,
"alnum_prop": 0.5382830626450116,
"repo_name": "gmimano/commcaretest",
"id": "98e5ef52b05b50fa7236eca77a6d5f7d78d354e3",
"size": "... |
__author__ = 'aobrien'
"""This module incorporates email sending using mailgun."""
import os
import requests
import config
# Enter the domain associated with your Mailgun account here
DOMAIN = os.getenv('MAILGUN_DOMAIN')
# Enter your Mailgun API Key here
API_KEY = os.getenv('MAILGUN_API_KEY')
def send_simple_messa... | {
"content_hash": "2b5ac2bbe8fc6b406e53a4a0d773f47b",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 81,
"avg_line_length": 29.136363636363637,
"alnum_prop": 0.625585023400936,
"repo_name": "asobrien/carlae",
"id": "bea636636fa6acd51d79ec3c73694db6fff45868",
"size": "1307"... |
import os, ssl, time, datetime
from pyasn1.type import univ, constraint, char, namedtype, tag
from pyasn1.codec.der.decoder import decode
from pyasn1.error import PyAsn1Error
import OpenSSL
import tcp
default_exp = 62208000 # =24 * 60 * 60 * 720
default_o = "mitmproxy"
default_cn = "mitmproxy"
def create_ca(o=default... | {
"content_hash": "14c76f30ee1be3bbcdd06ba3a25fb1d9",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 136,
"avg_line_length": 30.633744855967077,
"alnum_prop": 0.602498656636217,
"repo_name": "fkolacek/FIT-VUT",
"id": "0349bec7a5c5c6c7437ba761b1ad3f5699d6bedb",
"size": "74... |
"""
Runs many queries and keeps track of some results
"""
from __future__ import absolute_import, division, print_function
import sys
import textwrap
import numpy as np # NOQA
import utool as ut
from ibeis.expt import experiment_helpers
from ibeis.expt import test_result
print, rrr, profile = ut.inject2(__name__)
NOM... | {
"content_hash": "cb517c56f14c669247b3d703cd2f411e",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 87,
"avg_line_length": 38.07835820895522,
"alnum_prop": 0.5550220480156786,
"repo_name": "Erotemic/ibeis",
"id": "348ee13a3c96a541a8f647089472e37fd2dfff2d",
"size": "10229... |
import requests
from six import with_metaclass, iteritems
from future.utils import python_2_unicode_compatible
from datetime import datetime
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from .fields import Field
from .paginators import DummyPaginator
from .exceptions i... | {
"content_hash": "4ed7770b4230cf8075e0671b1e2167f2",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 235,
"avg_line_length": 37.50581395348837,
"alnum_prop": 0.6164935668888545,
"repo_name": "danicarrion/pyrestcli",
"id": "40f43d332b6262d85a95912894639167404819a3",
"size"... |
import sublime
import sublime_plugin
import decimal
try:
from . import yaml
except (ImportError, ValueError):
import yaml
s = sublime.load_settings("Pretty YAML.sublime-settings")
class PrettyyamlCommand(sublime_plugin.TextCommand):
def run(self, edit):
""" Pretty print YAML """
regions =... | {
"content_hash": "2b3e0b500b9dc21fbb0e2c6d02b16409",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 90,
"avg_line_length": 30.47826086956522,
"alnum_prop": 0.572039942938659,
"repo_name": "aukaost/SublimePrettyYAML",
"id": "56a0c9a385cbd61ff49b28cd6e802010cf47ca93",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('finaid', '0012_updates_to_finaidreviewdata'),
]
operations = [
migrations.AddField(
model_name='financialaidapplication',
na... | {
"content_hash": "7d1b3a869cb32bfd24740086216c9e22",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 393,
"avg_line_length": 41.888888888888886,
"alnum_prop": 0.6671087533156499,
"repo_name": "PyCon/pycon",
"id": "8414c6c0df7f68960775a396767aab8f5f0d999d",
"size": "778",
... |
"""
Query database to create an atom
"""
import unicodedata
import numpy as np
from operator import itemgetter
from mypython.database.element import Element
from mypython.database.table.shared_tool import cursor
from mypython.database.table.shared_tool import safe_fetchone
def merge(list_input,order):
list_tmp=... | {
"content_hash": "794d50c7ee99edb0258de3edab3c2694",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 100,
"avg_line_length": 35.77777777777778,
"alnum_prop": 0.49159663865546216,
"repo_name": "rvexiau/mypython",
"id": "40aebfef8dfc6814c803a4e0da22416cc2cd3824",
"size": "5... |
import os
import sys
from raygun4py.middleware import flask as flask_raygun
PYTHON_VERSION = sys.version_info[0]
if PYTHON_VERSION == 3:
import urllib.parse
else:
import urlparse
basedir = os.path.abspath(os.path.dirname(__file__))
if os.path.exists('config.env'):
print('Importing environment from .env f... | {
"content_hash": "7d0a50be198e4a822788117fa6a92426",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 78,
"avg_line_length": 29.5609756097561,
"alnum_prop": 0.650990099009901,
"repo_name": "hack4impact/legal-checkup",
"id": "991b6ed3172becb334fb79c8fe22b4043dee6bd6",
"size... |
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
from django.utils import unittest
from openid.consumer.consumer import SuccessResponse
from openid.consumer.discover import OpenIDServiceEndpoint... | {
"content_hash": "bf0134a5c43d40c42528cb8e82f938c9",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 110,
"avg_line_length": 40.51239669421488,
"alnum_prop": 0.5720114239086087,
"repo_name": "allink/django-admin-sso",
"id": "5d3c978c19198bf8f7e5d61cdec362c560e6e039",
"siz... |
from common import startfile, SIZES, classname, cells
if __name__ == '__main__':
fd = startfile("functions", "Identity")
def line(s=""):
print >> fd, s
for rows in SIZES:
line("import org.dnikulin.jula.fixed.%s;" % classname(rows, rows))
line()
line("public final class Identity {"... | {
"content_hash": "9e992e9ad7cb20f4abc51ba01959b952",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 88,
"avg_line_length": 27.346153846153847,
"alnum_prop": 0.5218002812939522,
"repo_name": "dnikulin/jula",
"id": "3489b55b63a1e90ddd4fda88e38158d7185e3e52",
"size": "1294",... |
from msrest.serialization import Model
class Resource(Model):
"""The Resource definition for other than namespace.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource Id
:vartype id: str
:ivar name: Resource name
:vartype name: str
... | {
"content_hash": "57a53eb0e369ed97f7aa503fa04c705e",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 72,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.5428937259923176,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "3ceb6eac8a771bad0c4f3517df2de5dd65b266bd",... |
''' Description : Extact performance scores in log folder, and print them in tables
Author : Xuesong Yang
Email : xyang45@illinois.edu
Created Date: Dec.31, 2016
'''
import re
from prettytable import PrettyTable
def getScore(fname, prefix=''):
score_lst = list()
with open(fname, 'rb')... | {
"content_hash": "bae11f446182f0a1fc09c8d8b032c1c6",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 352,
"avg_line_length": 50.415929203539825,
"alnum_prop": 0.6248902931367386,
"repo_name": "XuesongYang/end2end_dialog",
"id": "2870acbb715c91167eab89ebb756b56bc8876d76",
... |
"""
usage: run_dtests.py [-h] [--use-vnodes] [--use-off-heap-memtables] [--num-tokens NUM_TOKENS] [--data-dir-count-per-instance DATA_DIR_COUNT_PER_INSTANCE] [--force-resource-intensive-tests]
[--skip-resource-intensive-tests] [--cassandra-dir CASSANDRA_DIR] [--cassandra-version CASSANDRA_VERSION] ... | {
"content_hash": "8795460a44d47b1163d7a855170bbc76",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 200,
"avg_line_length": 56.31182795698925,
"alnum_prop": 0.5923238495321749,
"repo_name": "beobal/cassandra-dtest",
"id": "198cde2adc253f6d3400b2b3f34c964cba029f51",
"size... |
import os
from kombu import BrokerConnection
from kombu import Exchange
from kombu.pools import producers
from kombu.common import maybe_declare
class RabbitMqHelper(object):
def __init__(self):
is_container = True if os.environ.get('TEST_CONTAINER') else False
hostname = "messaging" if is_contai... | {
"content_hash": "bb8067c26fbb7bc786ee16f212b08236",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 84,
"avg_line_length": 39.1,
"alnum_prop": 0.6956521739130435,
"repo_name": "internap/almanach",
"id": "8f043f456c06a8116a816c102a30e833c002e980",
"size": "1356",
"binary... |
"""Main package for URL routing and the index page."""
# pylint: disable=relative-import
from core.controllers import cron
from core.platform import models
import feconf
import main
import webapp2
# pylint: enable=relative-import
transaction_services = models.Registry.import_transaction_services()
# Register the ... | {
"content_hash": "6ea0ab187ce43a4ec492fca3a860a100",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.7390939597315436,
"repo_name": "AllanYangZhou/oppia",
"id": "87a9353cb9b53b6a5409563db8411993d757da83",
"size": "... |
import sys, os
# 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('.'))
# -- General configurat... | {
"content_hash": "67eeb2f43be4b63dd3ce018b593da565",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 149,
"avg_line_length": 31.844202898550726,
"alnum_prop": 0.7009898737057686,
"repo_name": "kxxoling/Plim",
"id": "ff9a48eefc5bbc9785a6bdd73ada7f5ed881a82c",
"size": "9204... |
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | {
"content_hash": "039309f3f8d510fd527228398080776c",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 80,
"avg_line_length": 32.325520833333336,
"alnum_prop": 0.6913719487633933,
"repo_name": "googleapis/python-dataform",
"id": "58bb25ca955b3b515f307b5ecee360a0a2c21538",
"... |
'''
Created on Oct 29, 2015
@author: ev0l
'''
import time
import tornado.gen
from tornado.ioloop import IOLoop
from bson import ObjectId
from handlers import BaseHandler
class AddCommentHandler(BaseHandler):
'''
评论添加
'''
@tornado.gen.coroutine
def post(self):
user = str(self.get_secure_c... | {
"content_hash": "25effcb338930254395b603fe128365b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 84,
"avg_line_length": 29.56756756756757,
"alnum_prop": 0.5484460694698354,
"repo_name": "evolsnow/tornado-web",
"id": "c91d719c66b755f6a903d01d5f08d8b891c4e1e4",
"size": "... |
from array import array as Array
import cocotb
import threading
from cocotb.triggers import Timer
from cocotb.triggers import Join
from cocotb.triggers import RisingEdge
from cocotb.triggers import ReadOnly
from cocotb.triggers import FallingEdge
from cocotb.triggers import ReadWrite
from cocotb.triggers import Event
... | {
"content_hash": "6a41e95c91bb9edbf465ac33529eefff",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 81,
"avg_line_length": 31.105263157894736,
"alnum_prop": 0.5272842639593909,
"repo_name": "CospanDesign/nysa-verilog",
"id": "1fdcacca747f4769aecd63776a89ce75e48ad56d",
"s... |
from django import forms
from django.contrib.auth import get_user_model
from django.utils.translation import ugettext_lazy as _
class UserChangeForm(forms.ModelForm):
"""
Edit profile example form for registered users.
"""
first_name = forms.CharField(label=_('First name'), max_length=75)
last_na... | {
"content_hash": "90c1c1079d872f4c22eb909b4909c438",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 70,
"avg_line_length": 26.054054054054053,
"alnum_prop": 0.5892116182572614,
"repo_name": "funkbit/django-funky-user",
"id": "491236449d195a1b4aa300e742208ed8d982e917",
"si... |
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
from cgi import escape
from io import BytesIO as IO
import gzip
import functools
from flask import after_this_request, request
from flask.ext.login import current_user
import wtforms
from wtforms... | {
"content_hash": "8b1179d2bf597da9570f0ab3f3ecf52b",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 27.080745341614907,
"alnum_prop": 0.5493119266055045,
"repo_name": "storpipfugl/airflow",
"id": "a796bf525b4d6e5b3cc02e91437aa8378e75aae8",
"size": ... |
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
if cuda.available:
cuda.init()
class TestSoftmax(unittest.TestCase... | {
"content_hash": "7c972d7e7481a9a20fb0424c9e1e2b97",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 26.844155844155843,
"alnum_prop": 0.6390904692791485,
"repo_name": "elviswf/chainer",
"id": "b3dc83e0b0131d1c9293a4105fa673271cd9120b",
"size": "2067... |
import os
import sys
# 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('..'))
# -- General conf... | {
"content_hash": "2324e265e64ef42825a069dde8749b37",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 80,
"avg_line_length": 31.98173515981735,
"alnum_prop": 0.700028555111365,
"repo_name": "metasoarous/csvkit",
"id": "db470f8c55414a10cc00b96d6137c82df8ddb7ab",
"size": "74... |
import os.path
from optimiser.optimiser import Optimiser
import logging
class OptimiseJPG(Optimiser):
"""
Optimises jpegs with jpegtran (part of libjpeg)
"""
def __init__(self, **kwargs):
super(OptimiseJPG, self).__init__(**kwargs)
strip_jpg_meta = kwargs.pop('strip_jpg_meta')
... | {
"content_hash": "e42d14ebfe7d02841377cf96e74061a6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 95,
"avg_line_length": 33.888888888888886,
"alnum_prop": 0.5580327868852459,
"repo_name": "thebeansgroup/smush.py",
"id": "3334a5bd3297e3803152d0313523f09a086dc447",
"size"... |
"""
Support for Waze travel time sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.waze_travel_time/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from... | {
"content_hash": "a126a60af574e24966b2b9a03dbc80c5",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 78,
"avg_line_length": 33.82378854625551,
"alnum_prop": 0.6100547017452461,
"repo_name": "persandstrom/home-assistant",
"id": "e4cc8381edee157065a6fa257c9344803bda83cf",
"... |
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark(object):
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
self.pointer = pointer
def get_... | {
"content_hash": "fcebfc0a75766b2d5c345c95af267a0b",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 91,
"avg_line_length": 34.567567567567565,
"alnum_prop": 0.5304925723221267,
"repo_name": "Sorsly/subtle",
"id": "bfb99f226611739bae5bb6665db782c61f3064ad",
"size": "2581",... |
import os
import traceback
from builtins import str
from celery.signals import after_task_publish
from celery.signals import task_failure
from celery.signals import task_success
from celery.utils.log import get_task_logger
from django.core.exceptions import ObjectDoesNotExist
from contentcuration.models import Task
... | {
"content_hash": "fcb1c928d61eb7f87f785a2c0470f252",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 126,
"avg_line_length": 37.97560975609756,
"alnum_prop": 0.6711624919717405,
"repo_name": "DXCanas/content-curation",
"id": "8e3021b71c39d9ee303982b96f44fd8e9fd48c84",
"siz... |
import requests
while True:
req = requests.get('http://www.google.de')
if req.status_code == 200:
print('**********************************')
print('* Internet Connection available. *')
print('**********************************')
break | {
"content_hash": "208123e14847c666ebf06f3ef997a2ef",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.47560975609756095,
"repo_name": "jack6347/tools",
"id": "37c1bad1b7b8f4fc361f028819b19c87b47a7b2d",
"size": "246",... |
from CoreFoundation import CFPreferencesCopyAppValue
factoid = "software_update_server"
def fact():
"""Returns the software update server"""
sus = "None"
sus = CFPreferencesCopyAppValue(
"CatalogURL", "/Library/Preferences/com.apple.SoftwareUpdate.plist"
)
return {factoid: str(sus)}
i... | {
"content_hash": "bc90354e6158720c23a97e90d9c58e28",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 22.055555555555557,
"alnum_prop": 0.6574307304785895,
"repo_name": "chilcote/unearth",
"id": "8dbf8eb75d44648ca3781dc4859b9f441f0d69db",
"size": "397... |
import json
from kfp import components
import kfp.dsl as dsl
@dsl.pipeline(
name="Launch katib experiment",
description="An example to launch katib experiment."
)
def mnist_hpo(
name="mnist",
namespace="kubeflow",
goal=0.99,
parallelTrialCount=3,
maxTrialCount=12,
... | {
"content_hash": "725db2d5aacec42b9caa71cb3e90bece",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 184,
"avg_line_length": 35.475,
"alnum_prop": 0.5648343904157858,
"repo_name": "kubeflow/kfp-tekton-backend",
"id": "67b79890a0e3ab688214e3974c53ca15d6dc7130",
"size": "283... |
"""Utility functions for working with reports."""
__author__ = 'api.kwinter@gmail.com (Kevin Winter)'
import datetime
import gzip
import re
import StringIO
import time
import urllib
import urllib2
from adspygoogle import SOAPpy
from adspygoogle.adwords import AUTH_TOKEN_EXPIRE
from adspygoogle.adwords import AUTH_TO... | {
"content_hash": "dac267d9d3a3ffa5af2b96c989d6e2c6",
"timestamp": "",
"source": "github",
"line_count": 510,
"max_line_length": 80,
"avg_line_length": 36.48235294117647,
"alnum_prop": 0.6260346124905944,
"repo_name": "caioserra/apiAdwords",
"id": "6933382501ce4937233c013f4669371176f33287",
"size": ... |
import httplib2
from googleapiclient import discovery
from spuc import utils
def create_user(user_config, service_config):
user_config = \
utils.convert_config_file(user_config)['gapps']
service_config = \
utils.convert_config_file(service_config)['gapps']
credentials = utils.get_oauth_c... | {
"content_hash": "8b10a72d8170cc143bd6f5f70f011d6f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 65,
"avg_line_length": 28.782608695652176,
"alnum_prop": 0.676737160120846,
"repo_name": "davidginzbourg/spuc",
"id": "ee9e7d9a6966d86d2d1d972b07493a6cebcd611c",
"size": "6... |
from __future__ import absolute_import, unicode_literals
import os
import sys
from django.conf import settings
# Corrects some pathing issues in various contexts, such as cron jobs,
# and the project layout still being in Django 1.3 format.
sys.path.append(os.path.abspath(os.path.join(settings.PROJECT_ROOT, "..")))
... | {
"content_hash": "102f6b9bf8b3d92204113df00e32d5b7",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 33.55555555555556,
"alnum_prop": 0.717439293598234,
"repo_name": "mauriziobit/cookiecutter-mezzanine",
"id": "4158e07eec807fd6000f85a134c5a2f56a97d320"... |
from __future__ import absolute_import, unicode_literals
import unittest
import django
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from django.test import TestCase
from wagtail.wagtailcore.models import Page, PAGE_TEMPLATE_VAR, Site
@unittest.skipIf(django.V... | {
"content_hash": "fe08c31aa67c2e68d90d9df0588fda5b",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 123,
"avg_line_length": 33.03846153846154,
"alnum_prop": 0.6530849825378346,
"repo_name": "hanpama/wagtail",
"id": "b5392615997a552b1be832c3820753034d54eb35",
"size": "1718... |
"""
Global configuration for Code TA
"""
| {
"content_hash": "fd99b472a62d915b918b34a30f035645",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 36,
"avg_line_length": 15,
"alnum_prop": 0.6222222222222222,
"repo_name": "smarie5/codeta",
"id": "b38687e63254c1ddd6b13117a9c365e9b61b8dc3",
"size": "45",
"binary": false... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_tasker', '0005_auto_20170107_2302'),
]
operations = [
migrations.AlterIndexTogether(
name='taskinfo',
index_together=set([('i... | {
"content_hash": "a215fa01fdb28dccda0f2de3915bcc9a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 152,
"avg_line_length": 26.764705882352942,
"alnum_prop": 0.5692307692307692,
"repo_name": "wooyek/django-tasker",
"id": "071472a6ad42f636890dd1b7fadfc41ae82008ee",
"size":... |
from __future__ import absolute_import
def fail():
c1()
def c1():
c2()
def c2():
import exception
fail()
| {
"content_hash": "cef0451ac65a2626f9549f47d18283e4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 38,
"avg_line_length": 7.8125,
"alnum_prop": 0.56,
"repo_name": "guildai/guild",
"id": "9ce12e67055709b896a648b97b20927060b899f1",
"size": "125",
"binary": false,
"copi... |
if __name__ == '__main__':
import unittest
import os
def load_tests(loader, tests, pattern):
tests_dir = os.path.dirname(__file__)
tests.addTests(loader.discover(start_dir=tests_dir, pattern=pattern or 'test*.py'))
return tests
unittest.main()
| {
"content_hash": "944dc4e606890028f10818e890a83ee0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 91,
"avg_line_length": 28.6,
"alnum_prop": 0.6118881118881119,
"repo_name": "sissaschool/elementpath",
"id": "29fb20ed1e69cde74d70af280582ff2c0fe53b2f",
"size": "1114",
"... |
"""
WSGI config for about_tmpl project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "6989a1af49bfaafb9e384100db50e2db",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.875,
"alnum_prop": 0.7688442211055276,
"repo_name": "JuneDeng2014/working_notes",
"id": "afb133c44ccdd77d9ab1c361120ba63f07537a8f",
"size": "398",... |
from case import Case
class Case4_2_3(Case):
DESCRIPTION = """Send small text message, then send frame with reserved control <b>Opcode = 13</b>, then send Ping."""
EXPECTATION = """Echo for first message is received, but then connection is failed immediately, since reserved opcode frame is used. A Pong... | {
"content_hash": "d3759c373ac8e8aafdde466d6c5eaa53",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 162,
"avg_line_length": 43.5,
"alnum_prop": 0.6628352490421456,
"repo_name": "crossbario/autobahn-testsuite",
"id": "66bed28e51f54cff01f8087939d6ac94da970fb5",
"size": "158... |
from onfido import Api
from .test_data import * # flake8: noqa
import unittest2
import os
import time
import random
class IntegrationTest(unittest2.TestCase):
def create_api(self):
# suitable obtuse enough env variable that it won't be set already
api_token = os.environ['ONFIDO_INTEGRATION_TEST_AP... | {
"content_hash": "5934905a72a0c14030dae4bf4624d357",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 100,
"avg_line_length": 34.68032786885246,
"alnum_prop": 0.6060033089104231,
"repo_name": "smcl/pyonfido",
"id": "02cda60d18f327a34747b4aa1960d304fb6984de",
"size": "4231"... |
'''
'''
from __future__ import print_function
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
import pyglet
__all__ = ['link_GL', 'link_GLU', 'link_AGL', 'link_GLX', 'link_WGL']
_debug_gl = pyglet.options['debug_gl']
_debug_gl_trace = pyglet.options['debug_gl_trace']
_debug_gl_trace_args = py... | {
"content_hash": "e68cb6a5a6fbda01b0ab89c014b89b84",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 78,
"avg_line_length": 32.28181818181818,
"alnum_prop": 0.6333427203604618,
"repo_name": "nicememory/pie",
"id": "8e56210fb421060d79969b93e518133e7a9ab91b",
"size": "5270"... |
import importlib
import os
from pathlib import Path
import pytest
from ...utils import needs_py310
@needs_py310
def test_testing_dbs_py39(tmp_path_factory: pytest.TempPathFactory):
tmp_path = tmp_path_factory.mktemp("data")
cwd = os.getcwd()
os.chdir(tmp_path)
test_db = Path("./test.db")
if test... | {
"content_hash": "0c2abf21006439eca5e30826051ca39b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 87,
"avg_line_length": 28.76923076923077,
"alnum_prop": 0.6885026737967914,
"repo_name": "tiangolo/fastapi",
"id": "9e6b3f3e2ccb007eacaa28fb99124252259f180c",
"size": "748"... |
from datetime import datetime, timedelta
from nose.tools import eq_
from mock import Mock, patch
import amo
import amo.tests
from addons.models import Addon
from users.models import UserProfile
from devhub.models import ActivityLog
from mkt.developers.models import (AddonPaymentAccount, CantCancel,
... | {
"content_hash": "223aaa7322876d2f9f57f3b13602c8c1",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 77,
"avg_line_length": 35.65,
"alnum_prop": 0.6083839800529842,
"repo_name": "wagnerand/zamboni",
"id": "503566f776df3e78911374cc8ca96df3aa2ec6b1",
"size": "6417",
"bina... |
import spotipy.core.baseplaylist
import spotify
class SpotifyPlayList(spotipy.core.baseplaylist.BasePlayList):
def __init__(self, wrapper, pl, name = None):
spotipy.core.baseplaylist.BasePlayList.__init__(self, wrapper)
self.__spotify_playlist = pl
self.__name = name
self.__listed =... | {
"content_hash": "fcada63140b824870c267d26340e1f8c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 70,
"avg_line_length": 38.27272727272727,
"alnum_prop": 0.49406175771971494,
"repo_name": "ZenHarbinger/spotipy",
"id": "dad481be01cc142fbed2a59dbab63540b373f70f",
"size": ... |
from transmute_core.function.signature import Argument, NoDefault
from transmute_core.http_parameters import get_swagger_parameters
from transmute_core import default_context
from transmute_core.http_parameters import Parameters, Param, ParamSet
def test_swagger_parameters():
parameters = Parameters(
quer... | {
"content_hash": "a204355fa90c48fcc7047e638840dbb6",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 86,
"avg_line_length": 28.756410256410255,
"alnum_prop": 0.4551939366919304,
"repo_name": "toumorokoshi/web-transmute",
"id": "5cdd81378e76f8b57b9da29dc5f96ba5f555423a",
"s... |
from collections import OrderedDict, defaultdict
from collections.abc import Iterable
from copy import deepcopy
from pathlib import Path
from xml.etree import ElementTree as ET
import openmc
import openmc._xml as xml
from .checkvalue import check_type
class Geometry:
"""Geometry representing a collection of surf... | {
"content_hash": "dc6b08c04dc43d0e6cd33d3f938c232f",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 88,
"avg_line_length": 33.368852459016395,
"alnum_prop": 0.5753868828297716,
"repo_name": "amandalund/openmc",
"id": "58a33c1b1217427ac7aa311e216787f77d9eab88",
"size": "2... |
"""
csvcut is originally the work of eminent hackers Joe Germuska and Aaron Bycoffe.
This code is forked from:
https://gist.github.com/561347/9846ebf8d0a69b06681da9255ffe3d3f59ec2c97
Used and modified with permission.
"""
import itertools
from csvkit import CSVKitReader, CSVKitWriter
from csvkit.cli import CSVKitUt... | {
"content_hash": "0d004a56945500a7b476da227c02a0b9",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 123,
"avg_line_length": 39.56164383561644,
"alnum_prop": 0.6648199445983379,
"repo_name": "unpingco/csvkit",
"id": "1795d8de7b56661bcee1bbe6de14ded7aefc715f",
"size": "2911... |
"""
A tool to generate a predetermined resource ids file that can be used as an
input to grit via the -p option. This is meant to be run manually every once in
a while and its output checked in. See tools/gritsettings/README.md for details.
"""
from __future__ import print_function
import os
import re
import sys
# R... | {
"content_hash": "72ae91c11efb659afd9664671fa165ef",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 80,
"avg_line_length": 33.18705035971223,
"alnum_prop": 0.7129850422718405,
"repo_name": "endlessm/chromium-browser",
"id": "9b2aa7b1a578155b5af5ddc650d4a54e8f8500e3",
"si... |
import os
import sys
from django import http
from django.conf.urls import url
import app.views
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "personRegister.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
def index(... | {
"content_hash": "bdcb0140b956461dbe982e0a30bb7d38",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 25.785714285714285,
"alnum_prop": 0.7340720221606648,
"repo_name": "aprendist-repo/test",
"id": "35aa3ad434f673c97308fef3607e98593fe4dbba",
"size": "... |
"""Logical units dealing with storage of instances."""
import itertools
import logging
import os
import time
from ganeti import compat
from ganeti import constants
from ganeti import errors
from ganeti import ht
from ganeti import locking
from ganeti.masterd import iallocator
from ganeti import objects
from ganeti im... | {
"content_hash": "85072568709285863dae4a52c5137199",
"timestamp": "",
"source": "github",
"line_count": 3112,
"max_line_length": 80,
"avg_line_length": 38.926735218508995,
"alnum_prop": 0.6302459963678388,
"repo_name": "onponomarev/ganeti",
"id": "3abc5f8ee0e54e8cb9b38e54fc24d0f404f70e9d",
"size": ... |
from fuzzywuzzy import process
import codecs#, re, sys
from residents import RESIDENTS, NAMES
filename = raw_input('Enter a name for the new file: ')
file = codecs.open(filename, 'w', encoding='utf-8', errors='ignore')
for resident in RESIDENTS:
match = process.extractOne(resident, NAMES)
name, accuracy = match[0]... | {
"content_hash": "878d8a7a54d448b2bfd65ad1459d5b0f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 34,
"alnum_prop": 0.6843137254901961,
"repo_name": "swiharta/radres",
"id": "9a18fa0b2044ba6be3c2f30eeb4b35f1e86a258d",
"size": "510",
"binary": fa... |
import os
# With the addition of Keystone, to use an openstack cloud you should
# authenticate against keystone, which returns a **Token** and **Service
# Catalog**. The catalog contains the endpoint for all services the
# user/tenant has access to - including nova, glance, keystone, swift.
#
# *NOTE*: Using the 2.0 ... | {
"content_hash": "10ddac7e8c5e27e4b904498a42330c6a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 42.391304347826086,
"alnum_prop": 0.7138461538461538,
"repo_name": "wettenhj/mytardis-swift-uploader",
"id": "8918554632890de54b14794e5fac542aaf4ce0e6"... |
import os
import socket
from nova.openstack.common import cfg
from nova.openstack.common import rpc
def _get_my_ip():
"""
Returns the actual ip of the local machine.
This code figures out what source address would be used if some traffic
were to be sent out to some well known address on the Internet... | {
"content_hash": "dc54600112da82b53ef6e1715b327090",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 35.215384615384615,
"alnum_prop": 0.581476627348187,
"repo_name": "fajoy/nova",
"id": "172e772ae5a6a47d9708e588ef835ff1d2d0829b",
"size": "3097",
"... |
from __future__ import print_function
import atexit as _atexit
import codecs as _codecs
import fnmatch as _fnmatch
import getpass as _getpass
import os as _os
import random as _random
import re as _re
import shutil as _shutil
import subprocess as _subprocess
import sys as _sys
import tarfile as _tarfile
import tempfil... | {
"content_hash": "aa02a6833343d338f0c54195b297f251",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 111,
"avg_line_length": 24.612962962962964,
"alnum_prop": 0.6308027988864645,
"repo_name": "irinabov/debian-qpid-cpp-1.35.0",
"id": "e76fba03eb432025c6bb15680ffd33b66a1e91d3... |
'collectons module study'
__author__ = 'XieYu'
from collections import namedtuple
Point = namedtuple('Point', ['x', 'y'])
p = Point(1, 2)
print(p.x, p.y)
from collections import deque
q = deque(['a', 'b', 'c'])
q.append('x')
q.appendleft('y')
print(q) | {
"content_hash": "145ef0e22973cc9ecb9435191266f5af",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 17,
"alnum_prop": 0.6392156862745098,
"repo_name": "xieyufish/note",
"id": "d8ff3456ecc284e008c7a700ecf65377778498d2",
"size": "303",
"binary": fal... |
import re
import sys
from b2.util.utility import *
from b2.build import feature
from b2.util import sequence, qualify_jam_action, is_iterable_typed
import b2.util.set
from b2.manager import get_manager
__re_two_ampersands = re.compile ('&&')
__re_comma = re.compile (',')
__re_split_condition = re.compile (... | {
"content_hash": "0becdb2355a5460332c518187bbd45e1",
"timestamp": "",
"source": "github",
"line_count": 645,
"max_line_length": 95,
"avg_line_length": 31.804651162790698,
"alnum_prop": 0.570927171687628,
"repo_name": "zjutjsj1004/third",
"id": "e49ff9c5fa94b2edc53a1922614619969e4f8ca4",
"size": "20... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "666c29437d0b5094b1dcc364d9cf5899",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 110,
"avg_line_length": 40.78350515463917,
"alnum_prop": 0.5664812942366027,
"repo_name": "plaid/plaid-python",
"id": "eb34c6a5650f9f9c26d920aa07ef3d85f8bfb2a8",
"size": "... |
from django.conf.urls import patterns, url
from storybase_taxonomy.views import CategoryExplorerRedirectView, TagStoryListView
urlpatterns = patterns('',
url(r'topics/(?P<slug>[0-9a-z-]+)/$',
CategoryExplorerRedirectView.as_view(),
name='topic_stories'),
url(r'tags/(?P<slug>[0-9a-z-]+)/$',
... | {
"content_hash": "d1d366c6146ece6c224a6af9bdc9d9d5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 83,
"avg_line_length": 32.083333333333336,
"alnum_prop": 0.6545454545454545,
"repo_name": "denverfoundation/storybase",
"id": "078317e70972b11746d9b1b8719b1c8f20ce5549",
"s... |
"""
This module defines available model types.
"""
from __future__ import print_function
from muddery.worlddata.data_sets import DataSets as BaseDataSets
from muddery.worlddata.data_handler import DataHandler, SystemDataHandler, LocalizedStringsHandler
class DataSets(BaseDataSets):
def at_creation(self):
... | {
"content_hash": "9858bad7ad22b2668461d63b96f68691",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 98,
"avg_line_length": 26.904761904761905,
"alnum_prop": 0.6938053097345133,
"repo_name": "MarsZone/DreamLand",
"id": "ba803685e9e20fb3f7ed6259dbbe34931af6af95",
"size": "5... |
"""
jobber.conf
~~~~~~~~~~~
Exposes a `_Settings_` instance with applied overrides from local.py.
"""
from jobber.conf import default as default_settings
try:
from jobber.conf import local as local_settings
except ImportError:
local_settings = None
def _make_dict(module):
"""Transforms a module into a ... | {
"content_hash": "c33e8efc2837e03c9ea99b180ac3bed5",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 74,
"avg_line_length": 22.790697674418606,
"alnum_prop": 0.6418367346938776,
"repo_name": "hackcyprus/jobber",
"id": "1ce5979967385308d94443d1932ceddd07a79642",
"size": "98... |
from __future__ import unicode_literals
from netmiko.brocade.brocade_nos_ssh import BrocadeNosSSH
from netmiko.brocade.brocade_fastiron import BrocadeFastironSSH
from netmiko.brocade.brocade_fastiron import BrocadeFastironTelnet
from netmiko.brocade.brocade_netiron import BrocadeNetironSSH
from netmiko.brocade.brocade_... | {
"content_hash": "170a24f74bd3873b7776416fb1a3574a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 74,
"avg_line_length": 54.22222222222222,
"alnum_prop": 0.8258196721311475,
"repo_name": "isidroamv/netmiko",
"id": "c841d136c88de259854bd8f933864f25a2ca3f46",
"size": "488"... |
#!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributio... | {
"content_hash": "c2eed45a02467e96007bcb4a29ca9291",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 101,
"avg_line_length": 50.166666666666664,
"alnum_prop": 0.7757475083056479,
"repo_name": "hxxft/lynx-native",
"id": "891681ffd71f549576cff1aa50202e129b92ee88",
"size": "3... |
import base64
import datetime
import sys
import time
import unittest
import xmlrpclib
import SimpleXMLRPCServer
import mimetools
import httplib
import socket
import StringIO
import os
import re
from test import test_support
try:
import threading
except ImportError:
threading = None
try:
unicode
except Nam... | {
"content_hash": "9ec9d573113cab9f7b7cd1372eca3862",
"timestamp": "",
"source": "github",
"line_count": 1018,
"max_line_length": 88,
"avg_line_length": 37.97151277013752,
"alnum_prop": 0.6133747251325831,
"repo_name": "fkolacek/FIT-VUT",
"id": "2a3b2d97a5b0866ec0a8040b94bf709f1fadae75",
"size": "38... |
"""Adds models and methods to handle multiple phone numbers, email
addresses etc ("contact details") per partner. See
:doc:`/specs/phones`.
.. autosummary::
:toctree:
fixtures.demo2
"""
from lino.api import ad, _
class Plugin(ad.Plugin):
verbose_name = _("Contact Details")
partner_model = 'contacts... | {
"content_hash": "c305963b64f32fa49716955fad0f734d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 72,
"avg_line_length": 29.13888888888889,
"alnum_prop": 0.6320305052430887,
"repo_name": "lino-framework/xl",
"id": "17471fadeedcaf6e8b3182d0e0858a4b796df37f",
"size": "116... |
import abc
class ParseException(RuntimeError):
pass
class BaseParser(abc.ABC):
@abc.abstractmethod
def parse(self, content):
raise NotImplementedError()
from .html import HTMLParser
from .markdown import MarkdownParser
| {
"content_hash": "8aa52453fc7b4dd10ed25ee3f61f4b42",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 36,
"avg_line_length": 16.333333333333332,
"alnum_prop": 0.7387755102040816,
"repo_name": "orf/wordinserter",
"id": "321d6a77a89a4b557fa0cf1cd292ad292327b94d",
"size": "245... |
import fnmatch
import glob
import optparse
import os
import posixpath
import shutil
import stat
import sys
import time
import zipfile
if sys.version_info < (2, 6, 0):
sys.stderr.write("python 2.6 or later is required run this script\n")
sys.exit(1)
def IncludeFiles(filters, files):
"""Filter files based on inc... | {
"content_hash": "ecbdffe2453c52bb0439e9afa9b6edeb",
"timestamp": "",
"source": "github",
"line_count": 531,
"max_line_length": 80,
"avg_line_length": 31.322033898305083,
"alnum_prop": 0.6287878787878788,
"repo_name": "loopCM/chromium",
"id": "2ae8c4a2f3ce83f955584ea27152f3d67ca44811",
"size": "168... |
import argparse
from requestbuilder import Arg, MutuallyExclusiveArgList
from euca2ools.commands.argtypes import delimited_list
from euca2ools.commands.monitoring import CloudWatchRequest
from euca2ools.commands.monitoring.argtypes import cloudwatch_dimension
def _statistic_set(set_as_str):
pairs = {}
for p... | {
"content_hash": "12fdffbfa5dcdae9477164bfa648a0d4",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 47.642857142857146,
"alnum_prop": 0.5745877061469266,
"repo_name": "vasiliykochergin/euca2ools",
"id": "0705c9feac1e6552c84f8fdff398b76b0f127823",
"s... |
class EMI_CALCULATOR(object):
# Data attributes
# Helps to calculate EMI
Loan_amount = None # assigning none values
Month_Payment = None # assigning none values
Interest_rate = None #assigning none values
Payment_period = None #assigning none values
def get_loan_amount(self):
... | {
"content_hash": "156d800d3d9f894a6cffca08dec6c0f9",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 136,
"avg_line_length": 34.10294117647059,
"alnum_prop": 0.5627425614489003,
"repo_name": "ActiveState/code",
"id": "ca78d35032e1d7b724a556b732f7a5b2ecd729ed",
"size": "268... |
import logging
from datetime import datetime
from peewee import DoesNotExist
from telegram import ParseMode
from telegram.ext import JobQueue
from config import JIRA_REQUESTS_SECONDS_PERIOD
from model import Chat, Permission, User
from service import jira_service
def init_bot(job_queue: JobQueue):
for chat in C... | {
"content_hash": "85e5ba7548b33391b46dcc3f2541a530",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 30.468354430379748,
"alnum_prop": 0.6024096385542169,
"repo_name": "boggard/jira-telegram-bot",
"id": "76cfc6340e1c065f048119caae5584ffb5db978d",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.