text stringlengths 4 1.02M | meta dict |
|---|---|
import SocketServer
import socket
import threading
import numpy as np
import cv2
import pygame
from pygame.locals import *
import socket
import time
import os
# SocketServer.ThreadingTCPServer.allow_reuse_address = True
RASP_IP = '192.168.43.70'
RASP_SERV_PORT = 7879
COMP_IP = '192.168.43.210'
COMP_SERV_PORT = 8002
c... | {
"content_hash": "18d379df66cddf41208540769ca2c106",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 102,
"avg_line_length": 39.584,
"alnum_prop": 0.4597817299919159,
"repo_name": "IsmoilovMuhriddin/allgo",
"id": "869eef11054ac19d93237d0ec740d1db66cdad0c",
"size": "9896",... |
""" Environment
"""
import gym
import numpy as np
import DQNConfig as config
import random
class DQNEnvironment:
def __init__(self, environment_name, display=False, frame_skipping=True):
self._env = gym.make(environment_name)
self._dispaly = display
self._done = True
self._total_e... | {
"content_hash": "e14abfb0f545074fdb782ea73b79f28c",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 116,
"avg_line_length": 31.485294117647058,
"alnum_prop": 0.5987856141989725,
"repo_name": "YuMao1993/DRL",
"id": "f17092526b24c875d610435a0d089d656f7bb0a9",
"size": "2141"... |
"""Package for ox_herd plugins.
""" | {
"content_hash": "99b0254b6eba28f96c344900e7117c55",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 17.5,
"alnum_prop": 0.6571428571428571,
"repo_name": "aocks/ox_herd",
"id": "e6370b90c91975fab237149ac1ccae3500c43070",
"size": "35",
"binary": fals... |
"""
Handle a restricted form of generators and inlining.
"""
from __future__ import print_function, division, absolute_import
from collections import namedtuple
from functools import partial
from flypy.errors import error
from flypy.runtime import builtins
from flypy.compiler.optimizations import inlining, reg2mem
... | {
"content_hash": "e6f2121a4bfdb1ea41fcc58b9050fc52",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 76,
"avg_line_length": 31.055299539170505,
"alnum_prop": 0.5583914527377949,
"repo_name": "flypy/flypy",
"id": "6f59fadb57b444fe55bb68e5c7a22873cb75840c",
"size": "6764",
... |
from a10sdk.common.A10BaseClass import A10BaseClass
class EntryList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param active: {"minLength": 1, "maxLength": 63, "type": "string", "format": "string"}
:param name: {"minLength": 1, "maxLength": 63, "type": "string",... | {
"content_hash": "d915b053a83c43ea6b17ff706389fb01",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 401,
"avg_line_length": 32.451219512195124,
"alnum_prop": 0.6076662908680946,
"repo_name": "amwelch/a10sdk-python",
"id": "0ca35880675fc9503a80a172571c4b30a16598dc",
"size"... |
import collections
from test_framework import generic_test
from test_framework.test_failure import PropertyName
Rect = collections.namedtuple('Rect', ('x', 'y', 'width', 'height'))
def intersect_rectangle(r1: Rect, r2: Rect) -> Rect:
# TODO - you fill in here.
return Rect(0, 0, 0, 0)
def intersect_rectang... | {
"content_hash": "647a861f199627579fe78e6e50da408a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 28,
"alnum_prop": 0.5800865800865801,
"repo_name": "shobhitmishra/CodingProblems",
"id": "d8898b474302e3627408ea65ae7aaae159d7c4e3",
"size": "924",
... |
from builtins import object
class CourgetteConfiguration(object):
def __init__(self, specification, parent_resource_name, parent_id, default_values):
"""
"""
self.specification = specification
self.parent_resource_name = parent_resource_name
self.parent_id = parent_id
... | {
"content_hash": "93230fd3f4cae0d50f4a7f276c914955",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 27.846153846153847,
"alnum_prop": 0.6629834254143646,
"repo_name": "little-dude/monolithe",
"id": "70333785dfa8cd03931a583d1dcde0016f1dbd1b",
"size":... |
"""module to call main and exit with its return code
"""
import sys
from . import main
sys.exit(
main.main(
sys.argv[1:]
)
)
| {
"content_hash": "f2e2658ea1fff8d4a76f86c8468334b3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 52,
"avg_line_length": 11.153846153846153,
"alnum_prop": 0.593103448275862,
"repo_name": "MrWinstead/businesscard_puzzle",
"id": "35e72b5dd5fb3f3b1b1519849c46171418d7d9ac",
... |
"""Matter cluster capability unit test for cluster_base module."""
from gazoo_device.capabilities.matter_clusters.interfaces import cluster_base
from gazoo_device.tests.unit_tests.utils import fake_device_test_case
_FAKE_DEVICE_NAME = "fake-device-name"
_FAKE_ENDPOINT_ID = 1
_FAKE_ATTRIBUTE = "fake_attribute"
class ... | {
"content_hash": "810bb818412111bdbccabd22a7c56dbf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 31.125,
"alnum_prop": 0.6967871485943775,
"repo_name": "google/gazoo-device",
"id": "afe021d5609f94da0b3a1e555438512729ff3016",
"size": "1572",
"bi... |
import datetime
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.sessions.middleware import SessionMiddleware
from django.contrib.sites.models import Site
from django.core import mail
from django.core.exceptions import ImproperlyConfigure... | {
"content_hash": "82c50328b8fbaa8acd959ce3fc8a6edc",
"timestamp": "",
"source": "github",
"line_count": 476,
"max_line_length": 119,
"avg_line_length": 37.46218487394958,
"alnum_prop": 0.58838043965904,
"repo_name": "stefankoegl/django-couchdb-utils",
"id": "f87eebeb33ae497a02783e05a253a17e6584bbd3",... |
import math
import numpy as np
import os.path
import pandas as pd
from astropy import constants as const
from pathlib import Path
import artistools as at
import artistools.spectra
import artistools.transitions
modelpath = Path(at.PYDIR, '..', 'tests', 'data')
outputpath = Path(at.PYDIR, '..', 'tests', 'output')
at.en... | {
"content_hash": "e96139ffa7727ad501ac1cdb449d9aea",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 118,
"avg_line_length": 41.17777777777778,
"alnum_prop": 0.7223421478683216,
"repo_name": "lukeshingles/artistools",
"id": "00a2b5f89e2c616806355574f64e42f3efadb976",
"size... |
import logging
import uuid
from urllib.parse import urljoin, urlencode, parse_qs
import requests
logger = logging.getLogger('moneybird')
class Authentication(object):
"""
Base class for authentication implementations.
"""
def is_ready(self) -> bool:
"""
Checks whether authentication ... | {
"content_hash": "b15bfbf816358de49804daa773ff622d",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 119,
"avg_line_length": 39.57286432160804,
"alnum_prop": 0.6246349206349207,
"repo_name": "jjkester/moneybird-python",
"id": "b0d862d407b639806408d5dc7d9378da9cea4a3c",
"s... |
''' Configuration settings for the Bridge backend webservices. '''
# Parent directory that the frontend is allowed to load files from.
# Any directory under this will be visible to the frontend.
ARCHIVE_PATH_LEADER = '/Users/skhudiky/workspace/Nano-code/nanograv-pipeline/data/archive/'
JOBS_PATH_LEADER = '/Users/skhud... | {
"content_hash": "aabf9896ccef1ae46e9f76fc8dce9c45",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 98,
"avg_line_length": 66.9090909090909,
"alnum_prop": 0.8016304347826086,
"repo_name": "shakeh/bridge-pipeline",
"id": "98a3e8b1b993566d6accfab724c9880004583d8d",
"size": ... |
from unittest import main
from copy import deepcopy
import numpy as np
import pandas as pd
import calour as ca
from calour._testing import Tests
class MTests(Tests):
def setUp(self):
super().setUp()
self.test1 = ca.read(self.test1_biom, self.test1_samp, self.test1_feat, normalize=None)
def ... | {
"content_hash": "9defb3c4930986eb9fc83af5a91ab983",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 200,
"avg_line_length": 58.262135922330096,
"alnum_prop": 0.5597400433261123,
"repo_name": "RNAer/Calour",
"id": "1118392259dc9862b52cad183801e604042afd95",
"size": "6352"... |
"""Evaluation utilities."""
import json
import re
import string
import unicodedata
import tensorflow.compat.v1 as tf
def normalize_answer(s):
"""Normalize answer."""
s = unicodedata.normalize("NFD", s)
def remove_articles(text):
return re.sub(r"\b(a|an|the)\b", " ", text)
def white_space_fix(text):
... | {
"content_hash": "98a2e9eb7a6e57c03f006623805dee2d",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 80,
"avg_line_length": 28.7196261682243,
"alnum_prop": 0.669378457533355,
"repo_name": "google-research/language",
"id": "0ca6118abb2b4c55927953afdec0818d8fad1782",
"size"... |
"""Runs a ResNet model on the ImageNet dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app as absl_app
from absl import flags
import tensorflow as tf
from official.r1.resnet import imagenet_preprocessing
from officia... | {
"content_hash": "bbb2c99385f5e5433af187898c2a280f",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 80,
"avg_line_length": 34.188328912466844,
"alnum_prop": 0.6465202886182015,
"repo_name": "alexgorban/models",
"id": "bbff51dc8af1fd24270431361fb7a5d184ac934c",
"size": "1... |
"""
celery.signals
~~~~~~~~~~~~~~
This module defines the signals (Observer pattern) sent by
both workers and clients.
Functions can be connected to these signals, and connected
functions are called whenever a signal is called.
See :ref:`signals` for more information.
"""
from __future__... | {
"content_hash": "e3ca61563ae6100932bda6833dbd355e",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 74,
"avg_line_length": 38.67567567567568,
"alnum_prop": 0.6666666666666666,
"repo_name": "sivaprakashniet/push_pull",
"id": "6eae2febff12e5fab08048e7af9a6c02706c2d65",
"siz... |
import os
import tempfile
import testtools
from pwd import getpwnam
from mock import MagicMock
from cloudify.mocks import MockCloudifyContext
from cloudify.exceptions import NonRecoverableError
from cloudify.state import current_ctx
from cloudify_common_sdk._compat import text_type
from .. import tasks as operation_... | {
"content_hash": "b73407d64b751ae326579c72b71f0c0a",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 78,
"avg_line_length": 34.338235294117645,
"alnum_prop": 0.6039971448965025,
"repo_name": "cloudify-incubator/cloudify-utilities-plugin",
"id": "13f90c4952b9ad2dfa2ede2b1a82... |
"""
The PyBuilder utils module.
Provides generic utilities that can be used by plugins.
"""
import json
import sys
import subprocess
import tempfile
import time
import traceback
from subprocess import Popen, PIPE
from multiprocessing import Process
import fnmatch
import os
import re
try:
from multiproces... | {
"content_hash": "ece90193b24622eda651ecf666853d8c",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 117,
"avg_line_length": 34.40350877192982,
"alnum_prop": 0.5585415604283529,
"repo_name": "alex-dow/pybuilder",
"id": "b61acd8a840aeed10d462e823a648dfac188fe1b",
"size": "... |
"""The main entry point for the new development server."""
import argparse
import errno
import getpass
import itertools
import logging
import os
import sys
import tempfile
import time
from google.appengine.api import appinfo
from google.appengine.datastore import datastore_stub_util
from google.appengine.tools impo... | {
"content_hash": "73941ec598b1e214a220ce2f49cf4330",
"timestamp": "",
"source": "github",
"line_count": 969,
"max_line_length": 80,
"avg_line_length": 39.31475748194014,
"alnum_prop": 0.6671829063418732,
"repo_name": "ychen820/microblog",
"id": "410c3ad7beb2d894cabbf1dbcf829713179e0255",
"size": "3... |
from setuptools import setup, find_packages
import sys, os
# The dependencies variable is used by MAP Client to
# determine if further downloads are required. Please
# list all dependencies here.
dependencies = [] # Insert plugin dependencies here
setup(name=u'mapclientplugins.filechooserstep',
version='0.0',
... | {
"content_hash": "0ba5404ebf8f385ca38f7d540a09ca8d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 54,
"avg_line_length": 29.434782608695652,
"alnum_prop": 0.6676514032496307,
"repo_name": "mapclient-plugins/filechooser",
"id": "b8418467c621054520e1d7402b353c63a91dde03",
... |
import os
import time
import zlib
from . import consts
__all__ = ("ZipStream", )
class Processor:
def __init__(self, file_struct):
self.crc = 0
self.o_size = self.c_size = 0
if file_struct['cmethod'] is None:
self.process = self._process_through
self.tail = self._... | {
"content_hash": "cb98a535acf8f2514858e8e4fb35f36d",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 92,
"avg_line_length": 34.864686468646866,
"alnum_prop": 0.5196895115486558,
"repo_name": "m2ozg/zipstream",
"id": "3bf9515fc19bee3b94e9f417e490fee2c2586105",
"size": "107... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget.api.app import base_message
from flexget.utils import json
class TestFormatChecker(object):
config = 'tasks: {}'
def test_quality(self, api_client,... | {
"content_hash": "5c73833a0848a8cf7ed6f8b460c68490",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 79,
"avg_line_length": 37.44292237442922,
"alnum_prop": 0.618780487804878,
"repo_name": "jacobmetrick/Flexget",
"id": "509c43e2240c25019f60e515325095a2c5586425",
"size": "... |
from urllib.parse import urlsplit
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import IntegrityError, transaction
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from conne... | {
"content_hash": "8d8f43f00b767dd730ebf5db7328a9d9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 33.901408450704224,
"alnum_prop": 0.6609887827170752,
"repo_name": "f3r3nc/connect",
"id": "9daf13963315e1797d6ac17a1069f3600288cb8c",
"size": "2407"... |
from datetime import datetime
from pyparsing import *
# define an integer string, and a parse action to convert it
# to an integer at parse time
integer = Word(nums)
def convertToInt(tokens):
# no need to test for validity - we can't get here
# unless tokens[0] contains all numeric digits
return int(tokens... | {
"content_hash": "9fd7b4ee99262d405f474813c30a1450",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 70,
"avg_line_length": 33.1,
"alnum_prop": 0.6737160120845922,
"repo_name": "mollstam/UnrealPy",
"id": "ca3b7e39e132630e6e252fe22413d5a28e523cfb",
"size": "1535",
"binary... |
from __future__ import absolute_import, division, print_function
from itertools import chain
import os
import sys
from fnmatch import fnmatch
from setuptools import setup
import versioneer
def ispackage(x):
return os.path.isdir(x) and os.path.exists(os.path.join(x, '__init__.py'))
def istestdir(x):
retur... | {
"content_hash": "bd508da501e998225c2b825b33b5d383",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 89,
"avg_line_length": 33.42982456140351,
"alnum_prop": 0.5087903437418001,
"repo_name": "ContinuumIO/blaze",
"id": "236bc3625867fe20e3238a3039e14e59980b4aae",
"size": "38... |
"""
Test running processes with the APIs in L{twisted.internet.utils}.
"""
import warnings, os, stat, sys, signal
from twisted.python.runtime import platform
from twisted.trial import unittest
from twisted.internet import error, reactor, utils, interfaces
class ProcessUtilsTests(unittest.TestCase):
"""
Test... | {
"content_hash": "0cc2b3d03d4c37050daf7922c81911f1",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 85,
"avg_line_length": 35.2457337883959,
"alnum_prop": 0.6110196572092573,
"repo_name": "Varriount/Colliberation",
"id": "d89ab56774792a7bc01d3614f4e0e279bf8a254b",
"size"... |
from django import template
from django.conf import settings
from leaflets.models import Leaflet
from django.db.models import Count
register = template.Library()
@register.inclusion_tag('parties/ordered_list.html')
def party_list_by_count():
from parties.models import Party
from datetime import datetime
w... | {
"content_hash": "b31907d8c58e1a36c877b5133f4e86db",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 66,
"avg_line_length": 32.733333333333334,
"alnum_prop": 0.7352342158859471,
"repo_name": "electionleaflets/electionleaflets",
"id": "08f6679223d16f91c196e676af4eec99db9eec78... |
from datetime import datetime
import entity
from .page import Page
class Employment(entity.Entity):
"""Employment instances represent Facebook users's work history."""
employer = None
"""A :class:`Page` instance describing the employer."""
position = None
"""A :class:`Page` instance describing ... | {
"content_hash": "f7c9978acee8f24ac3a9a91b878834af",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 122,
"avg_line_length": 31.485714285714284,
"alnum_prop": 0.6442831215970962,
"repo_name": "vyyvyyv/facebook",
"id": "2f349f405c8a686187ccdaf986054f8d475111ec",
"size": "11... |
from pymongo import MongoClient
import os
import json
import yaml
import shutil
import locale
from fwissr.fwissr import Fwissr
def setup_global_conf():
# create additional file sources
first = 'mouarf.lol.json'
second = 'trop.mdr.json'
create_tmp_conf_file(first, {
'meu': 'ringue',
'... | {
"content_hash": "11d16b738996a38e06fd514a93cf4422",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 24.386861313868614,
"alnum_prop": 0.5800658485483389,
"repo_name": "fotonauts/fwissr-python",
"id": "a74de3c0161d95f468cebfa31a383783873533ba",
"siz... |
"""
FILE: sample_authentication.py
DESCRIPTION:
These samples demonstrate authenticating an attestation client instance and
an attestation administration client instance.
USAGE:
python sample_authentication.py
Set the environment variables with your own values before running the sample:
1) ATTEST... | {
"content_hash": "21799f5eff6cb81f3d525464d806d76d",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 105,
"avg_line_length": 38.098214285714285,
"alnum_prop": 0.6693227091633466,
"repo_name": "Azure/azure-sdk-for-python",
"id": "158977a293111a087afe3495c46a64312b674699",
... |
"Methods for creating, parsing, and dealing with XML and ElementTree objects."
import io
import sys
import six
import types
from six import StringIO
from io import BytesIO
from lxml import etree
# In case issues come up with XML generation/parsing
# make sure you have the ElementTree v1.2.7+ lib as
# well as lxml v3... | {
"content_hash": "1415fe7f4a18ac7db8ffb99880a57b5a",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 176,
"avg_line_length": 37.87128712871287,
"alnum_prop": 0.6569934640522875,
"repo_name": "leopoul/ncclient",
"id": "91bc0ab3bb99d922561b13274c587b2b36020e4b",
"size": "82... |
import socket, struct, sys, types
from py_interface import erl_term
from pyubf_py_interface import to_py_interface, from_py_interface
from pyubf import Atom, Integer
class SocketError(Exception):
pass
class EBFError(Exception):
pass
class Socket:
def __init__(self,host=socket.gethostname(), port=7580):
... | {
"content_hash": "504e82913d81388f2d57f36c37eef627",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 118,
"avg_line_length": 32.37556561085973,
"alnum_prop": 0.5618448637316562,
"repo_name": "ubf/ubf",
"id": "2bc5bebe325b1498911f2f0cfb2b18c9100fa390",
"size": "7220",
"b... |
"""Defines protocol specifications and messages."""
import importlib
import logging
from google.protobuf import message
from google.protobuf import reflection
import stl.base # pylint: disable=g-bad-import-order
import stl.lib # pylint: disable=g-bad-import-order
import stl.levenshtein # pylint: disable=g-bad-impo... | {
"content_hash": "e525fbf08457b2fa29c4921f041ed44e",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 128,
"avg_line_length": 35.801886792452834,
"alnum_prop": 0.6357707509881423,
"repo_name": "google/sprockets",
"id": "dd8143bb5f7f9eab3a25665c5b764971cf862073",
"size": "1... |
'''
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()", which has length = 2.
Another example is ")()())", where the longest valid parentheses substring is "()()", which has len... | {
"content_hash": "ebccd8561588bfe9ecf3c01bed7d282a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 132,
"avg_line_length": 29.753623188405797,
"alnum_prop": 0.4378957622990745,
"repo_name": "shub0/algorithm-data-structure",
"id": "8b16054627e3fac2b6b317c3b303dee08be08198",... |
import webbrowser
webbrowser.open("http://www.w3.org/TR/SVG11/")
| {
"content_hash": "88cdc0ac3a8abb587183299177338228",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 46,
"avg_line_length": 32.5,
"alnum_prop": 0.7538461538461538,
"repo_name": "NirBenTalLab/proorigami-cde-package",
"id": "9ea131e4bd5b2d5022968fef15f61191407add8b",
"size": ... |
import configparser
import json
import logging
import os
import re
import tempfile
import time
import requests
from requests.auth import HTTPBasicAuth
try:
import urllib3
except ImportError:
from requests.packages import urllib3
try:
import http.client as http_client
except ImportError:
# Python 2
... | {
"content_hash": "ebedb5680f9801215fdefec17bcd86cf",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 125,
"avg_line_length": 36.98529411764706,
"alnum_prop": 0.6172564612326044,
"repo_name": "catalogicsoftware/ecxclient",
"id": "0df780762c505ce17477f4f42f56570e613ea236",
... |
import unittest
import time
import eventlet
import mock
from contextlib import contextmanager
from threading import Thread
from test.unit import FakeLogger
from swift.common.middleware import ratelimit
from swift.proxy.controllers.base import get_container_memcache_key, \
headers_to_container_info
from swift.commo... | {
"content_hash": "6939e707c8e47909ec14c0d978612325",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 79,
"avg_line_length": 39.350819672131145,
"alnum_prop": 0.5489085152474588,
"repo_name": "heemanshu/swift_juno",
"id": "12940eac85fbbe8912d99d1ecfa56f50a0fa4c7a",
"size":... |
__usage__ = """
To run tests locally:
python tests/test_arpack.py [-l<int>] [-v<int>]
"""
import threading
import itertools
import numpy as np
from numpy.testing import assert_allclose, assert_equal, suppress_warnings
from pytest import raises as assert_raises
import pytest
from numpy import dot, conj, random
fr... | {
"content_hash": "08157a4ac49e2dd9fb56fc5faf53ef9f",
"timestamp": "",
"source": "github",
"line_count": 711,
"max_line_length": 85,
"avg_line_length": 32.970464135021096,
"alnum_prop": 0.5418906236669226,
"repo_name": "e-q/scipy",
"id": "b45963cead79387433cce4e944b43dcc6e7404de",
"size": "23442",
... |
"""
Copyright 2015-2017 Paderborn University
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | {
"content_hash": "770228d85756d9e7dc91c6bf8e3e402c",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 104,
"avg_line_length": 35.10077519379845,
"alnum_prop": 0.5987190812720848,
"repo_name": "sonata-nfv/son-tests",
"id": "9db09b15e2bca03cf8f4bc0db1664b55f7c380f4",
"size":... |
"""
Algorithms for solving Parametric Risch Differential Equations.
The methods used for solving Parametric Risch Differential Equations parallel
those for solving Risch Differential Equations. See the outline in the
docstring of rde.py for more information.
The Parametric Risch Differential Equation problem is, giv... | {
"content_hash": "e28b9b5c66ad1e47b20221bac2d1beae",
"timestamp": "",
"source": "github",
"line_count": 1273,
"max_line_length": 110,
"avg_line_length": 40.180675569520815,
"alnum_prop": 0.5523949169110459,
"repo_name": "kaushik94/sympy",
"id": "d1b130cdf33782e411ebef4753c38d10fa26581b",
"size": "5... |
from poppy.model.helpers import provider_details
def load_from_json(json_data):
access_urls = json_data.get("access_urls")
error_info = json_data.get("error_info", )
provider_service_id = json_data.get("id")
status = json_data.get("status")
return provider_details.ProviderDetail(
provider_... | {
"content_hash": "192b8f49cf803385d7dc52ab4d432c55",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 33.76923076923077,
"alnum_prop": 0.6765375854214123,
"repo_name": "obulpathi/poppy",
"id": "55f21cb8ce8b32f4845d50ea4699ebd39a353bf3",
"size": "1024"... |
from django.apps import AppConfig
class ResourceMgtConfig(AppConfig):
name = 'tbpc.resource_mgt'
| {
"content_hash": "d43149e649ddf8ba8aebb0f9d8b9ffb1",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 35,
"avg_line_length": 20.6,
"alnum_prop": 0.7669902912621359,
"repo_name": "mpdevilleres/tbpc_app",
"id": "d6ab6a84dc235c281a518b08ad2b978ef1a5c5e4",
"size": "103",
"bina... |
from django.urls import path
from web.backend import views
from django.views.decorators.csrf import csrf_exempt
app_name = "backend"
urlpatterns = [
path('', views.index, name='index'),
# task log
path("tasklog/<int:task_id>", views.tasklog, name="tasklog"),
# task debug log
path("debuglog/<int:... | {
"content_hash": "c88637f0c4322150363754eddd74c928",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 27.9,
"alnum_prop": 0.6810035842293907,
"repo_name": "LoRexxar/Cobra-W",
"id": "7a4686f6153a6cfe80934eb92ba66bc5315c3546",
"size": "709",
"binary":... |
import sys
import os
import re
import subprocess
from setuptools import setup, find_packages, Command
from distutils.command.build import build as BuildCommand
from setuptools.command.install import install as InstallCommand
from distutils.command.clean import clean as CleanCommand
from setuptools.command.test import ... | {
"content_hash": "cea34ae7325a096226a06855b1b6e8bc",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 80,
"avg_line_length": 27.307339449541285,
"alnum_prop": 0.5948261380816395,
"repo_name": "4degrees/riffle",
"id": "917cef98c5b350c9f71eb31c8292d1833a5120fc",
"size": "605... |
"""
Helper module for ELMR version information
"""
##########################################################################
## Versioning
##########################################################################
__version_info__ = {
'major': 0,
'minor': 4,
'micro': 5,
'releaselevel': 'final',
'... | {
"content_hash": "401836139edba51468f5bd782f3bfdb6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 29.75862068965517,
"alnum_prop": 0.44380069524913096,
"repo_name": "bbengfort/jobs-report",
"id": "db8bfc93f03ab9622fb6b83b0de3625587105f75",
"size":... |
"""This is part of [pyspaces](https://github.com/Friz-zy/pyspaces)
License: MIT or BSD or Apache 2.0
Copyright (c) 2014 Filipp Kucheryavy aka Frizzy <filipp.s.frizzy@gmail.com>
"""
import os
import sys
import errno
from .libc import *
from signal import SIGKILL, SIGCHLD
try:
from multiprocessing.forking import... | {
"content_hash": "2edc6997485d7f342746ca1a2a227cf2",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 86,
"avg_line_length": 34.284444444444446,
"alnum_prop": 0.5961887477313974,
"repo_name": "Friz-zy/pyspaces",
"id": "2e30a78e0eb7c4a2e9d1958b1521c4d11510eb2b",
"size": "77... |
__author__ = 'tmkasun'
from pyspark.context import SparkContext, SparkConf
from pyspark.mllib.clustering import KMeans
from matplotlib import pyplot
from conf.configurations import project
from libs.analyser import SparkAnalyser
def main():
# Setup Spark context by setting application name and running mode, `... | {
"content_hash": "4dd0a816e059f89ce12d022021c15539",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 108,
"avg_line_length": 34.75806451612903,
"alnum_prop": 0.7118329466357308,
"repo_name": "tmkasun/bigdata_spark",
"id": "692cb25b55512c8b856663b07725c5523ad87922",
"size":... |
from __future__ import absolute_import
version = (0, 3, 10)
from .client import VimeoClient
from . import exceptions
| {
"content_hash": "335332270b8d374a11d984bf677f0343",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 19.833333333333332,
"alnum_prop": 0.7394957983193278,
"repo_name": "gabrielgisoldo/vimeo.py",
"id": "08d5bb86ba2abbd1570b6bd60c9e1a2415412118",
"size"... |
import os
import unittest
import numpy
import time
import paddle
import paddle.fluid as fluid
BATCH_SIZE = 64
def convolutional_neural_network(use_py_reader):
with fluid.unique_name.guard():
img = fluid.layers.data(name='img', shape=[1, 28, 28], dtype='float32')
label = fluid.layers.data(name='l... | {
"content_hash": "be5508326394a56c8d16b93481ffd8b8",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 79,
"avg_line_length": 31.29953917050691,
"alnum_prop": 0.5385747938751473,
"repo_name": "luotao1/Paddle",
"id": "41fc17187093ce6f63d61981173e9a9636f8d721",
"size": "7405"... |
"""
auto save window geometry
Tested environment:
Mac OS X 10.6.8
http://doc.qt.nokia.com/latest/qdesktopwidget.html
http://www.pyside.org/docs/pyside/PySide/QtGui/QWidget.html
"""
import json
import os
import sys
import web
try:
from PySide import QtCore
from PySide import QtGui
except ImportError:
... | {
"content_hash": "f11feaa69a8774878836de6aab6f27c1",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 84,
"avg_line_length": 24.031007751937985,
"alnum_prop": 0.5441935483870968,
"repo_name": "alexlib/Qt-Python-Binding-Examples",
"id": "3f04f6013ca3dcfc4856dee24db305cc7dcdcd... |
"""Date range parser."""
import datetime
import dateutil.parser
import re
import operator
__all__ = ('date_in_range',)
CLAUSE = re.compile('(year|month|day|hour|minute|second|weekday|isoweekday)?'
' ?(==|!=|<=|>=|<|>) ?(.*)')
OPERATORS = {
'==': operator.eq,
'!=': operator.ne,
'<=': o... | {
"content_hash": "948f9869746824f81d7fec0f60bad5a7",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 86,
"avg_line_length": 33.74193548387097,
"alnum_prop": 0.5697896749521989,
"repo_name": "getnikola/nikola",
"id": "4e9566c09cd6166abc62037a8711d6186c538293",
"size": "3749... |
class GlobalConfig(object):
def __init__(self):
self.prompt_until_exit = True # If True in verbose the user will be prompted until s/he chooses to exit
self.article_limit = 10 # By default only 10 stories will be displayed, future version will allow this to be set by CLI argument
self.head... | {
"content_hash": "9bfdc695bfaf85ad931dce5f59112115",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 136,
"avg_line_length": 44.3125,
"alnum_prop": 0.6629055007052186,
"repo_name": "haaspt/whatsnew",
"id": "3dac073d9bbfe60fd4eda6b1c51fd2c8598678d1",
"size": "709",
"binar... |
from docfx_yaml import extension
import unittest
from parameterized import parameterized
from yaml import load, Loader
class TestGenerate(unittest.TestCase):
def test_find_unique_name(self):
entries = {}
# Disambiguate with unique entries.
entry1 = "google.cloud.aiplatform.v1.schema.pre... | {
"content_hash": "1181772448c8cd08042c0f6461f2b78c",
"timestamp": "",
"source": "github",
"line_count": 889,
"max_line_length": 203,
"avg_line_length": 36.36220472440945,
"alnum_prop": 0.5753572975313989,
"repo_name": "googleapis/sphinx-docfx-yaml",
"id": "ce5870bbfb379c3a69fda7cf7af409631344c774",
... |
import logging
import sys
from django.urls import reverse
from desktop.lib.exceptions import StructuredException
from desktop.lib.exceptions_renderable import PopupException
from desktop.lib.i18n import force_unicode, smart_str
from desktop.lib.rest.http_client import RestException
from notebook.connectors.base impo... | {
"content_hash": "e961dd165d22a6546f5f3ef48a4d2999",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 109,
"avg_line_length": 31.26153846153846,
"alnum_prop": 0.7386811023622047,
"repo_name": "kawamon/hue",
"id": "0d56af630f2c49ab0e3b5548394dc6fa655bdc50",
"size": "2824",
... |
import requests
from time import time
from shutil import copyfileobj
from multiprocessing import Pool
from urllib.parse import urlparse
import sys
import traceback
# Downloader accepts a crawler and uses it to
# download files.
class Downloader:
def __init__(self, base_dir):
self.base_dir = base_dir
#... | {
"content_hash": "1d2c188058f6e3997165d6f2eb4ea6c0",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 90,
"avg_line_length": 37.327586206896555,
"alnum_prop": 0.584757505773672,
"repo_name": "apoorv-kumar/PyThugLife",
"id": "4e3793678721c0af3743b5d8adf61a928975e9d4",
"size"... |
from exception import *
from constants import *
from utils import *
| {
"content_hash": "ce1fa563d1c19f718fee5b90949609d4",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 23,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.7794117647058824,
"repo_name": "kbandla/phoneypdf",
"id": "567ed815539fd173233fbde6425349b74fcb4462",
"size": "68"... |
import re
import sys
import json
import socket
from subprocess import check_output
from mpd import MPDClient
import humanize
def get_governor():
"""Get the current governor for cpu0, assuming all CPUs use the same."""
with open("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor") as fp:
return fp... | {
"content_hash": "36423717c2e0c81b00f7cc53b88a7716",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 123,
"avg_line_length": 28.321070234113712,
"alnum_prop": 0.5520784128483703,
"repo_name": "simu/dotfiles",
"id": "af04b4a0958a5119fe6cdf7c86808e1dc9603fe3",
"size": "9515... |
import os
import sys
sys.path.append(os.path.abspath('_themes'))
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0... | {
"content_hash": "986a01b5caf444174b9dd1ce9f72a56d",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 80,
"avg_line_length": 28.33228840125392,
"alnum_prop": 0.6866563398982075,
"repo_name": "ChrisBeaumont/smother",
"id": "3aa0e162c82148e704565d7be87031dde858548a",
"size":... |
"""Use the Doctest plugin with --with-doctest or the NOSE_WITH_DOCTEST
environment variable to enable collection and execution of doctests. doctest_
tests are usually included in the tested package, not grouped into packages or
modules of their own. For this reason, nose will try to detect and run doctest
tests only in... | {
"content_hash": "b90b2f55c433e47eda7233ad8a761b41",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 89,
"avg_line_length": 37.77272727272727,
"alnum_prop": 0.5971994311344492,
"repo_name": "santisiri/popego",
"id": "8fe9854b73f292caa2fd306d0794c550db8c6a66",
"size": "914... |
import sys
import os
# Following function code snippet was found on StackOverflow (with a change to lower
# camel-case on the variable names):
# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
def find_executable(program):
def is_exe(fPath):
return os.path.isfile(fPath) and ... | {
"content_hash": "2cf6a9319cc987b884af483834c404a4",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 86,
"avg_line_length": 31.705263157894738,
"alnum_prop": 0.5773572377158035,
"repo_name": "Radamanthe/VulkanSamples",
"id": "a86329f8b12ae8b30da6bf9736c428924b1eae47",
"siz... |
"""Operator Entity."""
import geom
import util
import errors
from entity import Entity
from stop import Stop
from route import Route
def sorted_onestop(entities):
return sorted(entities, key=lambda x:x.onestop())
class Operator(Entity):
"""Transitland Operator Entity."""
onestop_type = 'o'
def init(self, **d... | {
"content_hash": "bbc5116378d44fc28a2a5accf830b9bf",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 70,
"avg_line_length": 26.77227722772277,
"alnum_prop": 0.6042899408284024,
"repo_name": "srthurman/transitland-python-client",
"id": "9d02c688827d244371c78dd2a0cc8c148e3fad... |
"""Unit tests for test/portage module."""
from __future__ import print_function
import pytest # pylint: disable=import-error
import chromite as cr
# Pytest's method of declaring fixtures causes Pylint to complain about
# redefined outer names.
# pylint: disable=redefined-outer-name
_OVERLAY_STACK_PARAMS = list(ra... | {
"content_hash": "843df700b2094f4947ab021442cee8f3",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 80,
"avg_line_length": 30.775862068965516,
"alnum_prop": 0.7198879551820728,
"repo_name": "endlessm/chromium-browser",
"id": "56851f185d067fcf9c3cc8b0cd13146472aa2890",
"si... |
from django import forms
from django.core.exceptions import ValidationError
from wye.profiles.models import UserType
from . import models
class RegionalLeadForm(forms.ModelForm):
class Meta:
model = models.RegionalLead
exclude = ()
def clean(self):
error_message = []
if (se... | {
"content_hash": "c7fcd4de8ea27c7d5b0c434ea1487cbb",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 28.617021276595743,
"alnum_prop": 0.5910780669144982,
"repo_name": "DESHRAJ/wye",
"id": "96f74e8b6f1ebb99fcb65e80b466131129ba8797",
"size": "1345",
... |
__author__ = 'oshikiri'
__email__ = 't.oshikiri.0137@gmail.com'
__date__ = '2015-02-19'
import os
import sys
from ShiriMas import *
if __name__ == '__main__':
db_path = './db/shiritori-history.sqlite3'
table_name = 'history'
sbot = ShiriMas('shiritori-master', db_path, table_name)
## Slackでの直近のメ... | {
"content_hash": "d6aa835e29c9a66f34ac0dcbb32651ac",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 66,
"avg_line_length": 25.757575757575758,
"alnum_prop": 0.6741176470588235,
"repo_name": "oshikiri/shirimas",
"id": "db683f0b1bc35dd7573ec03d2223c8d8a23482e5",
"size": "98... |
"""
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_verify_views: False
To u... | {
"content_hash": "2990bc245400a12510b56f7077cb6450",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 107,
"avg_line_length": 25.77683615819209,
"alnum_prop": 0.5842191780821918,
"repo_name": "saltstack/salt",
"id": "c39edff790a8ebd10ef07c0332943efdc5011d7c",
"size": "9125... |
import uuid
import logging
import time
from heat.engine import resource
from heat.common import exception as HeatException
from avi_api import ApiSession
from avi_api import ObjectNotFound
import avi_utils
# for python 2/3 compatibility
try:
basestring
except:
basestring = str
try:
# new way of importing ... | {
"content_hash": "0bf263388faa170be80f33238f39d62f",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 78,
"avg_line_length": 39.10803324099723,
"alnum_prop": 0.5050290409406432,
"repo_name": "avinetworks/avi-heat",
"id": "0caad831c0ee906d91611b7e1f10c5e4a06f04c9",
"size": ... |
import praw
import urllib2
from urlparse import urlparse
from bs4 import BeautifulSoup
from goose import Goose
from passcodes import (REDDIT_USERNAME,
REDDIT_PASSWORD)
TAG_LIST = {
'title':'title',
'link':'url',
'id':'srcid',
'guid':'srcid',
'published':'published',
'pu... | {
"content_hash": "2ef65bb4e61eb530d7e8aed866bbbcb5",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 29.4,
"alnum_prop": 0.5384227765180146,
"repo_name": "vivyly/parcellate",
"id": "8c5aea0a7bf3d2abec681b02896e4cc86fcd0ba5",
"size": "3969",
"binar... |
'''
FanFilm Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This ... | {
"content_hash": "81d79d1136673efb0196cf5b3b60c5ac",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 140,
"avg_line_length": 40.21739130434783,
"alnum_prop": 0.5661261261261261,
"repo_name": "mrknow/filmkodi",
"id": "63b28c0f1ffd89dc59fedfc6bf63342ca219c094",
"size": "2800... |
"""Defines several modules with classes for X12 message processing.
We have to disentangle two separate concepts.
- **Message Type**. This is the structure of the message.
The structure is defined by an :class:`X12.parse.Message` object. In addition
to defining the structure, a parser can also... | {
"content_hash": "24afe48ab565db5bacc7ae82d4fe56d1",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 125,
"avg_line_length": 39.70967741935484,
"alnum_prop": 0.7201462225832657,
"repo_name": "sbuss/TigerShark",
"id": "125c6caf00928f3120ead3bae9e7cc507ac9b0c8",
"size": "248... |
import os
from admin_scripts.tests import AdminScriptTestCase
from django.apps import apps
from django.core import management
from django.core.management import BaseCommand, CommandError, find_commands
from django.core.management.utils import find_command, popen_wrapper
from django.db import connection
from django.te... | {
"content_hash": "95f4245deacde4382c1c890b06d4db0e",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 104,
"avg_line_length": 40.053763440860216,
"alnum_prop": 0.6409395973154363,
"repo_name": "varunnaganathan/django",
"id": "2c19339ddc18d2a7ecd45a68b49309618a5a6aee",
"siz... |
"""Tests for ceviche_challenges.modes."""
from absl.testing import absltest
from ceviche import constants
from ceviche_challenges import defs
from ceviche_challenges import modes
import numpy as np
class ModesTest(absltest.TestCase):
def test_port(self):
"""Test the port definition."""
port = modes.Waveg... | {
"content_hash": "24974f3e8c8daf4d86ff133f15e59b23",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 80,
"avg_line_length": 27.554545454545455,
"alnum_prop": 0.6093698449356648,
"repo_name": "google/ceviche-challenges",
"id": "e733adde26b1875d7d972c849382918a4dff3190",
"s... |
import os
import sys
import methods
def is_active():
return True
def get_name():
return "Windows"
def can_build():
if (os.name=="nt"):
#building natively on windows!
if (os.getenv("VSINSTALLDIR")):
return True
else:
print("\nMSVC not detected, attempting Mingw.")
mingw32 = ""
mingw64 =... | {
"content_hash": "c2a3331f2ce3153f93ce0d217cff9234",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 305,
"avg_line_length": 34.21452145214521,
"alnum_prop": 0.6310408025465419,
"repo_name": "rollenrolm/godot",
"id": "0548b84cfa68a8e33cee026671e0304a335483a5",
"size": "13... |
import sys
from distutils.core import *
if 'setuptools' in sys.modules:
have_setuptools = True
from setuptools import setup as old_setup
# easy_install imports math, it may be picked up from cwd
from setuptools.command import easy_install
try:
# very old versions of setuptools don't have th... | {
"content_hash": "7a390337b3bdb1141f41cb586c5cc7c3",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 89,
"avg_line_length": 37.71238938053097,
"alnum_prop": 0.5705737416402675,
"repo_name": "illume/numpy3k",
"id": "8481640bdbe2040606fb03908c233359258d8da2",
"size": "8524"... |
#!/usr/bin/env python3
# Copyright 2022, gRPC Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | {
"content_hash": "061013529b2bd10046e411851ca8e273",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 103,
"avg_line_length": 31.14611872146119,
"alnum_prop": 0.6736548893124176,
"repo_name": "grpc/grpc-swift",
"id": "cc387515cc3e1fa4a508244965c564db0fca9ab5",
"size": "744... |
"""
Test that the breakpoint auto-continue flag works correctly.
"""
from __future__ import print_function
import os
import time
import re
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class BreakpointAutoContinue(TestBase):
mydir = TestBase.compute_mydir(__file_... | {
"content_hash": "7501db64d11bbe89e7c12ac167c5511e",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 98,
"avg_line_length": 37.54807692307692,
"alnum_prop": 0.6448143405889885,
"repo_name": "youtube/cobalt",
"id": "b5e38eec579371759262a7d02967d097d5de3e41",
"size": "3905"... |
import os
import time
import dominate
import sys
from dominate.tags import *
import json
import pandas as pd
# Profile. Profile has data in it that is then used in sign system
#
#
# In[2]:
valname = ('lasnam', 'signin', 'usercom', 'dayr', 'htmn')
# In[2]:
# In[3]:
for itzval in valname:
print itzval
... | {
"content_hash": "a35eaf59d2589bf912be191e1c9fc459",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 192,
"avg_line_length": 15.178571428571429,
"alnum_prop": 0.6264253393665158,
"repo_name": "wcmckee/wcmckee",
"id": "c1b4378b9e667ca52cc4dc18b515f74594619335",
"size": "43... |
with open('input', 'r') as f:
data = f.read()
cur_floor = 0
floor_map = {}
for pos, move in enumerate(data):
if move == '(':
cur_floor = cur_floor + 1
if move == ')':
cur_floor = cur_floor - 1
floor_map[pos] = cur_floor
first_underground_pos = -1
for pos, floor in floor_map.iteritems... | {
"content_hash": "2646057a1616ebc3781313e3a33ab9d5",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 24.307692307692307,
"alnum_prop": 0.629746835443038,
"repo_name": "jatowler/adventofcode-2015",
"id": "6dcfa09b949b82f2029cd78c71aeffafdc087e0e",
"si... |
import os
from setuptools import setup, find_packages
def prerelease_local_scheme(version):
"""Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a
pre-release in which ca... | {
"content_hash": "e4e5e852e52127d4b533d4194617c888",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 89,
"avg_line_length": 27.97,
"alnum_prop": 0.585269932070075,
"repo_name": "manthey/girder",
"id": "4daf1f9e7b571d7193f4e8fb32e579eb75220eed",
"size": "2821",
"binary":... |
from django.db import models
class Tag(models.Model):
name = models.CharField(max_length=30)
def __str__(self):
return self.name
class Content(models.Model):
description = models.CharField(max_length=100)
image = models.ImageField(upload_to='images')
tags = models.ManyToManyField('T... | {
"content_hash": "ff9e78a60e099a4135c27ffa82b14605",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 64,
"avg_line_length": 25.941176470588236,
"alnum_prop": 0.6621315192743764,
"repo_name": "imiric/test-widget",
"id": "f30a207176d71654b32d380559dea2673bc3c9de",
"size": "4... |
import config
from metodos import *
from mensagens import *
adms = config.adms
def ban(msg):
if msg['text'] == '/ban':
from_id = msg['from']['id']
chat_id = msg['chat']['id']
if from_id in adms:
try:
reply_id = msg['reply_to_message']['from']['id']
... | {
"content_hash": "077a8642406a1536aa0d2b1cd61b7a67",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 134,
"avg_line_length": 29,
"alnum_prop": 0.4670072371221797,
"repo_name": "francis-taylor/Timotty-Master",
"id": "9cba1505fccc77c1a17f6854e8ee5d401fbab785",
"size": "2373"... |
from ._models_py3 import ApiError
from ._models_py3 import ApiErrorBase
from ._models_py3 import CommunityGallery
from ._models_py3 import CommunityGalleryImage
from ._models_py3 import CommunityGalleryImageList
from ._models_py3 import CommunityGalleryImageVersion
from ._models_py3 import CommunityGalleryImageVersionL... | {
"content_hash": "0deecd6ce5456dcf88f2a38879f30c35",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 89,
"avg_line_length": 40.318385650224215,
"alnum_prop": 0.8064731398064732,
"repo_name": "Azure/azure-sdk-for-python",
"id": "164dff985f0feb390a870faa0f0146cd622f8113",
"... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
import textwrap
from contextlib import closing
from xml.etree import ElementTree
from pants.backend.jvm.subsystems.scala_platform import ScalaPlat... | {
"content_hash": "131ec1785b79bd2236b71d5a571c470d",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 101,
"avg_line_length": 42.493788819875775,
"alnum_prop": 0.6263977197982898,
"repo_name": "sameerparekh/pants",
"id": "64eb4a04a0d24cc32603f6b2a2e62fc15f514904",
"size": ... |
from .test_cases import * # noqa
| {
"content_hash": "296b68269c9cd27fe1ceb5662f3befaf",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.6764705882352942,
"repo_name": "mikeurbanski/django-inlines",
"id": "c644cdf9055597803c584cead9c4f8ac89569af8",
"size": "34",
"b... |
def arithmetic_series(start, inc):
while start < 100:
yield start
start+=inc
series = arithmetic_series(5, 10)
print(series)
nlkmklklkngjhbbjhjhbkhbhbkbnjknnjlnknlnkjbjhbhbbbbkbgbcfvcvvnbvvmnvmbbnbnbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb = 9
if '1'==1:
print("She said "Yes"")
el... | {
"content_hash": "828f77d86b9cc783ae5bbc20fc745b3d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 131,
"avg_line_length": 23.416666666666668,
"alnum_prop": 0.7455516014234875,
"repo_name": "balajithangamani/LearnPy",
"id": "30c1a0a866f0ea86045cc283edd6aadf49574519",
"si... |
from __future__ import with_statement
from contextlib import contextmanager
import os,sys
PSSE_LOCATION = r"C:\Program Files (x86)\PTI\PSSE32\PSSBIN"
sys.path.append(PSSE_LOCATION)
os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION
import psspy # importing python
from psspy import _i,_f # importing... | {
"content_hash": "c2e7e16a4a5697b5bcce143a2950c87f",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 108,
"avg_line_length": 29.426966292134832,
"alnum_prop": 0.637266132111493,
"repo_name": "GridProtectionAlliance/openECA",
"id": "2e9bd25ade84d05169bde643d5e1f2381688106a",
... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('threshold_value', '0005_auto_20141114_1204'),
]
operations = [
migrations.AlterField(
... | {
"content_hash": "a48be74ec82a0113ec4fbf171e9196be",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 112,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.6372007366482505,
"repo_name": "sigurdsa/angelika-api",
"id": "cdf29a3ce57d68ea4c2488ba06288131fc3faa13",
"size"... |
from __future__ import division
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from operator import itemgetter
import os
import pickle
import json
# main database
db = create_engine('sqlite:///data/processed.db')
def rank_causes(tb, var, pats, N = 3, top = 5):
# tool: check if the str... | {
"content_hash": "e177d2eb11647dc5c2f9ab7c6e6bb639",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 68,
"avg_line_length": 35.67910447761194,
"alnum_prop": 0.4666387784982221,
"repo_name": "lzlarryli/limelight",
"id": "571359d783cf5a084d73a9dd19ddd7e4dd09418c",
"size": "... |
"""API for the glance service."""
from django import forms
from django.views.decorators.csrf import csrf_exempt
from django.views import generic
from openstack_dashboard import api
from openstack_dashboard.api.rest import urls
from openstack_dashboard.api.rest import utils as rest_utils
CLIENT_KEYWORDS = {'resource_... | {
"content_hash": "a4ab688c76c9251635488240c4c173c7",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 164,
"avg_line_length": 36.89250814332247,
"alnum_prop": 0.6356171640473247,
"repo_name": "openstack/horizon",
"id": "f27bda19ac32e57115594610e80b37a93444f119",
"size": "1... |
import math
import re
import tornado.gen
from thumbor.ext.filters import _alpha
from thumbor.filters import BaseFilter, filter_method
from thumbor.loaders import LoaderResult
from thumbor.utils import logger
class Filter(BaseFilter):
@staticmethod
def detect_and_get_ratio_position(pos, length):
matc... | {
"content_hash": "79cf9003ea1d6cb22c04a3e172552e44",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 96,
"avg_line_length": 37.54696132596685,
"alnum_prop": 0.5286933490288405,
"repo_name": "scorphus/thumbor",
"id": "eb566efdbf6e96a9d602ef19efcdec06751f8e56",
"size": "708... |
__author__ = 'Seqian Wang'
# A class for each scan session
class ScanSession:
def __init__(self, study, rid, scan_type, scan_date, scan_time,
s_identifier, i_identifier, download_folder, raw_folder, file_type, moved=0):
self.study = study
self.rid = rid
self.scan_type = s... | {
"content_hash": "65bf90de788a14e94bcc84cfadab4b58",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 100,
"avg_line_length": 41.13461538461539,
"alnum_prop": 0.5493221131369799,
"repo_name": "sulantha2006/Processing_Pipeline",
"id": "56da6ddb71720628e086f89a5bf52ccee47be6f0"... |
'''
python word2vec_helpers.py input_file output_model_file output_vector_file
'''
# import modules & set up logging
import os
import sys
import logging
import multiprocessing
import time
import json
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
def output_vocab... | {
"content_hash": "1eaca464e7a0899cebbec3b1817c784b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 140,
"avg_line_length": 34.11538461538461,
"alnum_prop": 0.6388575723412251,
"repo_name": "paradise6/DetectMaliciousURL",
"id": "183bd1b15680141f988c23517270e12c69dfab8f",
... |
import simplejson
import save_csv
import ratelimit
import time
import raw
import urllib
import os
import oauth_req
def getStream(raw_urls_filename, dupes_filename, author_urls_dir, raw_status_filename = ''):
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Str... | {
"content_hash": "cd964512fd98d31aa5a33fd6e0fec829",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 138,
"avg_line_length": 39.06217616580311,
"alnum_prop": 0.5052394216739621,
"repo_name": "coolster1/dark-rt-toolkit",
"id": "915e620d42f0a5ad17d09ccfce47bcf1b0f04ab2",
"s... |
import pprint
from celery import Celery
from .camera import CameraFactory
from .state import State
def noop(x):
pass
class TaskMonitor(object):
def __init__(self, broker=None, camera='celery_cloudwatch.PrintCamera',
verbose=False, config=None):
self.broker = broker
self.c... | {
"content_hash": "0e9a3718447dc282a635f5f155b047ee",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 91,
"avg_line_length": 30.725490196078432,
"alnum_prop": 0.5730695596681558,
"repo_name": "3stack-software/celery-cloudwatch",
"id": "7c83b0fdb9a9dd3dd0e5e6291eca0e4fab68943c... |
from contextlib import contextmanager
import pickle
import sqlalchemy as tsa
from sqlalchemy import ARRAY
from sqlalchemy import bindparam
from sqlalchemy import BLANK_SCHEMA
from sqlalchemy import Boolean
from sqlalchemy import CheckConstraint
from sqlalchemy import Column
from sqlalchemy import column
from sqlalchem... | {
"content_hash": "f61c2e8708aaef4cc69cedcf4a4b1d19",
"timestamp": "",
"source": "github",
"line_count": 5548,
"max_line_length": 79,
"avg_line_length": 31.78226387887527,
"alnum_prop": 0.518374846876276,
"repo_name": "monetate/sqlalchemy",
"id": "08502b8bbebbc4ffe3050466f39f2e675d045cbf",
"size": "... |
import logging
from idl.matter_idl_types import *
from typing import Optional, Union, List
from .context import Context, IdlPostProcessor
from .parsing import ParseInt, AttrsToAccessPrivilege, AttrsToAttribute
from .base import HandledDepth, BaseHandler
class ClusterNameHandler(BaseHandler):
"""Handles /configu... | {
"content_hash": "5c72e7fe76671138d644fa2e55ac0edf",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 118,
"avg_line_length": 39.07333333333333,
"alnum_prop": 0.5937553318546324,
"repo_name": "project-chip/connectedhomeip",
"id": "6048b271ecf3ace19e88cb159cadf8779939efa1",
... |
"""
Various utilities
"""
from django.conf import settings
from django.contrib.sites.models import Site
from django.template import Variable, TemplateSyntaxError, VariableDoesNotExist
def get_site_metas(with_static=False, with_media=False, extra={}):
"""
Return metas from the current *Site* and settings
... | {
"content_hash": "db94f842c8c10aade1bbccc18494754b",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 113,
"avg_line_length": 33.577777777777776,
"alnum_prop": 0.6472534745201853,
"repo_name": "sveetch/DjangoSveetchies",
"id": "f736e224f0c062ebbdcd4188cee371fe068bd5b7",
"si... |
__author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother"
__copyright__ = "Copyright 2008, The Moderna Project"
__credits__ = ["Janusz Bujnicki"]
__license__ = "GPL"
__maintainer__ = "Magdalena Rother"
__email__ = "mmusiel@genesilico.pl"
__status__ = "Production"
"""
A procedure for calculating stacking of RNA nu... | {
"content_hash": "ff828914da79b44a75572d4ab49ee480",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 81,
"avg_line_length": 37.04651162790697,
"alnum_prop": 0.5989956057752668,
"repo_name": "m4rx9/rna-pdb-tools",
"id": "4dc6aeab50d1922cda413ae558b2ca96eb63e166",
"size": "... |
import time
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_jinja2
from django.urls import resolve
from django.views.generic import RedirectView, TemplateView, Vi... | {
"content_hash": "5cf211a82c775c1482fdc019d17f09a6",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 114,
"avg_line_length": 37.60677966101695,
"alnum_prop": 0.6315575987020011,
"repo_name": "freakboy3742/django",
"id": "5872ecf3db8d40609543da50e4f0870af84c32d6",
"size": ... |
from sqlalchemy import func
from flask import Blueprint, render_template, g, redirect, url_for, \
flash, request, jsonify, make_response
from flask.ext.login import login_required
from flask.ext.babel import gettext
from dataviva import db
from datetime import datetime
# models
from dataviva.account.models import U... | {
"content_hash": "d9e6e3838c861a7f01d5a61dc6196b22",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 137,
"avg_line_length": 29.196531791907514,
"alnum_prop": 0.6498713126113641,
"repo_name": "dogobox/datavivamaster",
"id": "1ac05a00e5538d2f6d43ddbf57d43e4c27c29dbe",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.