text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa:... | {
"content_hash": "d872a6585be9baa526d7e8e0e687b314",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 116,
"avg_line_length": 39.73279352226721,
"alnum_prop": 0.5977175463623395,
"repo_name": "onshape-public/onshape-clients",
"id": "dbadfd62975d5c160bfaf6bd702bef9ed4bcf1a1",... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import textwrap
import xml.etree.ElementTree as ET
from six.moves import range
from unidecode import unidecode
import escpos.barcode
import escpos.feature
from satcomum import br
from satcomum impor... | {
"content_hash": "e817addca8d62d867b6ca60a0ed4d36a",
"timestamp": "",
"source": "github",
"line_count": 462,
"max_line_length": 79,
"avg_line_length": 34.73809523809524,
"alnum_prop": 0.5846470185058259,
"repo_name": "base4sistemas/satextrato",
"id": "6830e447e76445bacd4eb41d92baba41afeefd81",
"siz... |
from collections import OrderedDict
import logging
import scipy
import numpy as np
from theano import tensor
from theano.tensor.signal.downsample import max_pool_2d, DownsampleFactorMax
from blocks.extensions import SimpleExtension
from blocks.extensions.monitoring import (DataStreamMonitoring,
... | {
"content_hash": "622a753db75a5574f95ea6675fa4e6bd",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 89,
"avg_line_length": 38.166666666666664,
"alnum_prop": 0.6016397825505748,
"repo_name": "ryukinkou/ladder_customized",
"id": "b1430c418985c3290e9f8658a95e3f8b832968d2",
... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | {
"content_hash": "724269bc42073268c8aaa89ecc6458a6",
"timestamp": "",
"source": "github",
"line_count": 853,
"max_line_length": 192,
"avg_line_length": 49.772567409144195,
"alnum_prop": 0.6319483700772565,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5f8d902f7a40375c86fb7bf558bbe5092ff52ac7",
... |
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
math = vtk.vtkMath()
math.RandomSeed(22)
sphere = vtk.vtkSphereSource()
sphere.SetPhiResolution(32)
sphere.SetThetaResolution(32)
extract = vtk.vtkExtractPolyDataPiece()
extract.SetInputConn... | {
"content_hash": "8c0ad42934fb44cae179776fdad5ae71",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 52,
"avg_line_length": 26.410714285714285,
"alnum_prop": 0.7711291413116971,
"repo_name": "timkrentz/SunTracker",
"id": "1d38c5ed05c8b6e1818c9dd6f274e032e6db7da6",
"size":... |
"""
MoinMoin - MoinMoin.macro.FootNote Tests
@copyright: 2008 MoinMoin:ReimarBauer
@license: GNU GPL, see COPYING for details.
"""
import os
from MoinMoin import macro
from MoinMoin.macro import FootNote
from MoinMoin.Page import Page
from MoinMoin.PageEditor import PageEditor
from MoinMoin._t... | {
"content_hash": "e1f73a9e074f6f1653fa7379f869fe45",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 32.69444444444444,
"alnum_prop": 0.6644010195412065,
"repo_name": "Glottotopia/aagd",
"id": "c901fe981993c230d9a0e4084c9ac1fb6edcd9c9",
"size": "1202... |
"""
Django settings for cmdb project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | {
"content_hash": "78cc59df1c4ef15795ae489191913714",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 71,
"avg_line_length": 23.31313131313131,
"alnum_prop": 0.699740034662045,
"repo_name": "hilarry/cmdb",
"id": "c6a0c39550100d1b7cb21c43ee4a06e01215fc5d",
"size": "2308",
... |
"""Collection of tensorflow extention methods
Keep all the tensorflow extention methods in one place
"""
import tensorflow as tf
def conv(inputs, num_filters=32, name='conv'):
"""Convolutional layer
# Args:
inputs: input layer
num_filters: number of kernels/filters to use
name: tf n... | {
"content_hash": "eba55af1c6501165e9b37ae86829a5f1",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 96,
"avg_line_length": 23.942857142857143,
"alnum_prop": 0.5871121718377088,
"repo_name": "chasingbob/transfer-learning",
"id": "d500569104d629453035e70a48b324cad3d2b444",
... |
import scrapy
class MoviespiderItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
class Cili006Item(scrapy.Item):
magnet = scrapy.Field()
ed2k = scrapy.Field()
topic_id = scrapy.Field()
filename = scrapy.Field() | {
"content_hash": "68f5d55abcf30b17c03c73dae45d121e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 21.846153846153847,
"alnum_prop": 0.6690140845070423,
"repo_name": "zhs007/movieSpider",
"id": "deef2da049b0e9a87d1e94de5667653a43a8e955",
"size": "4... |
#!/usr/bin/env python
#
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script creates a "jumbo" file which merges all incoming files
for compiling.
"""
from __future__ import print_function
imp... | {
"content_hash": "172b15be029c72e927be3ad83d237cca",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 33.376344086021504,
"alnum_prop": 0.6530283505154639,
"repo_name": "chrisdickinson/nojs",
"id": "ae435d059c72a525df38af9908fa8d4355449cf5",
"size": "... |
import sympy as sp
from sympy.physics.mechanics import dynamicsymbols
from sympy.physics.mechanics.functions import find_dynamicsymbols
from simupy.utils.symbolic import (lambdify_with_vector_args, grad,
DEFAULT_LAMBDIFY_MODULES)
from simupy.array import Array, empty_array
from simupy.systems import DynamicalSyst... | {
"content_hash": "b23992493df4ac8790679a71ccff0442",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 79,
"avg_line_length": 37.84014869888476,
"alnum_prop": 0.616661754592789,
"repo_name": "simupy/simupy",
"id": "2d55180406899a6954621988f3956024817accbb",
"size": "10179",... |
'''
WikiLinks Extension for Python-Markdown
======================================
Converts [[WikiLinks]] to relative links. Requires Python-Markdown 2.0+
Basic usage:
>>> import markdown
>>> text = "Some text with a [[WikiLink]]."
>>> html = markdown.markdown(text, ['wikilinks'])
>>> html
u'<p>... | {
"content_hash": "004208010f201484a18a40c8ae48a828",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 102,
"avg_line_length": 34.4640522875817,
"alnum_prop": 0.551868006827233,
"repo_name": "ronreiter/interactive-tutorials",
"id": "95a4a95e43d22344e1f72b60b918e4e98eded455",
... |
import os
import pickle
import os
from image_processing import batch_preprocess
__author__ = "Ronny Restrepo"
__copyright__ = "Copyright 2017, Ronny Restrepo"
__credits__ = ["Ronny Restrepo"]
__license__ = "Apache License"
__version__ = "2.0"
# MAP LABELS AND IDS
id2label = ['class_0', 'class_1', 'class_2', 'class_3... | {
"content_hash": "f3e6abfb1613172ae406496102428aa5",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 121,
"avg_line_length": 43.88235294117647,
"alnum_prop": 0.43789097408400357,
"repo_name": "ronrest/convenience_py",
"id": "7c534627e53851519b924a01c2a1630866ccb85f",
"siz... |
from ScalarTransport import *
from ScalarTransportTests import *
from LevelSetTests import *
"""
test RKDG via ScalarTransport interface with quadrature for simple
advection problems
"""
def buildProblems(testFlag=0,
verbose=0):
"""
build data structures necessary for specifying test prob... | {
"content_hash": "81316e2018b1e422c85b3ae10355d7e2",
"timestamp": "",
"source": "github",
"line_count": 700,
"max_line_length": 136,
"avg_line_length": 36.78,
"alnum_prop": 0.5539112871902432,
"repo_name": "erdc/proteus",
"id": "1cb9da2f0bfc740d9dae79053fa5088ff56431b4",
"size": "25769",
"binary"... |
from requests import HTTPError # noqa
| {
"content_hash": "328d1fcdebb64d6621359a04659a593e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 38,
"avg_line_length": 39,
"alnum_prop": 0.7948717948717948,
"repo_name": "globocom/pluct",
"id": "8cb440ee6a78578a550a4bacd17f504226ccacb0",
"size": "64",
"binary": false... |
import logging
from dplace_app.models import Language, ISOCode, LanguageFamily, Society
def load_languages(repos):
languoids = {
l.id: l for l in repos.read_csv('csv', 'glottolog.csv', namedtuples=True)}
families, languages, isocodes = {}, {}, {}
societies = {s.ext_id: s for s in Society.objects.... | {
"content_hash": "c8373bbecf069eed61e486fc96007953",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 86,
"avg_line_length": 35.45283018867924,
"alnum_prop": 0.6253326237360298,
"repo_name": "stefelisabeth/dplace",
"id": "23ca68370f8dd666767cdad9f43696ff08c5e397",
"size": "... |
"""
Validate ODC dataset documents
"""
import collections
import enum
import math
import multiprocessing
import os
import sys
from datetime import datetime
from functools import partial
from pathlib import Path
from textwrap import indent
from typing import (
Counter,
Dict,
Generator,
Iterable,
List... | {
"content_hash": "49e116187edd907c8ae7c31b92d13158",
"timestamp": "",
"source": "github",
"line_count": 1248,
"max_line_length": 119,
"avg_line_length": 34.97275641025641,
"alnum_prop": 0.5797323924300051,
"repo_name": "jeremyh/eo-datasets",
"id": "c8d491d1c9d54c7d9d40e888c0d4decdd916cde5",
"size":... |
"""
PySpark supports custom serializers for transferring data; this can improve
performance.
By default, PySpark uses L{PickleSerializer} to serialize objects using Python's
C{cPickle} serializer, which can serialize nearly any Python object.
Other serializers, like L{MarshalSerializer}, support fewer datatype... | {
"content_hash": "fbb099c229119f2b3af7ba62b4ace5bc",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 97,
"avg_line_length": 30.97923875432526,
"alnum_prop": 0.5989053948397185,
"repo_name": "wangyixiaohuihui/spark2-annotation",
"id": "664e59eb30af525ddb445fb6e2b20ef796cdcff... |
import time
from ..utils.log import log, INFO, ERROR, PASS
from ..utils.isaac import answer_numeric_q, open_accordion_section
from ..utils.i_selenium import assert_tab, image_div
from ..utils.i_selenium import wait_for_xpath_element
from ..tests import TestWithDependency
from selenium.common.exceptions import TimeoutEx... | {
"content_hash": "43fd153c5283bde9739f8fecd9eb56ee",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 152,
"avg_line_length": 55.19672131147541,
"alnum_prop": 0.6836946836946837,
"repo_name": "jsharkey13/isaac-selenium-testing",
"id": "f3e610d6b81833748a50babda121903e61d5b983... |
"""Runner for workflow jobs
"""
# built-in
import os
import time
# 3rd party
import yaml
class JobContext(object):
"""Represents the context under which a job is executed
"""
image = None
volumes = {}
working_dir = None
build_dir = None
def __init__(self, **kwargs):
"""Initialize... | {
"content_hash": "c69005d20e9924ed00b068b44a1e2d91",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 95,
"avg_line_length": 34.04210526315789,
"alnum_prop": 0.5534941249226963,
"repo_name": "coolhacks/docker-hacks",
"id": "9625edee34697ee3b9e39eb4ec50bfd59d82eba0",
"size":... |
from django.http import HttpResponse
from django.template import loader
from django.db.models import Avg
from sites.models import *
def summary_sum(request):
template = loader.get_template('summary/summary.html')
context = {}
sites = Sites.objects.all()
for site in sites:
site.A_value ... | {
"content_hash": "498b03b8b6abafba26aa8f0f57780450",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 83,
"avg_line_length": 33.225806451612904,
"alnum_prop": 0.6485436893203883,
"repo_name": "ZhibinCH/my3MW",
"id": "ac864bcc24065b89f5d32bb88fb0527c4420bc72",
"size": "1030"... |
"""
ex-json borrowed from Marcin Kuzminski
source: https://secure.rhodecode.org/ext-json
"""
import datetime
import functools
import decimal
import imp
__all__ = ['json', 'simplejson', 'stdlibjson']
def _is_aware(value):
"""
Determines if a given datetime.time is aware.
The logic is described in Pytho... | {
"content_hash": "874828d5fc372880d65ae9dc88db6a5a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 78,
"avg_line_length": 29.984615384615385,
"alnum_prop": 0.5785017957927142,
"repo_name": "jpwilliams/appenlight-client-python",
"id": "93763ccc2995b3a95565c720bdbe0e8a4ab29... |
r"""
======
Pyplot
======
.. currentmodule:: bqplot.pyplot
.. autosummary::
:toctree: _generate/
figure
show
axes
plot
scatter
hist
bar
ohlc
geo
clear
close
current_figure
scales
xlim
ylim
"""
from collections import OrderedDict
from IPython.display import display... | {
"content_hash": "85e2d3c49a2af0b9b9cae75f07c7e720",
"timestamp": "",
"source": "github",
"line_count": 914,
"max_line_length": 93,
"avg_line_length": 35.167396061269145,
"alnum_prop": 0.6220639019382136,
"repo_name": "rmenegaux/bqplot",
"id": "553c356127945bea116ae4e854d5861e3dd00777",
"size": "32... |
from . import grammar
from . import cps
__all___ = ['print_program']
def print_program(program):
writer = Writer()
writer(program)
return ''.join(writer._buffer)
_cases = []
def case(cls):
def register(f):
_cases.append((cls, f))
return f
return register
class Writer(object):
... | {
"content_hash": "b14306ff4dac94dc33708c903d0f4dae",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 83,
"avg_line_length": 24.372413793103448,
"alnum_prop": 0.5797962648556876,
"repo_name": "jvs/stride",
"id": "61c8bf5d137fb1e6a64f46ae5863d0c971b1d804",
"size": "3534",
... |
from __future__ import print_function
import os
import glob
import sys
from tempfile import mkdtemp
import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.metrics.pairwise import pairwise_distances
import dendropy
from dendropy.calculate.treesum import TreeSummarizer
... | {
"content_hash": "345fa282833a3abea7f28fd500d09537",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 84,
"avg_line_length": 33.76538461538462,
"alnum_prop": 0.6361772411436383,
"repo_name": "mikekestemont/PyStyl",
"id": "349707421ac161ed3709549685f6ed6a02f591b5",
"size": ... |
def polygon(canvas, points, line_width, line_color, fill_color):
""" Add a polygon item on the canvas """
canvas.create_polygon(points, width = int(line_width),
outline = line_color, fill = fill_color)
| {
"content_hash": "ad5348ce04c06d19db9c36a6418a8323",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 40.5,
"alnum_prop": 0.6008230452674898,
"repo_name": "jem-gh/STplayer",
"id": "c0a159a1bffdf32975a55c796e936d202944de8c",
"size": "405",
"binary": f... |
import billboard
import unittest
from nose.tools import raises
from requests.exceptions import ConnectionError
import six
class MiscTest(unittest.TestCase):
@raises(ConnectionError)
def testTimeout(self):
"""Checks that using a very small timeout prevents connection."""
billboard.ChartData("ho... | {
"content_hash": "c09ac92c63597b78abe645eb5070164c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 83,
"avg_line_length": 38.310344827586206,
"alnum_prop": 0.6921692169216922,
"repo_name": "guoguo12/billboard-charts",
"id": "3c9923c76cd6c885ce5df3f8912a5f86a243295e",
"si... |
from __future__ import division
__author__ = 'Alejandro Hdz. Cruz'
# Imports
import csv
import random
import numpy as np # install in your computer: http://stackoverflow.com/questions/1273203/cant-import-numpy-in-python
# ====== Declare global variables ======
# === Static constants ===
# change to test different ... | {
"content_hash": "38cd3e2cfb0bc2e25538fc2209d9e76e",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 239,
"avg_line_length": 45.23076923076923,
"alnum_prop": 0.6531027044964327,
"repo_name": "AlejandroHCruz/VideoServerNURXSimulation",
"id": "bf6e760256570a80b4674c24f03d80de... |
"""Unittest for ciscoasa acl rendering module."""
from absl.testing import absltest
from unittest import mock
from capirca.lib import ciscoasa
from capirca.lib import naming
from capirca.lib import policy
GOOD_HEADER = """
header {
comment:: "this is a test acl"
target:: ciscoasa test-filter
}
"""
GOOD_TERM_1 ... | {
"content_hash": "992e1fcff545e4455d322f813a632a4f",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 74,
"avg_line_length": 27.015384615384615,
"alnum_prop": 0.6173120728929385,
"repo_name": "google/capirca",
"id": "fb9b48527edf5f4e5a52f7e78fb391a41b7781e2",
"size": "4109... |
import sys
import os.path
sys.path.append(os.path.abspath('../../../'))
from distutils.core import setup, Extension
from src.util.FileSystem import FileSystem
extDir = FileSystem.getExtDir()
jsonPath = os.path.join(extDir, 'SimpleJSON-master/src')
jsonObj1Path = os.path.join(extDir, 'SimpleJSON-master/obj/JSON.o')
j... | {
"content_hash": "7964071f501f3b43e08d1dec962a4143",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 116,
"avg_line_length": 31.708333333333332,
"alnum_prop": 0.6819973718791065,
"repo_name": "tanonev/codewebs",
"id": "bb3dc286e605f51deb611e51456adb8576cf5005",
"size": "76... |
from __future__ import (division, absolute_import, print_function,
unicode_literals)
"""Fixes file permissions after the file gets written on import. Put something
like the following in your config.yaml to configure:
permissions:
file: 644
dir: 755
"""
import os
fro... | {
"content_hash": "d0208a0cb5a3f3edcaea3afe549b175c",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 78,
"avg_line_length": 30.85148514851485,
"alnum_prop": 0.6267650834403081,
"repo_name": "multikatt/beets",
"id": "a85bff6b50e937860f0b8aabab19c8d00fb6bade",
"size": "3116... |
import datetime
import warnings
from contextlib import suppress
from typing import Optional, Union
import numpy as np
import pandas as pd
from pydantic import PositiveInt, confloat, validate_arguments
from toolbox_utils import tsutils
from tstoolbox import tstoolbox
from typing_extensions import Literal
from . import... | {
"content_hash": "93828444a31b2513273163dfccb16652",
"timestamp": "",
"source": "github",
"line_count": 1069,
"max_line_length": 88,
"avg_line_length": 30.507015902712816,
"alnum_prop": 0.5537532196737397,
"repo_name": "timcera/mettoolbox",
"id": "5a8c43de32a920c0f60cceb67f50a1892d7bb891",
"size": ... |
"""
AUTHOR : Lang
PURPOSE : Multi Self Deep Learning
"""
__author__ = 'Lang'
import tensorflow as tf, sys
import os
import shutil
# change this as you see fit
graph_path_temple = sys.argv[1]
label_path_temple = sys.argv[2]
graph_path = os.path.abspath(graph_path_temple)
label_path = os.path.abspath(label_path_t... | {
"content_hash": "c119471ee64ea93ba865f91ebbaeff12",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 120,
"avg_line_length": 31.157894736842106,
"alnum_prop": 0.582347972972973,
"repo_name": "HeavenMin/PlantImageRecognition",
"id": "d4d4074133cdcf69d751385a79dbfab1e660de3a",... |
"""Test parsing of COUNTER 5 TRJ2 report (turnaways)"""
import datetime
def test_metric(trj2_report):
assert trj2_report.metric is None # Multiple metrics per report
def test_type(trj2_report):
assert trj2_report.report_type == u"TR_J2"
def test_data(trj2_report):
i = iter(trj2_report)
row = nex... | {
"content_hash": "a5692d49b355de3d09b2b32424e4cf23",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 68,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.672209026128266,
"repo_name": "pitthsls/pycounter",
"id": "d7e97bef42ee8a73ced3122621e89a3c51f6cc39",
"size": "421... |
from vispy import testing
from vispy.visuals.graphs.layouts import get_layout
from vispy.visuals.graphs.layouts.networkx_layout import NetworkxCoordinates
import numpy as np
# conditional import
try:
import networkx as nx
except ModuleNotFoundError:
nx = None
def test_networkx_layout_with_graph():
"""
... | {
"content_hash": "7cac8c0af687abed034242ca76a922d8",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 94,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6608695652173913,
"repo_name": "Eric89GXL/vispy",
"id": "4369514bb3f0e92262f57f32052bb79bf2edc91c",
"size": "1539... |
import sys
import hashlib
import time
import json
import os
import binascii
import datetime
import random
import requests # pip install requests
from requests import Request, Session
AUTH_KEY = os.environ['AUTH_KEY']
USERNAME = os.environ['USERNAME'] if 'USERNAME' in os.environ else 'joe'
PASSPHRASE = os.environ[... | {
"content_hash": "8e390cf472de9b9142e14a8a6e9b973f",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 167,
"avg_line_length": 24.737609329446062,
"alnum_prop": 0.6651738361814967,
"repo_name": "clipperz/stats-collector",
"id": "66622cb95bcc9063cc1688ff4d092cd5c0452f80",
"s... |
from abc import ABCMeta, abstractmethod
from six import add_metaclass
from fuel.iterator import DataIterator
@add_metaclass(ABCMeta)
class AbstractDataStream(object):
"""A stream of data separated into epochs.
A data stream is an iterable stream of examples/minibatches. It shares
similarities with Pyth... | {
"content_hash": "1d4a28232c63d4f60574d9136963d5d4",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 32.56934306569343,
"alnum_prop": 0.628641864634693,
"repo_name": "mducoffe/fuel",
"id": "0286c20af0c21e9684ec5d931c9a0c4983b7abd9",
"size": "4462",
... |
from wagtail.contrib.modeladmin.options import (
ModelAdmin, modeladmin_register)
from unusualbusiness.howtos.models import HowToPage
class HowToPageModelAdmin(ModelAdmin):
model = HowToPage
menu_label = 'Knowledge pools' # ditch this to use verbose_name_plural from model
menu_icon = 'radio-empty howt... | {
"content_hash": "02d05203d6927906e413a6a5ca7a5066",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 85,
"avg_line_length": 39.125,
"alnum_prop": 0.7348242811501597,
"repo_name": "jeremy-c/unusualbusiness",
"id": "da9b56ddaa1bd3450286c64aa289b65e7d84a5f9",
"size": "626",
... |
from mock import Mock
from allura.lib import helpers as h
from tg import tmpl_context as c
from forgetracker.tracker_main import MilestoneController
def test_unicode_lookup():
# can't use name= in constructor, that's special attribute for Mock
milestone = Mock()
milestone.name = 'Перспектива'
milesto... | {
"content_hash": "18099ffa417ae20f589cba1fa7ed8cfe",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 97,
"avg_line_length": 33.48,
"alnum_prop": 0.6881720430107527,
"repo_name": "apache/allura",
"id": "9634eb62d004e4b9064047be92c5ab590def40e9",
"size": "1741",
"binary": ... |
from django.db import models
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from mezzanine.pages.page_processors import processor_for
from hs_core.models import BaseResource, ResourceManager, resource_processor, \
CoreMetaData, AbstractMetaDataEle... | {
"content_hash": "4b5e16cc77e9ada9282ba43131744aad",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 100,
"avg_line_length": 39.67656765676568,
"alnum_prop": 0.6397438030277824,
"repo_name": "FescueFungiShare/hydroshare",
"id": "1cdf3870c172f321245c8cb21e061bee0f80ec52",
... |
import os
import base64
import urlparse
import urllib2
import BaseHTTPServer
import unittest
import hashlib
from test import test_support
mimetools = test_support.import_module('mimetools', deprecated=True)
threading = test_support.import_module('threading')
try:
import ssl
except ImportError:
ssl = None
he... | {
"content_hash": "9fccdfa72d300e52e26ce996cf6f6bb5",
"timestamp": "",
"source": "github",
"line_count": 684,
"max_line_length": 93,
"avg_line_length": 37.244152046783626,
"alnum_prop": 0.5867713444553484,
"repo_name": "IronLanguages/ironpython2",
"id": "932b57223a5652c373d896a4ccba09ae833aa1a2",
"s... |
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import os.path
from git_code_debt.server.app import create_metric_config_if_not_exists
from git_code_debt.server.app import main
from testing.utilities.cwd import cwd
def test_file_does_not_exist():
assert main(argv=['i_don... | {
"content_hash": "db03af8c2e6313dd0b89f2d8c5376c1f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 30.78787878787879,
"alnum_prop": 0.6761811023622047,
"repo_name": "ucarion/git-code-debt",
"id": "c3844008917b2252808f8276cbf8b55bc46d7af2",
"size": ... |
from setuptools import setup
from beewarn import VERSION
setup(name='beewarn',
version=VERSION,
description='Utility for warning about bees',
author='Alistair Lynn',
author_email='[email protected]',
license='MIT',
url='https://github.com/prophile/beewarn',
zip_safe=True,
... | {
"content_hash": "bdb9771f80f2928b40c204036fa49890",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 51,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.5874769797421732,
"repo_name": "prophile/beewarn",
"id": "f6b3be7c9a1548e3e0e943e73713d158323b6aa4",
"size": "543... |
"""
Default experiment for clean smp
Should be self-contained requiring now external packages or processes.
Robot: Point mass
World: open linear (1D) space
Task: go to a goal position and stay there
Brain: taxis
Loss: mean squared error / goal distance
"""
import time
from smq.utils import make_column_names_numb... | {
"content_hash": "d857769d7fc6f91de56ba1eebd827f2c",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 215,
"avg_line_length": 37.287234042553195,
"alnum_prop": 0.5289586305278174,
"repo_name": "x75/smq",
"id": "6fbe532ead88afe961a46ae4a56fe55f36949f49",
"size": "3505",
"b... |
""" losses for training neural networks """
from __future__ import absolute_import
__all__ = ['Loss', 'L2Loss', 'L1Loss',
'SigmoidBinaryCrossEntropyLoss', 'SigmoidBCELoss',
'SoftmaxCrossEntropyLoss', 'SoftmaxCELoss',
'KLDivLoss', 'CTCLoss', 'HuberLoss', 'HingeLoss',
'SquaredH... | {
"content_hash": "d2c3b98e6074d558669a8cf0ef69db0a",
"timestamp": "",
"source": "github",
"line_count": 818,
"max_line_length": 118,
"avg_line_length": 39.43520782396088,
"alnum_prop": 0.6110422220844441,
"repo_name": "mlperf/training_results_v0.6",
"id": "238b300ba37bc187c45a01d3108121ad78981a7f",
... |
import graphene
from .....checkout import calculations
from .....checkout.fetch import fetch_checkout_info, fetch_checkout_lines
from .....payment.error_codes import PaymentErrorCode
from .....payment.models import ChargeStatus, Payment
from .....plugins.manager import get_plugins_manager
from ....tests.utils import g... | {
"content_hash": "575785b9021d609a37e222f4232c96c1",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 86,
"avg_line_length": 36.24390243902439,
"alnum_prop": 0.6639748766262898,
"repo_name": "mociepka/saleor",
"id": "53672ce5038affbeca0816f407b2efdd081c1511",
"size": "4458... |
from django.conf import settings
# noinspection PyProtectedMember
from django.core.cache import caches
from django.utils.six import iteritems
from logging import getLogger
import requests
import requests.exceptions
import string
import random
import socket
logger = getLogger(__name__)
def random_password(minlength... | {
"content_hash": "89304966f8a285b323f9cfa01fcf06bb",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 113,
"avg_line_length": 31.953191489361704,
"alnum_prop": 0.5591956319083766,
"repo_name": "erigones/esdc-ce",
"id": "d3ad7519736beb8391b8973acd2c09cb798b8bdb",
"size": "7... |
""" Testing suite for the PyTorch M2M100 model. """
import copy
import tempfile
import unittest
from transformers import is_torch_available
from transformers.file_utils import cached_property
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device
from .te... | {
"content_hash": "112cc1458510425b51c21e8e709c72c4",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 305,
"avg_line_length": 43.917355371900825,
"alnum_prop": 0.652866641575712,
"repo_name": "huggingface/pytorch-transformers",
"id": "e39876e4ee7cecd996470b3c2ecb2e7130ce7b19... |
import warnings
from functools import partial
from typing import ( # pylint: disable=unused-import
Any, AnyStr, Dict, IO, Iterable, List, Optional, overload, Tuple, Union,
TYPE_CHECKING
)
from azure.core.async_paging import AsyncItemPaged
from azure.core.exceptions import ResourceNotFoundError, HttpResponseEr... | {
"content_hash": "a21997f7a201bce8f9f5db8e6c12cc07",
"timestamp": "",
"source": "github",
"line_count": 2764,
"max_line_length": 169,
"avg_line_length": 54.27496382054993,
"alnum_prop": 0.6448778796928327,
"repo_name": "Azure/azure-sdk-for-python",
"id": "3807e8f9fdadf1cb97fbf4eef49d74e3bb80439e",
... |
import os
class PsicrawlerPipeline(object):
def get_base_path(self):
return os.path.dirname(os.path.realpath(__file__)) + "/../xmlfiles"
def write_item(self, item):
if len(item['topics']) > 0:
targetDir = self.get_base_path()
firstLetter = item['title'][0].lo... | {
"content_hash": "fd6b18f2b8e07d4984e0bdca53a439fe",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 75,
"avg_line_length": 28.346153846153847,
"alnum_prop": 0.5115332428765265,
"repo_name": "psiopic2/psicrawler",
"id": "ff321fca705e925e6e8e1de4f89424a7a0bf96bf",
"size": "... |
import minecraft.minecraft as minecraft
#import minecraft block module
import minecraft.block as block
#import time, so delays can be used
import time
if __name__ == "__main__":
time.sleep(2)
#Connect to minecraft by creating the minecraft object
# - minecraft needs to be running and in a game
mc = mi... | {
"content_hash": "1ebb014dec9633be5ff9457ab2e68c44",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 123,
"avg_line_length": 32.73255813953488,
"alnum_prop": 0.6550621669626998,
"repo_name": "martinohanlon/minecraft-api-tutorial",
"id": "381386daaf5a24c5350609fa567f2c1da2cb1... |
import unittest
import threading
import time
import IECore
import Gaffer
import GafferTest
class NodeTest( GafferTest.TestCase ) :
def testParenting( self ) :
c = Gaffer.GraphComponent()
n = Gaffer.Node()
self.assertEqual( n.acceptsParent( c ), False )
self.assertRaises( RuntimeError, c.addChild, n )
... | {
"content_hash": "3e4ebfc509ba8c3f100204c64b91839a",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 120,
"avg_line_length": 26.60747663551402,
"alnum_prop": 0.6283807516684229,
"repo_name": "paulondc/gaffer",
"id": "2d39c7024137cdc07f338e8358e5c88f412af7aa",
"size": "757... |
import re
class FilePermissions(object):
"""
Class for parsing `ls -l` line targeted at concrete file and handling parsed properties.
It is useful for checking file permissions and owner.
Attributes:
perms_owner (str): Owner permissions, e.g. 'rwx'
perms_group (str): Group permission... | {
"content_hash": "0150d8704fc40fe1f510ec78eb275d29",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 100,
"avg_line_length": 37.03350515463917,
"alnum_prop": 0.5220961792748278,
"repo_name": "RedHatInsights/insights-core",
"id": "26fbc25905bd3eab3c83e4172b3456890f001bf0",
... |
import os
import tarfile
import zipfile
from .basefile import BaseFile
from ...errors.fe import FileContainerFileNotFound as CNF
from ...errors.fe import FileContainerFailedExtraction as CFE
class ContainerFile(BaseFile):
"""
The **CompressedFile** :py:class:`pynion.Multiton` is a file management obje... | {
"content_hash": "ac28935bd431ba1aa237f83c9c1c1106",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 82,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.5665742024965326,
"repo_name": "jaumebonet/pynion",
"id": "043d127b3d1ad50d6b4efd6540cedda63e8c386b",
"size": "4... |
import functools
from stronghold import decorators
import django
if django.VERSION[:2] < (1, 9):
from django.utils import unittest
else:
import unittest
class StrongholdDecoratorTests(unittest.TestCase):
def test_public_decorator_sets_attr(self):
@decorators.public
def function():
... | {
"content_hash": "f9c95708f340e74b0c303414cd17e1cf",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 69,
"avg_line_length": 23.46153846153846,
"alnum_prop": 0.6579234972677596,
"repo_name": "klenks/jobsportal",
"id": "8726b9b36b0d77a74dced7686763fd9087310192",
"size": "915... |
from oslo_config import cfg
from nova.conf import serial_console
CONF = cfg.CONF
serial_console.register_opts(CONF)
| {
"content_hash": "4053e8075244ac70ed62c5eec8a017c0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 36,
"avg_line_length": 17,
"alnum_prop": 0.7899159663865546,
"repo_name": "devendermishrajio/nova",
"id": "33426f4aa20e45e43c5791fe2499e1a98fff39cc",
"size": "964",
"binar... |
import cupy
import numpy as np
from cupy._core import internal
from cupy import _util
from cupyx.scipy.sparse import _base
from cupyx.scipy.sparse import _coo
from cupyx.scipy.sparse import _sputils
_ufuncs = [
'arcsin', 'arcsinh', 'arctan', 'arctanh', 'ceil', 'deg2rad', 'expm1',
'floor', 'log1p', 'rad2deg', ... | {
"content_hash": "e2143de949f9e83296b86471d43f075a",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 79,
"avg_line_length": 33.14572864321608,
"alnum_prop": 0.5489690721649485,
"repo_name": "cupy/cupy",
"id": "1615aea2db15f5b1a46cc5cd7f6a28061990781f",
"size": "13192",
... |
"""
pyshtools
=========
pyshtools is an archive of scientific routines that can be used to
perform spherical harmonic transforms and reconstructions, rotations
of data expressed in spherical harmonics, and multitaper spectral
analyses on the sphere.
This module imports the following classes and subpackages into the
m... | {
"content_hash": "2eb2757d0c74b2cc86310bea8f7eae02",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 71,
"avg_line_length": 31.90625,
"alnum_prop": 0.732615083251714,
"repo_name": "ioshchepkov/SHTOOLS",
"id": "a1203d186778eb0948671ea65ef6d35a5a2b39ae",
"size": "2042",
"b... |
"""
This script builds and runs a graph with miniflow.
There is no need to change anything to solve this quiz!
However, feel free to play with the network! Can you also
build a network that solves the equation below?
(x + y) + y
"""
from miniflow import *
x, y = Input(), Input()
f = Add(x, y)
feed_dict = {x: 10,... | {
"content_hash": "75c5c246a3fb21429bf6510b4f7a0bc5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 90,
"avg_line_length": 25.64,
"alnum_prop": 0.6911076443057722,
"repo_name": "nehal96/Deep-Learning-ND-Exercises",
"id": "bcde0b8316a3647afc0ae880cd34ee9a71dbde3c",
"size":... |
"""This bot will move pages out of redirected categories.
The bot will look for categories that are marked with a category redirect
template, take the first parameter of the template as the target of the
redirect, and move all pages and subcategories of the category there. It
also changes hard redirects into soft redi... | {
"content_hash": "e7fe7078d366bad262c93fcc3f3f4f42",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 84,
"avg_line_length": 42.937369519832984,
"alnum_prop": 0.4948218019156902,
"repo_name": "npdoty/pywikibot",
"id": "a401fd9d499f3c5c4370fdfc4b1f84ca8aea5cc2",
"size": "20... |
from django.db import models, migrations
import evennia.accounts.manager
import django.core.validators
class Migration(migrations.Migration):
dependencies = [("accounts", "0003_auto_20150209_2234")]
operations = [
migrations.DeleteModel(name="DefaultGuest"),
migrations.DeleteModel(name="Defa... | {
"content_hash": "93504dbe79163780b731057bbb85c0cc",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 126,
"avg_line_length": 38.05357142857143,
"alnum_prop": 0.5344908493664946,
"repo_name": "jamesbeebop/evennia",
"id": "51217a83e5c2c148274cf1203d94761b7cb6d2d5",
"size": "... |
__author__ = 'olesya'
import unittest
from models.User import User
from DAL import DAL
class UserDetails(unittest.TestCase):
def test_get_name(self):
d = DAL()
self.assertEqual(d.get_user_details("user_name"),"oles_ka")
def test_set_name(self):
d = DAL()
us_list... | {
"content_hash": "2a02d217726f103b2f32f0d1167634fe",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 67,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.5764705882352941,
"repo_name": "shaipeer/ATTENDER",
"id": "64b2b9c1d5f3803e57e23eac7111beeef8e52d11",
"size": "51... |
"""
progress handler.
Old progress funcs needto be depricated ProgressIter and ProgChunks are pretty
much the only useful things here.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import time
import math
import datetime
from functools import partial
from utool import util_logg... | {
"content_hash": "c7895f345908dde409546d7658bc0158",
"timestamp": "",
"source": "github",
"line_count": 961,
"max_line_length": 113,
"avg_line_length": 37.733610822060356,
"alnum_prop": 0.5336164580001103,
"repo_name": "Erotemic/utool",
"id": "2654077b7e1eefca2017b3333102d189b02bfc24",
"size": "362... |
__author__ = 'radlab'
import ctypes as ct
# Enums
_ARUCO_FAILURE = -1
_ARUCO_SUCCESS = 0
_ARUCO_FALSE = 0
_ARUCO_TRUE = 1
# Structures
class _Size(ct.Structure):
_fields_ = [
('width', ct.c_int),
('height', ct.c_int),
]
class _Image(ct.Structure):
_fields_ = [
('data', ct.POINTER(ct.c_uint... | {
"content_hash": "6335f5075c092878812576e289a90391",
"timestamp": "",
"source": "github",
"line_count": 517,
"max_line_length": 120,
"avg_line_length": 32.359767891682786,
"alnum_prop": 0.6805738194859534,
"repo_name": "richstoner/pyaruco",
"id": "b915beb0802ad03c3849aa4851d9db6a5c4f333d",
"size": ... |
from jinja2 import Environment, FunctionLoader, ChoiceLoader, FileSystemLoader
from itertools import chain
from collections import OrderedDict
class TemplateError(Exception):
def __init__(self, message):
self.message = message
class _TemplateFunc:
def __init__(self, *params):
self.id... | {
"content_hash": "0b1112bd7d38a6b966f00b328f3c2560",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 92,
"avg_line_length": 34.046875,
"alnum_prop": 0.5686094538779256,
"repo_name": "demotomohiro/Reflection-Refraction-less-Ronpa-Raytracing-Renderer",
"id": "e54d18bce2130cb6... |
"""
github3.repos.contents
======================
This module contains the Contents object pertaining to READMEs and other files
that can be accessed via the GitHub API.
"""
from __future__ import unicode_literals
from json import dumps
from base64 import b64decode, b64encode
from ..git import Commit
from ..models i... | {
"content_hash": "8761e4e9ff5fdf38bc8c13fa92829357",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 78,
"avg_line_length": 38.72781065088758,
"alnum_prop": 0.5911382734912146,
"repo_name": "christophelec/github3.py",
"id": "e143d34753dfcdd17ad86a30e816df5f54b14443",
"siz... |
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import argparse
import astropy
import astropy.units as units
from astropy.coordinates import SkyCoord
import numpy
import numpy.linalg
from arl.test_support import import_visibility_from_oskar... | {
"content_hash": "a5b38b1e666ad4e0e55ce0da74b795d2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 114,
"avg_line_length": 30.083333333333332,
"alnum_prop": 0.6393351800554017,
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"id": "6b0bbee06e3d7c36be1493402ee0a813c8a008... |
import MySQLdb
import string
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import ConfigParser
def get_item(data_dict,item):
try:
item_value = data_dict[item]
return item_value
except:
pass
def get_parameters(conn):
try:
curs=conn.cursor()
data=curs.execute(... | {
"content_hash": "8686269d9e5fec7f74861e6728710638",
"timestamp": "",
"source": "github",
"line_count": 717,
"max_line_length": 199,
"avg_line_length": 26.702928870292887,
"alnum_prop": 0.490232946829625,
"repo_name": "JK-Warriors/Heimdallr",
"id": "d6773bd3040831389dce08a7c83360bb63ad7f04",
"size"... |
from xmlrpclib import ServerProxy, Fault
from os.path import join, abspath, isfile
from SimpleXMLRPCServer import SimpleXMLRPCServer
from urlparse import urlparse
import sys
SimpleXMLRPCServer.allow_reuse_address = 1
MAX_HISTORY_LENGTH = 6
UNHANDLED = 100
ACCESS_DENIED = 200
class UnhandledQuery(Fault):
def __i... | {
"content_hash": "e91846ed765591868f4f9b931cfd9a8f",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 74,
"avg_line_length": 25.50980392156863,
"alnum_prop": 0.568793235972329,
"repo_name": "gavinfish/Awesome-Python",
"id": "a4fc2ff796910dc238a29822353499b7a0f4afb5",
"size... |
import pytest
import unittest
from modules.sfp_greensnow import sfp_greensnow
from sflib import SpiderFoot
@pytest.mark.usefixtures
class TestModuleGreensnow(unittest.TestCase):
def test_opts(self):
module = sfp_greensnow()
self.assertEqual(len(module.opts), len(module.optdescs))
def test_s... | {
"content_hash": "e85ebc5313b1f4dbfd79d9252fe301ac",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 64,
"avg_line_length": 28.46153846153846,
"alnum_prop": 0.6972972972972973,
"repo_name": "smicallef/spiderfoot",
"id": "5a0bcacf82ba55002a8bd727f40b439324a0009c",
"size": "... |
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
import oz.redis_sessions
import oz
import unittest
@oz.test
class CDNCoreTestCase(unittest.TestCase):
def test_password_hash(self):
hash = oz.redis_sessions.password_hash("bar", password_salt="foo")
... | {
"content_hash": "e85a42f4ffe456064af86cda567f0646",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 105,
"avg_line_length": 31.928571428571427,
"alnum_prop": 0.6621923937360179,
"repo_name": "dailymuse/oz",
"id": "f952216e653ae3f86a2a60f0c35f72cb0d4fbcc9",
"size": "894",
... |
class TripadPipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "59d04b64939244c8dbe162954b04dddc",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6847826086956522,
"repo_name": "acehanks/projects",
"id": "c487d9df196e6508d47e666ac4234efd3f76ac3b",
"size": "286... |
from stringmatching.base import Base
from collections import defaultdict
class LastOcc(Base):
def search(self, pattern, text, all=False):
start = 0
self.m = len(pattern)
self.n = len(text)
self.last_occ = self.__last_occurence(pattern, text)
if all:
results = []
... | {
"content_hash": "4ff9e57a0907cbd78f1e2baa9943339f",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 140,
"avg_line_length": 35.509433962264154,
"alnum_prop": 0.5345377258235919,
"repo_name": "klingtnet/stringologie-ss14",
"id": "9049ef1ca4e0400181e7c4507ace90b3c80486d3",
... |
"""The tests for the MQTT switch platform."""
import copy
from unittest.mock import patch
import pytest
from homeassistant.components import switch
from homeassistant.components.mqtt.switch import MQTT_SWITCH_ATTRIBUTES_BLOCKED
from homeassistant.const import (
ATTR_ASSUMED_STATE,
ATTR_DEVICE_CLASS,
STATE... | {
"content_hash": "8639b31050cb249face438514590e4c2",
"timestamp": "",
"source": "github",
"line_count": 588,
"max_line_length": 86,
"avg_line_length": 31.102040816326532,
"alnum_prop": 0.6042213473315835,
"repo_name": "rohitranjan1991/home-assistant",
"id": "a458ac03baa14dec9832cfdc218ceeb588612546",... |
"""Libraries for building Stack Overflow next-word prediction models."""
import tensorflow as tf
class TransposableEmbedding(tf.keras.layers.Layer):
"""A Keras layer implementing a transposed projection output layer."""
def __init__(self, embedding_layer: tf.keras.layers.Embedding):
super().__init__()
s... | {
"content_hash": "9003a03ac11ee3863daed7a66cc4c45f",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 80,
"avg_line_length": 41.945205479452056,
"alnum_prop": 0.705421293272371,
"repo_name": "tensorflow/federated",
"id": "acdc9bf0ca9100b18429c5373f03675db8dec0ec",
"size": "... |
def assert_nearly_equal(left, right, precision=7, message=None):
"""Asserts that left is equal to right up to precision digits"""
condition = round(abs(left - right), precision) == 0
if message is not None:
assert condition, message
else:
assert condition
| {
"content_hash": "49befc24ee355af70b56545da15ea2e9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 41.142857142857146,
"alnum_prop": 0.6701388888888888,
"repo_name": "Benjamin-Marks/mit-tab",
"id": "ecdb7d6b38eecd96c6aa3f11802979d900b808f4",
"size":... |
__version__ = '17.11'
from .base import DAL
from .objects import Field
from .helpers.classes import SQLCustomType
from .helpers.methods import geoPoint, geoLine, geoPolygon
| {
"content_hash": "ce0490223e6ecea768ebc590a47d922d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 58,
"avg_line_length": 29,
"alnum_prop": 0.7816091954022989,
"repo_name": "xiang12835/python_web",
"id": "5964d36488a35f34c1ae2547042b0dbede755785",
"size": "174",
"binary... |
import unittest
from wsgid.core import parser
from wsgid.core.parser import CommandLineOption, BOOL, INT, STRING, LIST
import wsgid.conf
import sys
import signal
import platform
from mock import patch
from wsgid.commands import *
class ParserTest(unittest.TestCase):
def setUp(self):
wsgid.conf.settings = N... | {
"content_hash": "b8ecf74ea9ec444f84a6e25bc867d535",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 98,
"avg_line_length": 33.01481481481481,
"alnum_prop": 0.672425398249944,
"repo_name": "daltonmatos/wsgid",
"id": "952f7a7312fd9e83d1a4d81e39bae89eeecb6d80",
"size": "446... |
from django.conf.urls import url
from . import views
"""
L'application tournament affiche le dernier tournois actif (different de archived or comming)
dans cette page est affiche
* 2 onglets : equipe et resultats
* un bouton pour choisir un autre tournoi
"""
urlpatterns = [
url( r'^$', views.tournament_list, name... | {
"content_hash": "c3c177e246516bed01c1aef7f17e9c18",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 109,
"avg_line_length": 50.56521739130435,
"alnum_prop": 0.6423043852106621,
"repo_name": "cedlerouge/betwit",
"id": "3941a0f85f64c9b2450a6010075c4cf2b3c0973b",
"size": "11... |
from __future__ import absolute_import, unicode_literals
import json
from datetime import datetime, timedelta
import six
from django.conf.urls import url, include
from django.core.exceptions import ImproperlyConfigured
from django.http import QueryDict
from django.utils import six
from django.test import TestCase, Si... | {
"content_hash": "26b5750739ad14e501a11d5c052d99dc",
"timestamp": "",
"source": "github",
"line_count": 679,
"max_line_length": 123,
"avg_line_length": 36.83652430044182,
"alnum_prop": 0.6193826963057733,
"repo_name": "jannon/drf-haystack",
"id": "5cdbdea72213297e67bf5a4b37357ff5efe1afb4",
"size": ... |
from urllib import urlencode, unquote
from urlparse import parse_qs
import re, sys, traceback
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks
from twisted.internet.error import ConnectionRefusedError
from twisted.web import http
from twisted.web.resource import Resource
from twist... | {
"content_hash": "a37d82ce7a50f0294404b2d34719f807",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 91,
"avg_line_length": 39.01973684210526,
"alnum_prop": 0.5759568369583544,
"repo_name": "texttochange/vusion-backend",
"id": "695c7101d8f9a7ce5a03c861f15a8e5a466e2ebd",
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from .. import base
# Module API
def extract_source(record):
source = {
'id': 'gsk',
'name': 'GlaxoSmithKline',
'type': 'register',
... | {
"content_hash": "a1adc021606aa54876bd2821b43774bb",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 81,
"avg_line_length": 28.053030303030305,
"alnum_prop": 0.6138266270591413,
"repo_name": "arthurSena/processors",
"id": "906fc6e7ff63a9d4ce2ec3c3d02d993443312f38",
"size"... |
__author__ = 'root'
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
# url(r'^telco_billing/', include('telco_billing.urls'), name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^home/$', 'wedding.views.index' , name='index-page'),
)
| {
"content_hash": "15807c0062b2435cc6a0be3e242f51ee",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 74,
"avg_line_length": 21.857142857142858,
"alnum_prop": 0.6111111111111112,
"repo_name": "harshittrivedi78/hotel_listing",
"id": "aa5782865c821b9c7389c23565b5330d2bcefb9b",
... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.WGL import _types as _cs
# End users want this...
from OpenGL.raw.WGL._types import *
from OpenGL.raw.WGL import _errors
from OpenGL.constant import Constant as _C
import ctype... | {
"content_hash": "9ea100a6ec9658292c0e5f6717675603",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 113,
"avg_line_length": 33.13333333333333,
"alnum_prop": 0.7464788732394366,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "7f602b3bf435d8ce878cc374884d763acaf31335",
... |
import cv2
import numpy as np
import tensorflow as tf
import os
import argparse
from tensorpack import *
from tensorpack.utils import viz
from tensorpack.tfutils.scope_utils import auto_reuse_variable_scope, under_name_scope
from tensorpack.tfutils import optimizer, summary, gradproc
from tensorpack.dataflow import d... | {
"content_hash": "99d9a30054056bc1219af669b8183fb9",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 113,
"avg_line_length": 38.68,
"alnum_prop": 0.6075961267274608,
"repo_name": "eyaler/tensorpack",
"id": "19be093c97c3a4e410007d162f97b56ca3ac6f56",
"size": "10728",
"bi... |
__author__ = 'kohlmannj'
from copy import copy, deepcopy
import os
import Ity
import DocuscopeDictionary
from DocuscopeCSVDictionary import DocuscopeCSVDictionary
from Ity.Tokenizers import Tokenizer
from Ity.Taggers import Tagger
import time
class DocuscopeTagger(Tagger):
"""
DocuscopeTagger uses an impleme... | {
"content_hash": "1ae3886e9892091b6c93a2b5d922c99c",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 127,
"avg_line_length": 48.01775147928994,
"alnum_prop": 0.5863832409118915,
"repo_name": "uwgraphics/Ubiqu-Ity",
"id": "57e3e19b90d67971a1ceb3790e1ca6d341a4243d",
"size":... |
import sys
import pyrfa
p = pyrfa.Pyrfa()
p.createConfigDb("./pyrfa.cfg")
p.setDebugMode(False)
p.acquireSession("Session3")
p.createOMMConsumer()
p.login()
p.directoryRequest()
p.dictionaryRequest()
p.historyRequest("tANZ.AX")
count = 0
while not p.isHistoryRefreshComplete():
for u in p.dispatchEventQueue():
... | {
"content_hash": "174119241fc59d152df8b7e48a938437",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 87,
"avg_line_length": 26.25,
"alnum_prop": 0.5,
"repo_name": "devcartel/pyrfa",
"id": "04df1992a66ddbca846956ad53f9a1dbba7cae76",
"size": "1258",
"binary": false,
"cop... |
from boto.pyami.config import Config, BotoConfigLocations
from boto.storage_uri import BucketStorageUri, FileStorageUri
import boto.plugin
import os, re, sys
import logging
import logging.config
import urlparse
from boto.exception import InvalidUriError
__version__ = '2.4.1'
Version = __version__ # for backware compat... | {
"content_hash": "17c72be48301dc4b04d1167715f19c3b",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 89,
"avg_line_length": 36.69624060150376,
"alnum_prop": 0.656271769864361,
"repo_name": "darcyliu/storyboard",
"id": "9ae6ccaf7c0425adc4d08412c1aed99c33ce4f3d",
"size": "2... |
from setuptools import setup, find_packages
setup(
name='fureon',
version='0.0',
description='Crowd enabled music streamer and library',
author='Andy Tran',
author_email='[email protected]',
url='',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requir... | {
"content_hash": "29448ab1c126f9f8087a4f7b96c70484",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 59,
"avg_line_length": 21.857142857142858,
"alnum_prop": 0.5490196078431373,
"repo_name": "ATRAN2/fureon",
"id": "f579f2ee7eda43c28e9eba36b7c34aad0502c901",
"size": "638",
... |
"""CouchMail.py imports your mail from an IMAP server into a CouchDB database
License: Apache 2.0 - http://opensource.org/licenses/Apache-2.0
"""
import calendar
from base64 import b64encode
from dateutil.parser import parse
from couchdb import ResourceConflict
def headers(msg):
mail = {}
for header, value ... | {
"content_hash": "af69f95c263abcce6b89f0eb6c9f2dc0",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 28.78205128205128,
"alnum_prop": 0.5661469933184855,
"repo_name": "BigBlueHat/couchmail.py",
"id": "dd0d480f3c5234f9d1c01b8d89e4878a7877789c",
"size"... |
from __pyversor__.sta import *
| {
"content_hash": "60362885849bcab46267873b28fb982c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 31,
"alnum_prop": 0.6774193548387096,
"repo_name": "tingelst/pyversor",
"id": "e5444bc6936eea4335785329df9bfcc4ce02b3b0",
"size": "31",
"binary": fa... |
from __future__ import print_function
import itertools
from collections import OrderedDict
import nnabla as nn
import numpy as np
class NnpNetwork(object):
'''A graph object which is read from nnp file.
An instance of NnpNetwork is usually created by an NnpLoader instance.
See an example usage describ... | {
"content_hash": "55c5ad77acec682f52808eb66298a206",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 105,
"avg_line_length": 35.02739726027397,
"alnum_prop": 0.581834180680485,
"repo_name": "sony/nnabla",
"id": "da4ceb81634c515f0b6f34ff728775200e4714ef",
"size": "10866",
... |
import sqlite3
db_name = 'HTMLContent.db'
table_name = 'webPageContent'
def connectionAndTableDecorator(function):
def wrapper(*args, **kwargs):
connection = sqlite3.connect(db_name)
cursor = connection.cursor()
table_create_query = "CREATE TABLE IF NOT EXISTS {} (ID INTEGER PRIMARY KEY, ... | {
"content_hash": "599d9fd40762f6a999b6f0330f8f0cfa",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 139,
"avg_line_length": 27.61904761904762,
"alnum_prop": 0.6724137931034483,
"repo_name": "danielharada/HtmlFileGenerator",
"id": "817b53595aff2dc9312cb600e032fd785db4df28",
... |
import pandas as pd
import os
import numpy as np
from collections import namedtuple
task_status_tuple = namedtuple('task_status_tuple', ['todo', 'doing', 'done'])
task_status = task_status_tuple('todo', 'doing', 'done')
class project:
_tasklist = pd.DataFrame(columns=['workpackage', 'task', 'status', 'si... | {
"content_hash": "4c295ef605b9a2f1a4c5a705893fed76",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 147,
"avg_line_length": 40.09090909090909,
"alnum_prop": 0.58994708994709,
"repo_name": "Koet-273/Projectmanagement",
"id": "922db5cd703ef679336530ddfc94f9e5abc1677c",
"si... |
from msrest.paging import Paged
class VirtualNetworkPeeringPaged(Paged):
"""
A paging container for iterating over a list of :class:`VirtualNetworkPeering <azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str... | {
"content_hash": "f24c816a30f453918a012eb5d6eb761b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 151,
"avg_line_length": 32.6875,
"alnum_prop": 0.6462715105162524,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "a5f6cf1d46a903a74e1a3a50005f022cbe0a9fb0",
"size":... |
from django.contrib import admin
from staff.models import Department, Position
class PositionInline(admin.TabularInline):
model = Position
extra = 1
class DepartmentAdmin(admin.ModelAdmin):
fields = ['name', 'email', 'chair']
inlines = [PositionInline]
list_display = ('name', 'email')
orde... | {
"content_hash": "9c332c00520bb56cc4df4c14328db675",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 48,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7017994858611826,
"repo_name": "lynchnf/maneki-neko-web",
"id": "950aff3210f93755ac8846df919dfe8d66c37877",
"size... |
from sqlalchemy import Column, event, ForeignKey, Integer, String
from rdr_service.model.base import Base, model_insert_listener, model_update_listener
from rdr_service.model.consent_file import ConsentFile
from rdr_service.model.participant import Participant
from rdr_service.model.utils import UTCDateTime
class He... | {
"content_hash": "bbf4948e0bd2f113da65ae4072d811d6",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 85,
"avg_line_length": 42.95454545454545,
"alnum_prop": 0.7777777777777778,
"repo_name": "all-of-us/raw-data-repository",
"id": "6ea8439b9ef20f3ee2a9507866d8502fef282976",
... |
from subprocess import check_output
import re
import json
from os.path import exists, join, normpath
from licenses_vivaldi_texts import onlineLicenses
try:
f = open(normpath("gen/vivaldi/vivapp/module_list"), mode="r", encoding="utf-8")
maindeps = f.read()
f.close()
except:
maindeps = ""
modules = {}
for m i... | {
"content_hash": "3bd3a39ac1f3aa5b86173ba6bc0f7604",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 311,
"avg_line_length": 35.766304347826086,
"alnum_prop": 0.5970217292204832,
"repo_name": "ric2b/Vivaldi-browser",
"id": "e28c58f23f121297478db4c31915abeb973e649f",
"size... |
def get_recently_modified_keys(db_connection, no_of_days = -4):
o = urlparse(db_connction)
db_scheme = o.scheme
db_host = o.hostname
db_name = o.path.lstrip('/')
db_user = o.username
db_password = o.password
# NOTE: SQL expects a positive number for interval value...
if no_of_days < 0:
... | {
"content_hash": "b8be3c9534d9dbf2937780277c00d727",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 235,
"avg_line_length": 35.81818181818182,
"alnum_prop": 0.5614213197969543,
"repo_name": "caltechlibrary/epgo",
"id": "28a55d61baad46b1fec1b7c1bf7ed6bc1f74b883",
"size": "... |
import base64
import calendar
import datetime
import re
import unicodedata
import warnings
from binascii import Error as BinasciiError
from email.utils import formatdate
from urllib.parse import (
ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, quote,
quote_plus, scheme_chars, unquote, unquo... | {
"content_hash": "4497e3d58ae8b59304aeff17c36da2cd",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 93,
"avg_line_length": 34.708695652173915,
"alnum_prop": 0.6156833270700238,
"repo_name": "schinckel/django",
"id": "050375832cf8640ea25a2dd5d70d6033cff2734e",
"size": "15... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.