text stringlengths 4 1.02M | meta dict |
|---|---|
"""Various utilities to power the command line interface."""
import importlib
import inspect
import os
import sys
import click
import nlp_playground.scripts as scripts
from nlp_playground.lib.data import list_datasets
DATASET_PARAM_NAME = 'dataset'
def import_script(command):
"""Return a module under /scripts/... | {
"content_hash": "1da7df20b11c69cc4936dabb1ae91d08",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 29.487179487179485,
"alnum_prop": 0.6539130434782608,
"repo_name": "jamesmishra/nlp-playground",
"id": "d0759c4b949f8bd56dd45fe65eb39a653a4168e2",
"s... |
"""This code example creates new orders.
To determine which orders exist, run get_all_orders.py."""
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
import uuid
# Import appropriate modules from the client library.
from googleads import dfp
COMPANY_ID = 'INSERT_ADVERTISER_COMPANY_ID_HERE'
SALESPERSON... | {
"content_hash": "0c132fa10118753b33bf18fa179cf9b6",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 70,
"avg_line_length": 27.65909090909091,
"alnum_prop": 0.6647493837304848,
"repo_name": "ya7lelkom/googleads-python-lib",
"id": "24d967e3e281e81469d6a69473ea9d3e2f8437bf",
... |
"""
File: settings.py
Author: William J. Bosl
Children's Hospital Boston
300 Longwood Avenue
Boston, MA 02115
Email: william.bosl@childrens.harvard.edu
Web: http://chip.org
Copyright (C) 2011 William Bosl, Children's Hospital Boston Informatics Program (CHIP)
http://chip.org.
... | {
"content_hash": "6fad4a225e7eabba153a7077d742c7c4",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 90,
"avg_line_length": 32.77297297297297,
"alnum_prop": 0.7093847930067624,
"repo_name": "smart-classic/smart_sample_apps",
"id": "c4579dd7eac8c97ea38aa6a677bbca59ab0c13da",... |
import re
import sys
import logging
from ming.orm import session
from mock import patch, Mock
from . import base
from allura import model as M
log = logging.getLogger(__name__)
class CreateTroveCategoriesCommand(base.Command):
min_args = 1
max_args = None
usage = '<ini file>'
summary = 'Remove any... | {
"content_hash": "415817db6b6d373595ab881bb0c05d48",
"timestamp": "",
"source": "github",
"line_count": 2012,
"max_line_length": 150,
"avg_line_length": 66.45029821073558,
"alnum_prop": 0.5704946970036949,
"repo_name": "heiths/allura",
"id": "288117c1f8377c1e56ab925dbfd9f4dec6221f34",
"size": "1345... |
from flask import current_app
from werkzeug.local import LocalProxy
# Application Context
# ===================
#
# Readability proxies
def _get_workspace():
return current_app.cubes_workspace
def _get_logger():
return current_app.cubes_workspace.logger
workspace = LocalProxy(_get_workspace)
logger = LocalP... | {
"content_hash": "1bcd2b5ab97adf5c3449d73a025722ba",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 45,
"avg_line_length": 19.941176470588236,
"alnum_prop": 0.7168141592920354,
"repo_name": "she11c0de/cubes",
"id": "434f005eba0db12534e7bc9c3da4fbae79b029bf",
"size": "363"... |
"""Returns points that minimizes the maximum distance of any point to a center.
Implements the k-Center-Greedy method in
Ozan Sener and Silvio Savarese. A Geometric Approach to Active Learning for
Convolutional Neural Networks. https://arxiv.org/abs/1708.00489 2017
Distance metric defaults to l2 distance. Features ... | {
"content_hash": "2ea461ceafdd9fb9256a033f75a43a1b",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 80,
"avg_line_length": 34.51376146788991,
"alnum_prop": 0.6972355130249868,
"repo_name": "google/active-learning",
"id": "ff7e548955921a46815f6354630b3fe1f1c5c09c",
"size"... |
"""
CiscoTpTcCeSSH Class
Class to manage Cisco Telepresence Endpoint on TC/CE software release. Also working for Cisco
Expressway/VCS
Written by Ahmad Barrin
"""
from __future__ import unicode_literals
import time
import re
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoTpTcCeSSH(CiscoSSHCon... | {
"content_hash": "170062f72748936fc0f043071bf7e3f6",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 99,
"avg_line_length": 37.172413793103445,
"alnum_prop": 0.6366728509585653,
"repo_name": "isidroamv/netmiko",
"id": "0bd20714d527f4b5c713afb28e80962e21ad65ea",
"size": "32... |
import numpy as np
import cv2
import cvui
WINDOW_NAME = 'Button shortcut'
def main():
frame = np.zeros((150, 650, 3), np.uint8)
# Init cvui and tell it to use a value of 20 for cv2.waitKey()
# because we want to enable keyboard shortcut for
# all components, e.g. button with label "&Quit".
# If cvui has a value... | {
"content_hash": "f518686f6beee0f9c943604b10da1f66",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 113,
"avg_line_length": 30.394736842105264,
"alnum_prop": 0.6805194805194805,
"repo_name": "Dovyski/cvui",
"id": "a9bb5b186409b7994bb100626bc0356c7a2cf655",
"size": "1402",... |
"""
https://leetcode.com/problems/basic-calculator-ii/
https://leetcode.com/submissions/detail/111848037/
"""
class Solution(object):
def calculate(self, s):
"""
:type s: str
:rtype: int
"""
array = []
index = 0
numbers = '0123456789'
number = ''
... | {
"content_hash": "1018f0c9db509cda25f8da9c05dd322d",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 95,
"avg_line_length": 32.89430894308943,
"alnum_prop": 0.4112703905091448,
"repo_name": "vivaxy/algorithms",
"id": "a6cd798f3fecf0cfe067c9d7d8af4dd381d84c54",
"size": "40... |
import os
import time
import imath
import IECore
import Gaffer
import GafferScene
import GafferUI
import GafferSceneUI
scriptWindow = GafferUI.ScriptWindow.acquire( script )
viewer = scriptWindow.getLayout().editors( GafferUI.Viewer )[0]
graphEditor = scriptWindow.getLayout().editors( GafferUI.GraphEditor )[0]
hie... | {
"content_hash": "1531b876ba70192cd7524145606ab340",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 178,
"avg_line_length": 48.56956521739131,
"alnum_prop": 0.7662698057470235,
"repo_name": "GafferHQ/gaffer",
"id": "17bdcdd5f41c9c62ae141bc9d24cf6eec83645a4",
"size": "123... |
'''
Mac OS X implementations of various commands in the "desktop" interface
'''
# Define the module's virtual name
__virtualname__ = 'desktop'
def __virtual__():
'''
Only load on Mac systems
'''
if __grains__['os'] == 'MacOS':
return __virtualname__
return False
def get_output_volume():... | {
"content_hash": "9f2b0795e450613f03c5fe8a8d278385",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 108,
"avg_line_length": 18.692307692307693,
"alnum_prop": 0.5843621399176955,
"repo_name": "victorywang80/Maintenance",
"id": "dd836165d2131d1db8f2ed17254256c903b61846",
"s... |
import yaml
class AnInstance:
def __init__(self, foo, bar):
self.foo = foo
self.bar = bar
def __repr__(self):
try:
return "%s(foo=%r, bar=%r)" % (self.__class__.__name__,
self.foo, self.bar)
except RuntimeError:
return "%s(foo=..., b... | {
"content_hash": "c4a070ae13ad0c056d203aca6a56ec34",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 67,
"avg_line_length": 26.020408163265305,
"alnum_prop": 0.5513725490196079,
"repo_name": "pexip/os-pyyaml",
"id": "312204ead76a334eb38e18ec5d34b84cbad12244",
"size": "1276... |
import os, sys, popen2
class Batch:
def __init__(self):
self.jobs = {}
self.outputs = {}
def add_job(self, id, input):
self.jobs[id] = input
def get_job(self, id):
return self.jobs[id]
def run(self):
abstract
class BatchCmd(Batch):
def __init__(self, com... | {
"content_hash": "fd3f70589cfca7b39fdba32c48fbaa8e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 57,
"avg_line_length": 21.025641025641026,
"alnum_prop": 0.5304878048780488,
"repo_name": "hectormartinez/rougexstem",
"id": "03306b4ca00705d8fef636d69135be35a5b50dc2",
"si... |
from __future__ import print_function
import os
from catkin_pkg.package_templates import create_package_files, PackageTemplate
# Exempt build directories
# See https://github.com/catkin/catkin_tools/issues/82
def prepare_arguments(parser):
# Workspace / profile args
# add_context_args(parser)
subparse... | {
"content_hash": "1c8062a8018cde0bb9ef5f1ce48226ef",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 94,
"avg_line_length": 40.95070422535211,
"alnum_prop": 0.6113499570077386,
"repo_name": "iwanders/catkin_tools",
"id": "d389595f2a7ab01be0aa8d617d8e113f714a0ffc",
"size":... |
from django import forms
from .models import FeriadoCalendarioAcademico
class CreateFeriadoForm(forms.ModelForm):
class Meta:
model = FeriadoCalendarioAcademico
fields = ['nome', 'data'] | {
"content_hash": "983cd6b58be34a00373a320cc0ac5fa8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 46,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.788659793814433,
"repo_name": "bczmufrn/frequencia",
"id": "f3b6a77389c8d30ae920e1d733f99bc7eb05946e",
"size": "19... |
from django.contrib import admin
from .models import Game, Question
from django.utils.translation import ugettext_lazy as _
class GameAdmin(admin.ModelAdmin):
pass
admin.site.register(Game, GameAdmin)
class QuestionAdmin(admin.ModelAdmin):
list_display = ('game', 'question', 'value')
fieldsets = (
... | {
"content_hash": "f7e47b397a453b1df70b3f96fb56b66c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 63,
"avg_line_length": 28.483870967741936,
"alnum_prop": 0.5560588901472253,
"repo_name": "codefisher/web_games",
"id": "90cbfe41d125c6ec969c36e5b9083679b3df2c6e",
"size": ... |
from .exceptions import ToleoException
from .types import GenericSoftware, PypiSoftware, GithubSoftware, \
BitbucketSoftware, AurPackage, ArchPackage, YumPackage, Collection
from .utils import process
__all__ = [
'ToleoException',
'GenericSoftware',
'PypiSoftware',
'GithubSoftware',
'Bitbucket... | {
"content_hash": "f4ea790638351bebdc9ea20f2f1decc6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 70,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.6976190476190476,
"repo_name": "carlwgeorge/toleo-old",
"id": "bc52f3185065edff02f01acf5a46871dab1c7cf7",
"size":... |
import threading
from PyQt4.QtCore import Qt, QAbstractListModel, QModelIndex
from PyQt4.QtGui import QVBoxLayout, QHBoxLayout, QDialogButtonBox, QLabel, QPushButton, QWidget, QTreeView, \
QSizePolicy, qApp
import hex.utils as utils
import hex.hexlineedit as hexlineedit
import hex.matchers as ma... | {
"content_hash": "ec606635ebba18e3c4a9f6eea9a482b5",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 119,
"avg_line_length": 42.935064935064936,
"alnum_prop": 0.6491228070175439,
"repo_name": "zenwarr/microhex",
"id": "777c4288758456f43d10d32f953339a3425dce6c",
"size": "6... |
import io
import itertools
import os
import re
import cherrypy
from cherrypy._cpreqbody import Part
from girder.api.rest import setResponseHeader, setContentDisposition
from girder.exceptions import GirderException, ValidationException, FilePathException
from girder.models.setting import Setting
from girder.settings ... | {
"content_hash": "5819332b96dc43052395d2ea5fb0ecf5",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 100,
"avg_line_length": 38.135440180586905,
"alnum_prop": 0.6202793891322363,
"repo_name": "RafaelPalomar/girder",
"id": "b8b43140fca79989e421cf1cbf075beaa4b1675b",
"size"... |
"""
This module contains functions to handle markers. Used by both the
marker functionality of `~matplotlib.axes.Axes.plot` and
`~matplotlib.axes.Axes.scatter`.
All possible markers are defined here:
============================== ===============================================
marker descrip... | {
"content_hash": "7f544a17708222dc7ec66896b6207e90",
"timestamp": "",
"source": "github",
"line_count": 775,
"max_line_length": 79,
"avg_line_length": 33.44129032258064,
"alnum_prop": 0.48493266967627424,
"repo_name": "Solid-Mechanics/matplotlib-4-abaqus",
"id": "e1b5c9174f9839c74df506b13a6399d436cc0... |
import unittest
from Tests.UnitTests._BasePlot_UnitTest import _BasePlotTestCase
from Tests.UnitTests.DatasetTools_UnitTest import DatasetsToolsTestCase
from Tests.UnitTests.ModelUtils_UnitTest import ModelUtilsTestCase
from Tests.UnitTests.DataFrameManipulation_UnitTest import DataFrameManipulationTestCase
def test... | {
"content_hash": "9a7f22ceb662b1257d2d7bd701bda1d5",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 88,
"avg_line_length": 35.21739130434783,
"alnum_prop": 0.7814814814814814,
"repo_name": "sagivba/MachineLearningUtils",
"id": "23e05a85dac0054f2e0c0f5e0306af34ee59c2a9",
"... |
import scrapy
from urllib import unquote
from urlparse import urljoin
from dspbooks.items import BookItem
class DSPBooksSpider(scrapy.Spider):
name = 'dspbooks'
base_url = 'http://serv.yanchick.org/Books/dsp_books/'
start_urls = ['http://serv.yanchick.org/Books/dsp_books/']
def parse(self, response):
... | {
"content_hash": "fe25b57a2c07c047e530a7d2b6386af6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 36.526315789473685,
"alnum_prop": 0.6210374639769453,
"repo_name": "gpalsingh/dspbooksspider",
"id": "dc80176e18698aaedf5f223b76a884d96575a453",
"siz... |
import os
import struct
from unittest import TestCase
import numpy as np
import torch
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
import tensorflow as tf
from pose_format.utils.reader import BufferReader, ConstStructs
class TestBufferReader(TestCase):
def test_bytes_left(self):
reader = BufferReader(byt... | {
"content_hash": "242f13ad7b961e701a1e84d44b203803",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 105,
"avg_line_length": 33.24691358024691,
"alnum_prop": 0.6104715930189379,
"repo_name": "AmitMY/pose-format",
"id": "de6abfcbabe60833ce81fab14915449ebd39e174",
"size": "2... |
import msgpack
try:
import ujson as json
except ImportError:
import json
class JSONSerializer:
@staticmethod
def pack(data):
return json.dumps(data).encode()
@staticmethod
def unpack(data):
decoded = data.decode() if isinstance(data, bytes) else data
return json.loads... | {
"content_hash": "d966cbcae2f624bced91c5b7c1939535",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 69,
"avg_line_length": 20.88888888888889,
"alnum_prop": 0.6684397163120568,
"repo_name": "zhebrak/raftos",
"id": "57453759bcd42ce1e3eaea6f55d0dbbbb2be0cde",
"size": "564",
... |
def get_number_of_app_ports(app):
"""
Get the number of ports for the given app JSON. This roughly follows the
logic in marathon-lb for finding app IPs/ports, although we are only
interested in the quantity of ports an app should have and don't consider
the specific IPs/ports of individual tasks:
... | {
"content_hash": "d571d2c7ddd11fcb01da9ab056a61efa",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 33.294117647058826,
"alnum_prop": 0.6454652532391049,
"repo_name": "praekeltfoundation/certbot",
"id": "36b257c8245b66c894f350eb2eb7e24786b0ff7b",
"... |
import pytest
import numpy as np
from datetime import date, timedelta, time, datetime
import dateutil
import pandas as pd
import pandas.util.testing as tm
from pandas.compat import lrange
from pandas.compat.numpy import np_datetime64_compat
from pandas import (DatetimeIndex, Index, date_range, DataFrame,
... | {
"content_hash": "483b27eb70a50c3721f30e3fa4c484dd",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 79,
"avg_line_length": 39.90296052631579,
"alnum_prop": 0.5459791434813075,
"repo_name": "winklerand/pandas",
"id": "076c3d6f25a896141a5647c6eb7a3fe1716f876c",
"size": "24... |
from pyface.ui.wx.clipboard import *
| {
"content_hash": "f36722a135837fce5dbb3114ee5f5a22",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 36,
"avg_line_length": 37,
"alnum_prop": 0.7837837837837838,
"repo_name": "enthought/etsproxy",
"id": "7055821b29626ddac512bf89de2eb2a056a01152",
"size": "52",
"binary": f... |
import random
import application.models as Models
def generator_user_id():
user = None
while not user:
id = random.randint(100000, 99999999)
user = Models.User.objects.filter(id=id).first()
if not user:
return id
def generator_post_id():
post = None
while not pos... | {
"content_hash": "267d2fee5122a2b3a98ddf1a4b33d5a4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 56,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.603411513859275,
"repo_name": "luke0922/mdpress",
"id": "216ba1b251f710688e856e95008c127b19428b55",
"size": "509"... |
from __future__ import absolute_import, print_function, unicode_literals
import os
import subprocess
import time
import unittest
from .util import ShellProcess, ShellComponentTestCaseMixin, get_message
_multiprocess_can_split_ = True
class BoltTest(ShellComponentTestCaseMixin, unittest.TestCase):
component = ... | {
"content_hash": "e75aa8e6e769efa41bb0b92323edf8e1",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 77,
"avg_line_length": 32.472361809045225,
"alnum_prop": 0.6138966264314454,
"repo_name": "scrapinghub/streamparse",
"id": "eba227e9059d9efccdc9b69ca212195eedfa139f",
"siz... |
from django.test import TestCase
from django.core.urlresolvers import resolve
from lists.views import home_page
from django.http import HttpRequest
from django.template.loader import render_to_string
from lists.models import Item, List
class HomePageTest(TestCase):
def test_root_url_resolves_to_home_page_view(se... | {
"content_hash": "5d61178f65caebbb2674bdb3901f4dbd",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 77,
"avg_line_length": 34.733870967741936,
"alnum_prop": 0.6264221035523566,
"repo_name": "carlosgoce/superlists",
"id": "552defd86771d546c35b75d687dd79f2b2b103d4",
"size"... |
"""Tests the graph freezing tool."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
from tensorflow.core.example import example_pb2
from tensorflow.core.framework import graph_pb2
from tensorflow.core.protobuf import saver_pb2
from ten... | {
"content_hash": "3f32595c960daada96f347345d66c5d6",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 80,
"avg_line_length": 40.037151702786375,
"alnum_prop": 0.6575162387875039,
"repo_name": "adit-chandra/tensorflow",
"id": "a27058655ade57008efe4cbe41f6458b8d472dc3",
"siz... |
import functools
from . import DEFAULT_ADDR, DEFAULT_BASE
from .. import multipart, http
def returns_single_item(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
result = func(*args, **kwargs)
if isinstance(result, list):
if len(result) != 1:
print(result)
assert len(result) == 1, ("Calle... | {
"content_hash": "c504cd08b65ba728ffaf57e79f4d4ec2",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 74,
"avg_line_length": 30.763779527559056,
"alnum_prop": 0.6414128487330433,
"repo_name": "alexander255/py-ipfs-api",
"id": "0e8c6dd6e6cdf9d43f407c70863b38aa6c425a0a",
"si... |
"""Finds desktop mandoline browsers that can be controlled by telemetry."""
import os
import logging
import sys
from telemetry.core import exceptions
from telemetry.core import platform as platform_module
from telemetry.internal.backends.mandoline import desktop_mandoline_backend
from telemetry.internal.browser impor... | {
"content_hash": "5442c5fd6e7d7915d786103443d73754",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 80,
"avg_line_length": 35.691275167785236,
"alnum_prop": 0.7038360285821738,
"repo_name": "XiaosongWei/chromium-crosswalk",
"id": "0a7daa9352aad3b7cbc778bfd42869b3b7dda6db",... |
"""Unit tests for the instance module."""
import os
import time
from unittest import mock
import ddt
import netaddr
from oslo_config import cfg
from oslo_utils import importutils
from manila import exception
from manila.share import configuration
from manila.share import driver # noqa
from manila.share.drivers impo... | {
"content_hash": "51f2ae015ddee294a0dc783895e6e81d",
"timestamp": "",
"source": "github",
"line_count": 2393,
"max_line_length": 79,
"avg_line_length": 46.69410781445884,
"alnum_prop": 0.5971505025103142,
"repo_name": "openstack/manila",
"id": "fcd500466eb7aeb2fe3c8d2d25e6e638e6b637c4",
"size": "11... |
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
pos_notes = fields.Text("Auto-applied Note for Kitchen", translate=True)
class PosProductNotes(models.Model):
_name = "pos.product_notes"
_description = "POS Product Notes"
sequence = fields.Integ... | {
"content_hash": "ea1897fb51874b6ec20e68502129dd7a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 86,
"avg_line_length": 32.9,
"alnum_prop": 0.6854103343465046,
"repo_name": "it-projects-llc/pos-addons",
"id": "d6b17bf792a955827f49ea710da2422247d7cca0",
"size": "658",
... |
__all__ = ['client', 'drench', 'listener', 'peer', 'reactor',
'setup', 'switchboard', 'tparser', 'visualizer']
| {
"content_hash": "9f6bf4696d9b71055c3b4f568eb39b06",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 61,
"avg_line_length": 61,
"alnum_prop": 0.5491803278688525,
"repo_name": "jefflovejapan/drench",
"id": "a80676b70ae3d272dccb8579532703dac3b2ebbd",
"size": "122",
"binary"... |
from __future__ import with_statement
import uuid
from django.conf import settings
from django.contrib.sites.models import Site
from django.core import management
from django.core.management import CommandError
from django.test.utils import override_settings
try:
from django.test.utils import override_system_check... | {
"content_hash": "ba48bfbb00a7923809757e350bbc0794",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 140,
"avg_line_length": 41.53903345724907,
"alnum_prop": 0.6347771612672275,
"repo_name": "dhorelik/django-cms",
"id": "abb0bdcb944d75a4ed7d457c161bee40d98d75ab",
"size": ... |
import cv2
import numpy as np
def rectify(h):
h = h.reshape((4,2))
hnew = np.zeros((4,2),dtype = np.float32)
add = h.sum(1)
hnew[0] = h[np.argmin(add)]
hnew[2] = h[np.argmax(add)]
diff = np.diff(h,axis = 1)
hnew[1] = h[np.argmin(diff)]
hnew[3] = h[np.argmax(diff)]
return hnew
def c... | {
"content_hash": "5118dad9cc4abc136658c86560cf41fd",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 105,
"avg_line_length": 40.13882863340564,
"alnum_prop": 0.5837656722870731,
"repo_name": "HuimingCheng/AutoGrading",
"id": "9117fb8689c910dd34ce233c8abb0df5f4919881",
"si... |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
# Create your views here.
@login_required
def index(request):
return render(request, 'chess/index.html', {})
| {
"content_hash": "a965dd2b164330e72404ab538695a885",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 57,
"avg_line_length": 25.75,
"alnum_prop": 0.7815533980582524,
"repo_name": "manumartin/examples",
"id": "57af5110427346039cec3b14578f97974e861b54",
"size": "206",
"binar... |
import unittest
from rx.observable import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.dis... | {
"content_hash": "7ac33f3ac2e2b61f269097a717267151",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 165,
"avg_line_length": 35.704081632653065,
"alnum_prop": 0.639039725635896,
"repo_name": "dbrattli/RxPY",
"id": "785b26235c0fea04a17966218fad9a159ff9c193",
"size": "3499",... |
import json
from urlparse import urlparse
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from mock import patch
from nose.tools import eq_, ok_
import mkt
from mkt.api.tests import BaseAPI
from mkt.api.tests.test_oauth import RestOAuth
from mkt.constants.base import STATUS... | {
"content_hash": "bbd483545fea9ab13c33227f19dbff47",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 79,
"avg_line_length": 38.67258883248731,
"alnum_prop": 0.6132440769180285,
"repo_name": "washort/zamboni",
"id": "014ad61f1d54076cf0b88a82accf93c50065d00d",
"size": "1526... |
"""Tensor summaries for exporting information about a model.
See the @{$python/summary} guide.
@@FileWriter
@@FileWriterCache
@@tensor_summary
@@scalar
@@histogram
@@audio
@@image
@@text
@@merge
@@merge_all
@@get_summary_description
@@PluginAsset
@@get_plugin_asset
@@get_all_plugin_assets
"""
from __future__ import ... | {
"content_hash": "29553eac4a616e013ceff6f6d5d3aa1a",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 86,
"avg_line_length": 37.77581120943953,
"alnum_prop": 0.7268467905669218,
"repo_name": "av8ramit/tensorflow",
"id": "92c1fcadd29c7858da1d31375c209bf1b21f3103",
"size": "... |
class FileBackend(file): # noqa
def __init__(self, path, mode='ab+'):
try:
super(FileBackend, self).__init__(path, mode)
except IOError:
# File not found
super(FileBackend, self).__init__(path, 'wb+')
| {
"content_hash": "7e7419d302b1a06420ac1dcbc0a072eb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 58,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.5232558139534884,
"repo_name": "muraliselva10/cloudkitty",
"id": "6608ed091803c879322782ec0fd2bb3a8a374faf",
"size... |
"""
Management class for operations related to remote display.
"""
import re
import threading
from oslo_config import cfg
from oslo_log import log as logging
from nova.console import type as console_type
from nova import exception
from nova import i18n
from nova.virt.virtualbox import constants
from nova.virt.virtua... | {
"content_hash": "b5e2bb8fe66c971f6ab8d0926be024db",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 79,
"avg_line_length": 39.06501547987616,
"alnum_prop": 0.5656205420827389,
"repo_name": "alexandrucoman/vbox-nova-driver",
"id": "e2fff7f6635a661925540a69128ae09ee5818341",... |
from firefox.webdriver import WebDriver as Firefox
from firefox.firefox_profile import FirefoxProfile
from chrome.webdriver import WebDriver as Chrome
from chrome.options import Options as ChromeOptions
from ie.webdriver import WebDriver as Ie
from opera.webdriver import WebDriver as Opera
from remote.webdriver import ... | {
"content_hash": "cf1eb8c297ae58ad6669abc826daddd7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 42.07692307692308,
"alnum_prop": 0.8464351005484461,
"repo_name": "virajs/selenium-1",
"id": "1860aca8a06346dc293785724dc3c83b372eb83e",
"size": "119... |
import pickle
import re
import nltk
from itertools import islice,izip
def get_words_in_tweet(tweet):
pairs = []
#for (words) in tweet:
# all_words.extend(words)
#all_words=re.sub("[^\w]", " ", tweet).split()
tokens=nltk.word_tokenize(tweet)
#pairs = [ " ".join(pair) for pair in nltk.bigra... | {
"content_hash": "10b7db65ed99e515a98051b43c399f86",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 103,
"avg_line_length": 25.714285714285715,
"alnum_prop": 0.6697530864197531,
"repo_name": "anuragaroraaa/Sentiment-Analysis-of-Online-Reviews",
"id": "bb2adaf100f06773ed7f8b... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('base', '0002_initial_data'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | {
"content_hash": "3a98d9f08b668ee7c2cc15676ef1c782",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 92,
"avg_line_length": 23.526315789473685,
"alnum_prop": 0.6263982102908278,
"repo_name": "yfdyh000/pontoon",
"id": "d0dc866c200e724bdff6b3029b67f967941d860c",
"size": "471... |
"""Tests for tf.strings.to_bytes op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.eager import def_function
from tensorflow.python.framework import tensor_spec
from tensorflow.python.fram... | {
"content_hash": "8432799a7625fe1989526d5deac36549",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 76,
"avg_line_length": 36.696969696969695,
"alnum_prop": 0.5664739884393064,
"repo_name": "gunan/tensorflow",
"id": "8a4f5edc5193fd33dbffa9b68ea5d4e3fc69a9c1",
"size": "314... |
"""Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_en... | {
"content_hash": "43a588b43e1b6fa7194ab57ab3540e8e",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 82,
"avg_line_length": 37.355289421157686,
"alnum_prop": 0.5177130643868555,
"repo_name": "sunner/buzz2weibo",
"id": "2d7b8eb7444f0342ed01c6cd66192252c821b4cd",
"size": "1... |
"""
__init__.py
~~~~~~~~~~~
no description available
:copyright: (c) 2015 by diamondman.
:license: see LICENSE for more details.
"""
from __future__ import print_function
__title__ = 's3streamer'
__version__ = '0.0.1'
__author__ = 'diamondman'
from .streamer import S3Streamer
| {
"content_hash": "bf54ef4c62dfe38c76b51138550fb868",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 43,
"avg_line_length": 18.8125,
"alnum_prop": 0.6079734219269103,
"repo_name": "diamondman/pys3streamer",
"id": "3f1100d1a7e4e8465714e85803c436685454c635",
"size": "348",
... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# Metadata info about the module, not modified during runtime
self.info = {
# Name for the module that will appear in module menus
'Name': 'Invoke-DropboxUpload',
# List of ... | {
"content_hash": "bac492abbba4598acd746ecf5a5eb4bd",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 146,
"avg_line_length": 33.57446808510638,
"alnum_prop": 0.5521757498943811,
"repo_name": "frohoff/Empire",
"id": "a6b70b01a45cf98d216010c0add1e58a89e3474c",
"size": "4734... |
import codecs
import os
import re
from setuptools import setup, find_packages
##################################################################
NAME = 'auacm'
PACKAGES = find_packages(where='src')
META_PATH = os.path.join('src', 'auacm', '__init__.py')
KEYWORDS = ['competitive', 'icpc', 'auacm', 'auburn']
CLASSIFIE... | {
"content_hash": "4f217d53f29fc238eba21d7246f79275",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 77,
"avg_line_length": 29.573529411764707,
"alnum_prop": 0.5494778717056191,
"repo_name": "BrandonLMorris/auacm-cli",
"id": "53da2bfd5f4665c100745db837b4e631c72a8870",
"siz... |
"""
Tts API
Description # noqa: E501
The version of the OpenAPI document: 2.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from setuptools import setup, find_packages # noqa: H301
NAME = "telestream-cloud-tts"
VERSION = "2.1.0"
# To install the libra... | {
"content_hash": "5f8bac9414aeb23d834e6f52c031c8cc",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 24.35,
"alnum_prop": 0.6704312114989733,
"repo_name": "Telestream/telestream-cloud-python-sdk",
"id": "e5aa6f244bd7a00968c326ff14b20f0eaf586b35",
"si... |
from aiohttp import web
from pinkerton.app import app
from pinkerton.settings import BIND_HOST, BIND_PORT
if __name__ == '__main__':
web.run_app(app, host=BIND_HOST, port=BIND_PORT)
| {
"content_hash": "db643a965b118959eed4948320512e3f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 26.857142857142858,
"alnum_prop": 0.7127659574468085,
"repo_name": "bureaucratic-labs/pinkerton",
"id": "0b90aa21a6c003471a2438cb28bbbcbf42678036",
"s... |
"""Tests for distutils.command.install."""
import os
import os.path
import sys
import unittest
import site
from distutils.command.install import install
from distutils.command import install as install_module
from distutils.command.install import INSTALL_SCHEMES
from distutils.core import Distribution
from distutils.... | {
"content_hash": "6cd7e84182a097aa1c9594052fc43955",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 76,
"avg_line_length": 33.76315789473684,
"alnum_prop": 0.612626656274357,
"repo_name": "MalloyPower/parsing-python",
"id": "8d7e97227c3a3a9d637c0fa30ce7225c68231349",
"si... |
"""
VMware vCloud driver.
"""
import copy
import sys
import re
import base64
import os
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import urlencode
from libcloud.utils.py3 import urlparse
from libcloud.utils.py3 import b
from libcloud.utils.py3 import next
urlparse = urlparse.urlparse
import time
... | {
"content_hash": "c96951cdcab46280f81e7ad785a14406",
"timestamp": "",
"source": "github",
"line_count": 2073,
"max_line_length": 105,
"avg_line_length": 36.00096478533526,
"alnum_prop": 0.5277100361784806,
"repo_name": "jimbobhickville/libcloud",
"id": "efe33e41d24649cad4fd3e4140a10840dc9ff53a",
"s... |
import functools
import itertools
import socket
import ssl
import time
import uuid
import eventlet
import greenlet
import kombu
import kombu.connection
import kombu.entity
import kombu.messaging
from oslo.config import cfg
from trove_guestagent.openstack.common import excutils
from trove_guestagent.openstack.common.g... | {
"content_hash": "6155847f39f66f4fedc9341c0a0dc1f9",
"timestamp": "",
"source": "github",
"line_count": 839,
"max_line_length": 79,
"avg_line_length": 38.24791418355185,
"alnum_prop": 0.5549703957619196,
"repo_name": "denismakogon/trove-guestagent",
"id": "7057c0b1a5a4c773096b4610ec531e2275e1a0fb",
... |
__all__ = ["System"]
import os
import sys
from functools import wraps
from subprocess import Popen, PIPE
def lazy_property(undecorated):
name = '_' + undecorated.__name__
@property
@wraps(undecorated)
def decorated(self):
try:
return getattr(self, name)
except AttributeErro... | {
"content_hash": "34fa1edea36264304026b227ad008867",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 109,
"avg_line_length": 32.256,
"alnum_prop": 0.5086805555555556,
"repo_name": "samuel/kokki",
"id": "f06bf80366eed646c6fa920a805e0695c8bc78b4",
"size": "4033",
"binary"... |
import unittest
class TestAlwaysTrue(unittest.TestCase):
def test_assertTrue(self):
"""
always_true returns a truthy value
"""
result = True
self.assertTrue(result)
| {
"content_hash": "bdda286f21b5181984a486f121522e95",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 42,
"avg_line_length": 17.75,
"alnum_prop": 0.6056338028169014,
"repo_name": "federico123579/Trading212-API",
"id": "48e9abdb32533b422f225440b7a36ee0c5cfc05d",
"size": "213... |
from distutils.core import setup
setup(
name = 'wl_parsers',
packages = ['wl_parsers'],
install_requires = [
'requests>=2.10.0',
],
version = '0.1.2',
description = 'a library to parse the Warlight.net site',
author = 'knyte',
author_email = 'galactaknyte@gmail.com',
url = 'h... | {
"content_hash": "c6631c902051297a65417f76fdbf8084",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 71,
"avg_line_length": 31.5,
"alnum_prop": 0.6091269841269841,
"repo_name": "knyte/wl_parsers",
"id": "4d55dbf19068514a8480689a3c9a62273ba092c9",
"size": "504",
"binary":... |
"""
APIs for dealing with input and output definitions for Software Configurations.
"""
import collections
import copy
import six
from heat.common.i18n import _
from heat.common import exception
from heat.engine import constraints
from heat.engine import parameters
from heat.engine import properties
(
IO_NAME,... | {
"content_hash": "76af35d9662271db5048237abb9b5255",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 79,
"avg_line_length": 31.205714285714286,
"alnum_prop": 0.6105108954403955,
"repo_name": "noironetworks/heat",
"id": "8ca2d28f7b935691bfa954cd9ccec2878cf0a80b",
"size": "... |
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
@testing.parameterize(
{'in_size': 10, 'out_size': 10},
{'in_size': 10, 'out_size': 40}... | {
"content_hash": "580a04b58fc432df91f7c4db0a419cfe",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 75,
"avg_line_length": 31.107142857142858,
"alnum_prop": 0.598983106445793,
"repo_name": "benob/chainer",
"id": "88b09903c8d1a5281e642cae1b01115832bdb1a2",
"size": "6097",... |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.maxDiff = None
filename = 'chart_gradient01.xlsx'
... | {
"content_hash": "6da9524e336f7c23bd3ad3ab81caaa77",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 69,
"avg_line_length": 26.428571428571427,
"alnum_prop": 0.5574324324324325,
"repo_name": "jkyeung/XlsxWriter",
"id": "51eaf8f5e441829321d0258f6250f9d144235695",
"size": "1... |
"""!wiki <topic> returns a wiki link for <topic>"""
import json
import re
from urllib import quote
import sys
import requests
from bs4 import BeautifulSoup
def wiki(searchterm):
"""return the top wiki search result for the term"""
searchterm = quote(searchterm)
url = "https://en.wikipedia.org/w/api.php?a... | {
"content_hash": "c25c39f43848471198540717b67c6fff",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 111,
"avg_line_length": 27.41860465116279,
"alnum_prop": 0.636980491942324,
"repo_name": "kepler-/ragebot",
"id": "44e8c3f8d01dcf175c4784deb23ef7db9d0c191c",
"size": "1179"... |
"""Implementation of Fisher-BRAC from pixels."""
import typing
from dm_env import specs as dm_env_specs
import numpy as np
from seed_rl.agents.policy_gradient.modules import popart
from seed_rl.agents.policy_gradient.modules import running_statistics
import tensorflow as tf
import tensorflow_probability as tfp
from t... | {
"content_hash": "fbe63e021ce980c3a58814060c5aa168",
"timestamp": "",
"source": "github",
"line_count": 1024,
"max_line_length": 143,
"avg_line_length": 36.9345703125,
"alnum_prop": 0.6078897966738056,
"repo_name": "google-research/google-research",
"id": "81a35596d3f5caea0a61dc33c2f9ab73151dacc1",
... |
"""Functions to construct sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum',
'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag']
import numpy as np
from sc... | {
"content_hash": "6d9ba269a1d14ddc1778dc75add366e1",
"timestamp": "",
"source": "github",
"line_count": 794,
"max_line_length": 95,
"avg_line_length": 30.197732997481108,
"alnum_prop": 0.5532802268840973,
"repo_name": "aman-iitj/scipy",
"id": "4ab2162508036a63678e901d1e79f64bd22a3e95",
"size": "239... |
import autonetkit
import autonetkit.load.graphml as graphml
import os
import gzip
import json
import unittest
import subprocess
import shutil
def gzip_to_json(filename):
with gzip.open(filename, "r") as json_fh:
return json.load(json_fh)
def json_to_gzip(data, filename):
with gzip.open(filename, "wb")... | {
"content_hash": "6ceb40582e4c52d682ca5964eaa0ca12",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 84,
"avg_line_length": 32.735632183908045,
"alnum_prop": 0.6667837078651685,
"repo_name": "sysbot/autonetkit",
"id": "8c7f8f0bd8bfde848c4806e040c8b0d6bcde628f",
"size": "28... |
"""
Preprocessing of the Monroe Plan Corpus for copct:
- Converts from lisp data to Python tuples
- Extracts intermediate states for every plan in the corpus
- Reformats intentions into (state, task, parameters) form
"""
from monroe_static import locs, watercos, powercos, poslocs, sleaders, gens, food, pcrews
from monr... | {
"content_hash": "4c656938b4743fcc3ede437d6078b5c1",
"timestamp": "",
"source": "github",
"line_count": 710,
"max_line_length": 129,
"avg_line_length": 36.36338028169014,
"alnum_prop": 0.5833526996668991,
"repo_name": "jhomble/electron435",
"id": "4116b0725714601af8ce591ed5866558fd5129e1",
"size": ... |
from django.core.management.base import BaseCommand, CommandError
from kstore.models import BasicConfiguration
class Command(BaseCommand):
'''
Establece la configuracion inicial, que despues debera
ser cambiada para adaptar a la empresa.
'''
def handle(self, *args, **options):
try... | {
"content_hash": "c7ddb4ea47a3f43783be56ca833cdcdf",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 89,
"avg_line_length": 36.77777777777778,
"alnum_prop": 0.6676737160120846,
"repo_name": "KeoH/django-keoh-kstore",
"id": "dca6aa01394177d619e9a72475b9a80f042c93eb",
"size"... |
from metaworld.envs.mujoco.sawyer_xyz.v1.sawyer_assembly_peg import SawyerNutAssemblyEnv
from metaworld.envs.mujoco.sawyer_xyz.v1.sawyer_basketball import SawyerBasketballEnv
from metaworld.envs.mujoco.sawyer_xyz.v1.sawyer_bin_picking import SawyerBinPickingEnv
from metaworld.envs.mujoco.sawyer_xyz.v1.sawyer_box_close ... | {
"content_hash": "98f4bcf2c4c639720e8c1dab1d7f39e2",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 113,
"avg_line_length": 57.010416666666664,
"alnum_prop": 0.8267860405627626,
"repo_name": "rlworkgroup/metaworld",
"id": "d39810f0d802b384701d741e74f9e65f7034301a",
"size"... |
def extractBittercoffeetranslationsCom(item):
'''
Parser for 'bittercoffeetranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),... | {
"content_hash": "b1a32121b39ef5c39a60f64d71183c1b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 27.047619047619047,
"alnum_prop": 0.6426056338028169,
"repo_name": "fake-name/ReadableWebProxy",
"id": "b611587d0a0ae8051710b93fca74ceb4fa374e5b",
"... |
"""This example gets all LocationCriterion.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of our README.
Tags: LocationCriterionService... | {
"content_hash": "8417eb7b74acb31ed5c22f20e0c60f62",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 35.285714285714285,
"alnum_prop": 0.6222672064777328,
"repo_name": "coxmediagroup/googleads-python-lib",
"id": "761ddb1e2d1f611f6476f15fbde77bace29741e... |
import os
from jenkins_jobs.modules import publishers
from tests import base
class TestCaseModulePublishers(base.BaseScenariosTestCase):
fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures')
scenarios = base.get_scenarios(fixtures_path)
klass = publishers.Publishers
| {
"content_hash": "128602365f963bfa03492ebecc2efa19",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 71,
"avg_line_length": 29.6,
"alnum_prop": 0.7702702702702703,
"repo_name": "onshape/jenkins-job-builder",
"id": "e44a4dbaaa6bea04e58ce28248f9d13f6f682776",
"size": "985",
... |
import json
from twisted.trial import unittest
from twisted.internet import defer
from twisted.application import service
from ..servers.relay import RelayServer
from ..twisted.transcribe import SymmetricWormhole, UsageError
from ..twisted.util import allocate_ports
from .. import __version__
#from twisted.python impor... | {
"content_hash": "4222c170a9d8053f1dabb7f700b01ca6",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 77,
"avg_line_length": 37.64601769911504,
"alnum_prop": 0.5846262341325811,
"repo_name": "negativo/magic-wormhole",
"id": "fe016f4f948515d28e0f596b60020040e07d57e8",
"size... |
from django.contrib import admin
# Register your models here.
from models import *
from dbtemplates.admin import TemplateAdmin, TemplateAdminForm
from dbtemplates.models import Template
from django_ace import AceWidget
class ProxyTemplateAdminForm(TemplateAdminForm):
def __init__(self, *args, **kwargs):
... | {
"content_hash": "f6149249be3a1b161d70dd23eb8cf041",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 111,
"avg_line_length": 33.375,
"alnum_prop": 0.7578027465667915,
"repo_name": "arbin/aloeveraofforever",
"id": "6d6813b55665f6ad1a02d2fd006bdb6c02e8daa8",
"size": "801",
... |
import logging
import os
from wsgiref import simple_server
from oslo.config import cfg
from oslo_log import log
from paste import deploy
import pecan
from cloudkitty.api import config as api_config
from cloudkitty.api import hooks
from cloudkitty.api import middleware
from cloudkitty import rpc
from cloudkitty import... | {
"content_hash": "e6584d45307fb0b11fdefcd73a8f734e",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 77,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.5965189873417721,
"repo_name": "FNST-OpenStack/cloudkitty",
"id": "76407f764cc91bc39bf2a97ec547af1137d6a709",
"s... |
import os
from pymatgen.io.vasp.inputs import Incar
from mpinterfaces import QUEUE_SYSTEM
from mpinterfaces.utils import get_magmom_string
from mpinterfaces.mat2d.stability import INCAR_DICT
__author__ = "Michael Ashton"
__copyright__ = "Copyright 2017, Henniggroup"
__maintainer__ = "Michael Ashton"
__email__ = "ash... | {
"content_hash": "3cab3039cdfc7d19b82cdc2c7b0acc05",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 70,
"avg_line_length": 31.126315789473683,
"alnum_prop": 0.5461616503212715,
"repo_name": "henniggroup/MPInterfaces",
"id": "3d8b624f07f59397798ce41b9fa750c2c339e832",
"siz... |
__all__ = ["interface","vimui"]
| {
"content_hash": "5672310375519f4e4bfcef6e119365a9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.53125,
"repo_name": "AndBicScadMedia/vdebug",
"id": "2f00741bb557a181400ae814c1e1f231fac1cc5f",
"size": "32",
"binary": false,
... |
from bs4 import BeautifulSoup
import requests
def get_team_info(soup):
container = soup.find_all('div', 'games-univ-mod3')[0]
data = {
'name': list(container.find_all('h3', 'team-name')[0].children)[0],
'abbr': list(container.find_all('h3', 'team-name')
[0].children)[1].st... | {
"content_hash": "2f3a898d35b7ab545368e0a9a8d0f5a0",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 75,
"avg_line_length": 33.62162162162162,
"alnum_prop": 0.5787781350482315,
"repo_name": "pcsforeducation/fantasy",
"id": "c1fa2e8f547ece3030cb36e75c4a3094fa5c8dbc",
"size"... |
import abc
import datetime
import functools
import pprint
import sys
from python_utils import converters
from python_utils import types
from . import base
from . import utils
if types.TYPE_CHECKING:
from .bar import ProgressBar
MAX_DATE = datetime.date.max
MAX_TIME = datetime.time.max
MAX_DATETIME = datetime.da... | {
"content_hash": "f8174402d864099e2e693e51853d9ff6",
"timestamp": "",
"source": "github",
"line_count": 1075,
"max_line_length": 79,
"avg_line_length": 34.50232558139535,
"alnum_prop": 0.5921811809112969,
"repo_name": "WoLpH/python-progressbar",
"id": "8d81bb6d7c566c00c595ad64c9f057c099867240",
"si... |
from __future__ import absolute_import
import unittest
from pyes.tests import ESTestCase
from pyes.query import Search, QueryStringQuery, HighLighter
class QuerySearchTestCase(ESTestCase):
def setUp(self):
super(QuerySearchTestCase, self).setUp()
mapping = {u'parsedtext': {'boost': 1.0,
... | {
"content_hash": "3b31783e767d826013f097c084dc5e54",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 119,
"avg_line_length": 47.9375,
"alnum_prop": 0.5153194263363755,
"repo_name": "mavarick/pyes",
"id": "52d79b2cc39b6453d6cb9844d7f8a58ec162cf50",
"size": "3092",
"binary... |
import pyman
class BaseTest:
def setup( self ):
self.cli = pyman.Main("PyMan - Test Interface")
| {
"content_hash": "8c343a9830f790d2fa61b16459d4d3cd",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.6363636363636364,
"repo_name": "MarkLark/pyman",
"id": "921896e5895289d173ed2f90173338ab7de4e35c",
"size": "110",
... |
import binascii
import os
import random
import string
import uuid
def generate_key(length: int = 20):
"""
Generates a random key (used for access tokens).
:param length:
:return:
"""
return binascii.hexlify(os.urandom(length)).decode()
def generate_random_string(string_length: int = 6, uppe... | {
"content_hash": "3c0556013e93c1819f98db57ac35bfad",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 21.52777777777778,
"alnum_prop": 0.6464516129032258,
"repo_name": "rhazdon/django-sonic-screwdriver",
"id": "3c7b33af020da5059f220a60174229133311607d",... |
import pygame
from utils import *
from ability import Ability
from characters.transformed import Transformed
from characters.directions import Directions
# Revert is called in switch, it is used to revert Biggie back to his normal size
class Revert(Ability):
def __init__(self):
Ability.__init__(self, "revert", pyg... | {
"content_hash": "c4f63b5c484425a42ab10730145a88c7",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 118,
"avg_line_length": 44.30555555555556,
"alnum_prop": 0.7178683385579937,
"repo_name": "450W16/MODACT",
"id": "119f225a95d8cf738cfe0de9e64dbb4d8b7dad70",
"size": "1595",... |
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUDomainFIPAclTemplateEntry(NURESTObject):
""" Represents a DomainFIPAclTemplateEntry in the VSD
Notes:
Defines the template of Egress Domain ACL Template entries
... | {
"content_hash": "9da768e8a7a1c09d56e9c935a263d561",
"timestamp": "",
"source": "github",
"line_count": 1080,
"max_line_length": 342,
"avg_line_length": 30.63425925925926,
"alnum_prop": 0.56820311319329,
"repo_name": "nuagenetworks/vspk-python",
"id": "44cb2569070bc19c3add6efe43fc688150c3f112",
"si... |
from oslo_config import cfg
compute_group = cfg.OptGroup('compute',
title='Compute Options')
# some config options here
driver_path = cfg.StrOpt(
'driver_path',
default='calplus.v1.compute.drivers',
help='Default path to compute drivers',
)
ALL_OPTS = ([driver_path])
def ... | {
"content_hash": "e6a28ec044109e2dff8cb914819128b4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 53,
"avg_line_length": 20.416666666666668,
"alnum_prop": 0.6612244897959184,
"repo_name": "cloudcomputinghust/CAL",
"id": "0efc397471690fbbd2d18b6f869aedf3b299470c",
"size"... |
import logging
import warnings
from collections import OrderedDict
import paddle
import paddle.distributed as dist
from paddle.fluid import core
from paddle.optimizer import Optimizer
from paddle.fluid.clip import ClipGradByGlobalNorm
from paddle.distributed import fleet, ParallelMode
HybridParallelClipGrad = (
... | {
"content_hash": "cf77079e00cbb618161d91c65e4d4d81",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 135,
"avg_line_length": 38.97976391231029,
"alnum_prop": 0.5435431537962362,
"repo_name": "luotao1/Paddle",
"id": "38b03225616ed4c9280f909b073da470c3df8275",
"size": "2417... |
'''
LEGO:
Classes and methods for the creation and manipulation of regular expression
objects and components.
* A regular expression is a "pattern" object.
* Each pattern alternates (with a pipe, "|") between zero or more "conc"
(concatenation) objects.
* Each conc is a concatenation of zero or more "mult" (mul... | {
"content_hash": "8f3d8c337c871508520a258bf4fc3064",
"timestamp": "",
"source": "github",
"line_count": 1675,
"max_line_length": 81,
"avg_line_length": 28.19223880597015,
"alnum_prop": 0.6588666299606116,
"repo_name": "AdeebNqo/sublimegen",
"id": "33d1d0820cfd8c4619c20782514f880c63c67839",
"size": ... |
from collections import namedtuple, OrderedDict
from itertools import chain
import json
from urllib import urlencode
import uuid
from django import forms
from django.core.urlresolvers import reverse
from django.forms import Widget
from django.forms.utils import flatatt
from django.template.loader import render_to_strin... | {
"content_hash": "534785b34738cae8c4bce500f4037702",
"timestamp": "",
"source": "github",
"line_count": 1505,
"max_line_length": 289,
"avg_line_length": 39.245182724252494,
"alnum_prop": 0.5703474197480699,
"repo_name": "qedsoftware/commcare-hq",
"id": "ee3b75a8748963260e232d02163f19852112dd93",
"s... |
import subprocess,sys
from glint_arg_parser import GlintArgumentParser
import glint_platform as plat
pkg_dir = "glint-service"
def execute_command(cmd_args,input):
if input is None:
process = subprocess.Popen(cmd_args,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
out,err = process.communicate()
... | {
"content_hash": "4dec495914fac592b7355679e5d5abfb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 215,
"avg_line_length": 47.87755102040816,
"alnum_prop": 0.6508951406649617,
"repo_name": "hep-gc/glint-service",
"id": "daf5abfadbbb92218f283440963f5bf9a638d0df",
"size": ... |
from test_framework.mininode import *
from test_framework.test_framework import StardustTestFramework
from test_framework.util import *
from test_framework.blocktools import create_block, create_coinbase
from test_framework.siphash import siphash256
from test_framework.script import CScript, OP_TRUE
'''
CompactBlocksT... | {
"content_hash": "df754b45d1f53602ee52700978a1b61e",
"timestamp": "",
"source": "github",
"line_count": 603,
"max_line_length": 162,
"avg_line_length": 44.346600331674956,
"alnum_prop": 0.640327586851651,
"repo_name": "ctwiz/stardust",
"id": "7a6065e3923ed2d7372b4f681c5586b1ca630610",
"size": "2695... |
"""SavedModel builder implementation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from google.protobuf.any_pb2 import Any
from tensorflow.core.framework import types_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.... | {
"content_hash": "b0d171df32658ba1ecf0630684e0158a",
"timestamp": "",
"source": "github",
"line_count": 598,
"max_line_length": 176,
"avg_line_length": 41.118729096989966,
"alnum_prop": 0.6848997519215909,
"repo_name": "aselle/tensorflow",
"id": "8c985a7c2fa2b515c2daed1349996dd30f6d7ce1",
"size": "... |
"""List cluster command."""
from apitools.base.py import list_pager
from googlecloudsdk.api_lib.dataproc import constants
from googlecloudsdk.calliope import base
from googlecloudsdk.core import properties
@base.ReleaseTracks(base.ReleaseTrack.GA)
class List(base.ListCommand):
"""View a list of clusters in a proje... | {
"content_hash": "126fe77de58164e801f1cce06e0f418a",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 92,
"avg_line_length": 31.95049504950495,
"alnum_prop": 0.7111868608614813,
"repo_name": "KaranToor/MA450",
"id": "59815caa539554db03796f424b05b5c6ae143ab3",
"size": "3823... |
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
impo... | {
"content_hash": "09e76a0dc8a164ed99e386a09753e8ba",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 119,
"avg_line_length": 25.81578947368421,
"alnum_prop": 0.7074413863404689,
"repo_name": "mindbody/API-Examples",
"id": "4bffc02832941b88f8c0b86a31c232c399c20e57",
"size":... |
from tw.api import CSSLink, JSLink, JSSource
from tw.forms.fields import InputField,SingleSelectField,TextArea,RadioButtonList,Form, ListFieldSet, HiddenField,MultipleSelectField
from tg import config
FIXED_WIDTH_CLASS = "width-250"
OPTION_WIDTH_CLASS = "width-220"
FIXED_HEIGHT_CLASS = "height-70"
class RPACBasicWid... | {
"content_hash": "f9cbc1452f9275b2e5f6a9837a708913",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 133,
"avg_line_length": 29.520661157024794,
"alnum_prop": 0.6413773796192609,
"repo_name": "LamCiuLoeng/gap",
"id": "991b8221f86b2390c4a8213311dde38e08a15560",
"size": "35... |
from google.cloud import aiplatform_v1
def sample_add_execution_events():
# Create a client
client = aiplatform_v1.MetadataServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.AddExecutionEventsRequest(
execution="execution_value",
)
# Make the request
respons... | {
"content_hash": "d5c7f83c00efd5bccf0a6d2b86ae0ac1",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 82,
"avg_line_length": 26.31578947368421,
"alnum_prop": 0.732,
"repo_name": "googleapis/python-aiplatform",
"id": "b6b14e7038325ae0d26b2c82ffa5fea23531f8bb",
"size": "1528"... |
import os
import sys
from keras.applications.vgg16 import VGG16
from keras.models import Sequential, Model
from keras.layers import Input, Activation, Dropout, Flatten, Dense
from keras.preprocessing import image
import numpy as np
if len(sys.argv) != 2:
print("usage: python predict.py [filename]")
sys.exit(1)... | {
"content_hash": "5760412d84942003a60d68006e5ff3b3",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 85,
"avg_line_length": 24.896551724137932,
"alnum_prop": 0.7257617728531855,
"repo_name": "aidiary/keras_examples",
"id": "6e13feda3079e6d2ab963defd997df29125376be",
"size"... |
import os
import six
# NOTE(jokke): simplified transition to py3, behaves like py2 xrange
from six.moves import range
from glance.common import crypt
from glance.common import utils
from glance.tests import utils as test_utils
class UtilsTestCase(test_utils.BaseTestCase):
def test_encryption(self):
# C... | {
"content_hash": "1ac945d265438863a83d76131b931de9",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 78,
"avg_line_length": 36.40298507462686,
"alnum_prop": 0.5830258302583026,
"repo_name": "vuntz/glance",
"id": "b04e00c61e18301c15b047e5d35d0a047054e234",
"size": "3080",
... |
"""
This example demonstrates one way to access the weights of a custom skflow
model. It is otherwise identical to the standard MNIST convolutional code.
"""
from sklearn import metrics
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import skflow
### Download and load MNIST data.... | {
"content_hash": "19ae715847161a0d71be77291fd59a35",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 91,
"avg_line_length": 40.07142857142857,
"alnum_prop": 0.7180629827688652,
"repo_name": "Resly/pipeline",
"id": "9dab12866c02a912807fef3123f2b553f0134624",
"size": "3987",... |
from classy import Class
import matplotlib.pyplot as plt
import numpy as np
params = {
'output': 'tCl lCl',
'l_max_scalars': 2508,
'lensing': 'yes',
'P_k_ini type': 'external_Pk',
'command': 'python /home/andrew/Research/tools/class_public-2.4.3/external_Pk/generate_Pk_cosines.py',
'cust... | {
"content_hash": "fd04f35ace102d513d925854192b4264",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 107,
"avg_line_length": 32.4375,
"alnum_prop": 0.6666666666666666,
"repo_name": "aarrasmi/Dimension-Reduction-Preliminary",
"id": "b9077880ac9dc1d8a47bddb33e4cb646dc5baff7",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.