text
stringlengths
4
1.02M
meta
dict
import httplib import io import json import logging import traceback from datetime import datetime, date import dateutil.tz import tornado.ioloop import tornado.web from ConfigParser import ConfigParser from decimal import Decimal from sqlalchemy import create_engine class JsonDumper(json.JSONEncoder): def default...
{ "content_hash": "3532aa3dab4d77ca4abcaf55e8793ca3", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 636, "avg_line_length": 31.875, "alnum_prop": 0.6241940844134264, "repo_name": "daijingjing/wordpress_python_api", "id": "5a8dea0e81d8fa5843fadb1977ce1c173add188c", "size"...
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def index(request): return HttpResponse("Tool index api..") def add_tool(request): return HttpResponse("Add tool api..") def update_tool(request): return HttpResponse("Update tool api..") def delete_tool(request):...
{ "content_hash": "9df85e5316c5913c21ece6e7ca18acd4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 42, "avg_line_length": 22.954545454545453, "alnum_prop": 0.7524752475247525, "repo_name": "adityabyreddy/opensas", "id": "49b92b4dee3f3e9e4f94eaaad6d4c1b8441de2ce", "size":...
""" WSGI config for smsuela project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from dj_static import Cling os.en...
{ "content_hash": "c5a506bff5ad5b2aa8908c2d4b04c0d3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 24.38888888888889, "alnum_prop": 0.7744874715261959, "repo_name": "rafaelmv/smsuela", "id": "201454f19e35609718897a9773fbd34a39ee3581", "size": "439"...
import sys def split_pattern(pattern): result = [] group = '' is_group = False for ch in pattern: if ch == '(': group = '' is_group = True elif ch == ')': result.append(group[:]) is_group = False else: if is_group: grou...
{ "content_hash": "b32ab0a4b3aeefecb7bc4d7b49ce9fbb", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 74, "avg_line_length": 25.857142857142858, "alnum_prop": 0.5490331491712708, "repo_name": "maku77/contest", "id": "bbe95cdefd078e17e8fc5d9f78d72187355b3725", "size": "1646"...
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
{ "content_hash": "5b8b01e72f97ea07b5cdcdf6ebe017d5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 76, "avg_line_length": 30.652173913043477, "alnum_prop": 0.6633569739952718, "repo_name": "riadnassiffe/Simulator", "id": "9207c8e4b7fe8d979b3a400c7a99c191e21efca0", "size"...
import numpy as np from onnx.defs import onnx_opset_version from onnx.reference.op_run import OpRun def _batchnorm_test_mode( x: np.ndarray, s: np.ndarray, bias: np.ndarray, mean: np.ndarray, var: np.ndarray, epsilon: float = 1e-5, ) -> np.ndarray: dims_x = len(x.shape) dim_ones = (1,...
{ "content_hash": "f36e6b599e7646fb34966194186e0aa0", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 119, "avg_line_length": 32.36904761904762, "alnum_prop": 0.6090474439132034, "repo_name": "onnx/onnx", "id": "1e62384cec6b2b70ddd4338d2ec74077eac7a9bf", "size": "2794", "...
from django.template import Context, Template from . import WPTestCase from ..factories import WPSiteFactory, WPPostFactory class WidgetTestCase(WPTestCase): def test_wjidget_missing_site_raises_exception(self): t = Template('{% load wjidget from wjordpress %}{% wjidget "foo" %}') # TODO Improper...
{ "content_hash": "8455af78aca9b58510eb75d515f336bc", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 36.372093023255815, "alnum_prop": 0.5505115089514067, "repo_name": "texastribune/wjordpress", "id": "53cb0a3d92e6185aae8bac44964512dce6f77ca0", "size...
import json import re from service import * class GoogleService(Service): environmentSchema = { 'type': 'object', 'properties': { 'kind': {'type': 'string', 'pattern': '^Google$'}, 'project': {'type': 'string'}, 'region': {'type': 'string'}, 'servic...
{ "content_hash": "c9e05878d1698f32f9820ca4d273b6a2", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 121, "avg_line_length": 41.14869888475837, "alnum_prop": 0.38693648929442587, "repo_name": "iqstack/jsonlang", "id": "029c4f163ce1e8af90cf75651895f212c330a31e", "size": "1...
"""Test Qiskit's QuantumCircuit class.""" from ddt import ddt, data import numpy as np from qiskit import BasicAer from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit from qiskit import execute from qiskit.circuit import Gate, Instruction, Parameter, Measure from qiskit.circuit.bit import Bit from qi...
{ "content_hash": "0389f07c59f6971c2a2c1ef12012f7a3", "timestamp": "", "source": "github", "line_count": 1261, "max_line_length": 100, "avg_line_length": 37.47422680412371, "alnum_prop": 0.6025605756004656, "repo_name": "QISKit/qiskit-sdk-py", "id": "426683e62a1ac6dd660e9ed5b3fbaf5a25e54a3e", "size"...
import sys import os import os.path import codecs import cgi from plasTeX.DOM import Node from plasTeX.Base import Command from plasTeX.Base import DimenCommand from plasTeX.Logging import getLogger import plasTeX.Packages.graphics as graphics log = getLogger() status = getLogger('status') # Ugly hack: assume textwid...
{ "content_hash": "bd18593a2b6998dac2c92ac204515276", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 87, "avg_line_length": 32.689655172413794, "alnum_prop": 0.6151898734177215, "repo_name": "godmar/problemtools", "id": "f66460d8974521849872bc39a0193897c67b5911", "size": ...
"""Classes defining structures and unions.""" import abc import collections import collections.abc import copy import io import typing import warnings from typing import Any from typing import BinaryIO from typing import Dict from typing import Iterator from typing import List from typing import Mapping from typing im...
{ "content_hash": "79fc0455596ee82ede53513e189eba66", "timestamp": "", "source": "github", "line_count": 766, "max_line_length": 88, "avg_line_length": 37.40208877284595, "alnum_prop": 0.6154275741710297, "repo_name": "dargueta/binobj", "id": "fc82737b9a045747aefa5cf148d057e6c0cd8734", "size": "2865...
''' Created on Nov 3, 2016 @author: Admin ''' from WidgetFactory import * def create_window(factory): window = factory.make_diagram(30, 7) return window ms_window = create_window(MSWindowWidgetFactory()) macOSX_window = create_window(MacOSXWindowWidgetFactory())
{ "content_hash": "261ec2c11aa1c9454b1d97b588a8ac3f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 60, "avg_line_length": 19.857142857142858, "alnum_prop": 0.7266187050359713, "repo_name": "lucafon/DesignPatterns", "id": "1f25b7cb8acfe6be7385ceb9a4fe37303766eb46", "size"...
from django.core.urlresolvers import reverse from django import http from mox import IsA # noqa from openstack_dashboard.api import cinder from openstack_dashboard.test import helpers as test INDEX_URL = reverse('horizon:admin:volumes:index') class VolumeSnapshotsViewTests(test.BaseAdminViewTests): @test.crea...
{ "content_hash": "9af90b1f2399cdea6a701fd3c120b615", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 73, "avg_line_length": 38.260416666666664, "alnum_prop": 0.5973318812959434, "repo_name": "jumpstarter-io/horizon", "id": "84a5abc11171a1e75d408b4c81e78f182fb9ca59", "size"...
""" SSH Agent interface """ import os import socket import struct import sys import threading import time import tempfile import stat from select import select from paramiko.common import asbytes, io_sleep from paramiko.py3compat import byte_chr from paramiko.ssh_exception import SSHException, AuthenticationException...
{ "content_hash": "03420724378afa065d93f9470a49fee6", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 124, "avg_line_length": 30.53443526170799, "alnum_prop": 0.5701912666907254, "repo_name": "frankyrumple/smc", "id": "f928881e2124c9046db8db55b6e16204ad497d2f", "size": "11...
"""Unit tests for coders that must be consistent across all Beam SDKs. """ from __future__ import absolute_import from __future__ import print_function import json import logging import os.path import sys import unittest from builtins import map import yaml from apache_beam.coders import coder_impl from apache_beam....
{ "content_hash": "4b862b3b6cebc97711525f76bfc10948", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 79, "avg_line_length": 37.16197183098591, "alnum_prop": 0.638809929884404, "repo_name": "tgroh/incubator-beam", "id": "f704c490c9753e311455f361ab6740be9fccc6f7", "size": "...
class RevisionDocumentNotFound(RuntimeError): pass def __str__(self): return self.__class__.__name__
{ "content_hash": "e1fd726d2d6093aa6ab6d864b9c28eed", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 23.6, "alnum_prop": 0.6271186440677966, "repo_name": "eranroz/revscoring", "id": "594d6f057449217f41ead9d097cf48f0dd8a668d", "size": "118", "binary"...
class NagiosProperties(object): NUM_COLUMNS = 7 RESOURCE_TYPE = 'resource_type' RESOURCE_NAME = 'resource_name' SERVICE = 'service' STATUS = 'status' LAST_CHECK = 'last_check' DURATION = 'duration' ATTEMPT = 'attempt' STATUS_INFO = 'status_info' NAGIOS = 'nagios' class NagiosTe...
{ "content_hash": "14a50e65c1ac969201d8789e6fe22314", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 35, "avg_line_length": 23.666666666666668, "alnum_prop": 0.6267605633802817, "repo_name": "openstack/vitrage", "id": "e901c6e8ef73de03927029e0e8e94ca2405d78c1", "size": "10...
"""Command-line skeleton application for the I-Go calendar API. Usage: $ python i-go.py You can also get help on all the command-line flags the program understands by running: $ python i-go.py --help """ import argparse import httplib2 import os import sys import re from datetime import datetime as dt from urll...
{ "content_hash": "376e77f5be94681a0e72e3a9fd13fd5d", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 98, "avg_line_length": 39.31666666666667, "alnum_prop": 0.6053412462908012, "repo_name": "rovere/I-Go", "id": "8d6bf46f69f4fdd9b76e7931fdc9fd1901b45761", "size": "7790", ...
import MySQLdb class DB_MYSQL : def __init__(self): self.conn = None self.cur = None def connect(self, host, port, user, passwd, db, charset='utf8') : self.conn = MySQLdb.connect(host, user, passwd, db, port, charset='utf8') self.cur = self...
{ "content_hash": "29f6001fc1f786450535d3c0aada8266", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 81, "avg_line_length": 23.424242424242426, "alnum_prop": 0.46183699870633893, "repo_name": "guoyuyanggyy/distributed-transcoding", "id": "6c0338f3bf1868b5fb94f033baa23b288dcd...
"""Class to hold all cover accessories.""" import logging from pyhap.const import CATEGORY_GARAGE_DOOR_OPENER, CATEGORY_WINDOW_COVERING from homeassistant.components.cover import ( ATTR_CURRENT_POSITION, ATTR_POSITION, DOMAIN, SUPPORT_STOP) from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_SUPPORTED_FEAT...
{ "content_hash": "ed83b306e6090ebcfbbaa148921adfdc", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 77, "avg_line_length": 40.851851851851855, "alnum_prop": 0.6441523118766999, "repo_name": "jamespcole/home-assistant", "id": "5273480b6cef00d8a09f1ee48429bf518e03d90a", "s...
import os from tautils import debug_output, error_output from tapalette import palette_names from taconstants import ICON_SIZE, CATEGORY_LAYER, TAB_LAYER from tasprite_factory import SVG, svg_from_file, svg_str_to_pixbuf from sprites import Sprite def create_toolbar_background(sprite_list, width): # Create the t...
{ "content_hash": "b2a7179fb38ca40e8bd1e39ee66704a9", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 78, "avg_line_length": 35.46590909090909, "alnum_prop": 0.5776994553027875, "repo_name": "walterbender/turtleconfusion", "id": "87707060a73985c1fc0b0439c5f0bc077b0a2d93", "...
from .visualize import * from .pp import pp from .inspect import * from .expr import * from .exploration import * from .util import *
{ "content_hash": "1892fe1447d56f2c0362f89e5f60d3c0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 26, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7388059701492538, "repo_name": "axt/angr-utils", "id": "6dc45e14c7eeb32fa22b9919ff2c2bd2e743d1a7", "size": "134", ...
from robot.errors import DataError from robot.utils import (get_error_details, is_string, split_args_from_name_or_path, type_name, Importer) from .visitor import SuiteVisitor class ModelModifier(SuiteVisitor): def __init__(self, visitors, empty_suite_ok, logger): self._log_error...
{ "content_hash": "db75e0abf8f37666f2bc3feab44a487e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 39.08108108108108, "alnum_prop": 0.5601659751037344, "repo_name": "jaloren/robotframework", "id": "9ee8bf5e57ebdb32e4435474e7d3b44c2888e8f7", "size":...
from __future__ import division, unicode_literals """ This module implements Compatibility corrections for mixing runs of different functionals. """ import six from six.moves import filter, map __author__ = "Shyue Ping Ong, Anubhav Jain, Stephen Dacek, Sai Jayaraman" __copyright__ = "Copyright 2012, The Materials Pr...
{ "content_hash": "3efd26d8baf68b3c44d00a2ef1e81a0c", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 80, "avg_line_length": 39.36332767402377, "alnum_prop": 0.6041406081518222, "repo_name": "sonium0/pymatgen", "id": "c1b47a19d3bd86e692315bb743cfee54919e9123", "size": "232...
import os # the blockdevice information about a target # can be found in directory'/sys/class/iscsi_session/' # # iscsi_session # | # ----------------------------- # | | ..... | # session1 session2 ..... sessionN # |---------- # | | # device targetname #here chec...
{ "content_hash": "b2ce5f66b3075abe3fbee97b72ad5f11", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 71, "avg_line_length": 29.958333333333332, "alnum_prop": 0.5959666203059806, "repo_name": "lihuiba/SoftSAN", "id": "92ab004db7aa5ac3181392cf8205b8ed31dd7bd6", "size": "1438...
import os import sys from inspect import ismethod from time import sleep from OSEncryptionState import * from distutils.version import LooseVersion class EncryptBlockDeviceState(OSEncryptionState): def __init__(self, context): super(EncryptBlockDeviceState, self).__init__('EncryptBlockDeviceState', contex...
{ "content_hash": "16263bc6198813b588adaee2b200c0a0", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 146, "avg_line_length": 48.392857142857146, "alnum_prop": 0.601230012300123, "repo_name": "Azure/azure-linux-extensions", "id": "362066d511370b6c77a050289f64eba9892f325c", ...
""" Update message catalogs for the given doc project. (currently only available for sphinx projects). Requires sphinx-intl. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import qisys.parsers import qidoc.parsers def configure_parser(parser):...
{ "content_hash": "6245e8a7ca6592ab43a1a5ef53c2fd51", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 53, "avg_line_length": 25.96, "alnum_prop": 0.7288135593220338, "repo_name": "aldebaran/qibuild", "id": "38f94e4a9cf2325b1326c7bc16280ce8cce06975", "size": "846", "binary...
""" Display and control a Pomodoro countdown. Button 1 starts/pauses countdown. Button 2 switch Pomodoro/Break. Button 3 resets timer. Configuration parameters: display_bar: display time in bars when True, otherwise in seconds format: define custom display format. See placeholders below format_separator: ...
{ "content_hash": "9a2a32a281cfd02bc65162e19df06d56", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 75, "avg_line_length": 29.87828947368421, "alnum_prop": 0.5286799515578553, "repo_name": "Spirotot/py3status", "id": "0e59cc7aefbf5ce9303f2827c786baa552a974e0", "size": "9...
import cStringIO TOKEN_NUMBER = "TOKEN_NUMBER" TOKEN_IDENTIFIER = "TOKEN_IDENTIFIER" TOKEN_STRING = "TOKEN_STRING" TOKEN_EQUALS = "TOKEN_EQUALS" TOKEN_COMMENT = "TOKEN_COMMENT" TOKEN_COMA = "TOKEN_COMA" TOKEN_SEMICOLON = "TOKEN_SEMICOLON" TOKEN_OPEN_DICT = "TOKEN_OPEN_DICT" TOKEN_OPEN_LIST = "TOKEN_OPEN_LIST" TOKEN_C...
{ "content_hash": "98f5c6db1d4badb7f0d8937336398045", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 103, "avg_line_length": 34.107142857142854, "alnum_prop": 0.49617398308497784, "repo_name": "panyam/plists", "id": "dd5b583585c0d98f6715e051bd0ea4b2c8320c7e", "size": "124...
import jasy.js.parse.Node as Node import jasy.core.Console as Console __all__ = ["optimize", "Error"] # # Public API # class Error(Exception): def __init__(self, line): self.__line = line def optimize(node): Console.debug("Combining declarations...") Console.indent() resul...
{ "content_hash": "4ee2595ef13fc6f0d043efa8da8bc00e", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 120, "avg_line_length": 32.18928571428572, "alnum_prop": 0.61322534117386, "repo_name": "zynga/jasy", "id": "582057f54d7b23c5bed9022fb77bb41091189939", "size": "9082", "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf from niftynet.utilities.download import download from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig from tests.niftynet_testcase import NiftyNetTestCa...
{ "content_hash": "6a360e54084969336b6f8be7fa55926f", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 74, "avg_line_length": 35.089285714285715, "alnum_prop": 0.6824427480916031, "repo_name": "NifTK/NiftyNet", "id": "5dca36af90fcc7e8a05afcd27e600239a7ce60ab", "size": "1989"...
from django.shortcuts import render import urllib.request, json from django.http import HttpResponse, JsonResponse def _get_request(url): req = urllib.request.Request(url) resp_json = urllib.request.urlopen(req).read().decode('utf-8') return json.loads(resp_json) def _success(stat, data): return Jso...
{ "content_hash": "1fa841e19fd45e379cd1c3b57e7fee79", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 118, "avg_line_length": 30.066666666666666, "alnum_prop": 0.5070214338507022, "repo_name": "shadowgamefly/news-Digest", "id": "e0339af095122daf077129bdbaa097687d21880a", "s...
import sys from ged4py.parser import GedcomReader # open GEDCOM file with GedcomReader(sys.argv[1]) as parser: # iterate over each INDI record in a file for i, indi in enumerate(parser.records0("INDI")): # Print a name (one of many possible representations) print(f"{i}: {indi.name.format()}") ...
{ "content_hash": "294978e2be6e01d085eddce341e2b29c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 61, "avg_line_length": 32.55555555555556, "alnum_prop": 0.5813424345847554, "repo_name": "andy-z/ged4py", "id": "a103af8fa9e2ec733e6807cc3a1d6aeb637eccb5", "size": "879", ...
import logging import socket import sys try: from urllib2 import Request, urlopen except ImportError: from urllib.request import Request, urlopen from opbeat.conf import defaults from opbeat.contrib.async_worker import AsyncWorker from opbeat.transport.base import Transport, AsyncTransport, TransportException...
{ "content_hash": "3ff573f8ac8d33af9f97c6372db3bcc9", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 31.525252525252526, "alnum_prop": 0.5629605895546299, "repo_name": "daikeren/opbeat_python", "id": "806a2bf3e7430fc69fab8c5d9c7d6cc3f2aba549", "size"...
""" Images Pipeline See documentation in topics/images.rst """ import os import time import hashlib import urlparse import rfc822 from cStringIO import StringIO from collections import defaultdict from twisted.internet import defer, threads from PIL import Image from scrapy import log from scrapy.utils.misc import ...
{ "content_hash": "be3e2d63bbc676d33b8386919b34776e", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 122, "avg_line_length": 37.73482428115016, "alnum_prop": 0.6111252222504445, "repo_name": "gnemoug/scrapy", "id": "4ccc8e28241c1db467e730bbec2db43e238e5992", "size": "1181...
import pkgutil def test_imports(): """ This just imports all modules in astropy, making sure they don't have any dependencies that sneak through """ def onerror(name): # We should raise any legitimate error that occurred, but not # any warnings which happen to be caught because of ...
{ "content_hash": "ef29bb1e37fb94192763534f3f05d5fd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 27.275862068965516, "alnum_prop": 0.5828065739570164, "repo_name": "lpsinger/astropy", "id": "d13c956f0f94ee98a0423e1d98653d8ae27e47a2", "size": "856...
"""Abstract Base Classes (ABCs) according to PEP 3119.""" import types from _weakrefset import WeakSet # Instance of old-style class class _C: pass _InstanceType = type(_C()) def abstractmethod(funcobj): """A decorator indicating abstract methods. Requires that the metaclass is ABCMeta or derived from i...
{ "content_hash": "662597b24a4460777ee28ead9e762b6c", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 79, "avg_line_length": 38.595628415300546, "alnum_prop": 0.6073906272122328, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "255e214e14d94bbb32cad8d04de88d20dbfa5105",...
from django.core.urlresolvers import reverse from pyquery import PyQuery as pq from olympia.abuse.models import AbuseReport from olympia.addons.models import Addon from olympia.amo.tests import TestCase, user_factory from olympia.users.models import UserProfile class TestAbuse(TestCase): fixtures = ['base/addon...
{ "content_hash": "0464af194dbe520a5043f00a212fe1ce", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 37.348837209302324, "alnum_prop": 0.6519302615193027, "repo_name": "lavish205/olympia", "id": "8f433f202d3a1d80c7dfcb2338d31e24c8db52c4", "size": "16...
print("hello world!!!")
{ "content_hash": "bc50e181ce88fcc06d8ca05279345c65", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 23, "avg_line_length": 24, "alnum_prop": 0.625, "repo_name": "WebClub-NITK/Hacktoberfest-2k17", "id": "81304866b07981492374b7501b016c6b904bbf1b", "size": "24", "binary": f...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/item/component/shared_item_electronics_gp_module.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return r...
{ "content_hash": "b1d1bf82efb743e29f0ac9ebe0473c38", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 96, "avg_line_length": 25, "alnum_prop": 0.7046153846153846, "repo_name": "obi-two/Rebelion", "id": "4ec51a2db1bef85775da9e9071c004dedb9192ac", "size": "470", "binary": f...
"""Tests for liveness module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.autograph.pyct import anno from tensorflow.python.autograph.pyct import cfg from tensorflow.python.autograph.pyct import parser from tensorfl...
{ "content_hash": "95d2bde000eb6d35d4c1e3d68b8efeef", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 79, "avg_line_length": 22.581939799331103, "alnum_prop": 0.5793838862559242, "repo_name": "kevin-coder/tensorflow-fork", "id": "5cbbe4a7951a785945ab48692d68325426638329", ...
"""This example gets all custom targeting keys and the values. To create custom targeting keys and values, run create_custom_targeting_keys_and_values.py.""" # Import appropriate modules from the client library. from googleads import dfp def main(client): # Initialize appropriate service. custom_targeting_serv...
{ "content_hash": "5a8e59668633a431647a33620a5b618a", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 34.791666666666664, "alnum_prop": 0.6315369261477046, "repo_name": "richardfergie/googleads-python-lib", "id": "32cc075e2206849e319d92f9ab2ef4746bc6701...
""" Celery functions to be processed in a non-blocking distributed manner. """
{ "content_hash": "6b4fc4265011a7e2d8726743921b6708", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 70, "avg_line_length": 20, "alnum_prop": 0.7375, "repo_name": "vitorio/ocropodium", "id": "a7085f7cd78ca29a2b4e8567acab231c470f34cb", "size": "80", "binary": false, "cop...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('customer', '0004_auto_20170906_1506'), ] operations = [ migrations.AlterField( model_name='customer', name='metal_decision',...
{ "content_hash": "5f39b765d2f776c4272155b5a5ca538f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 185, "avg_line_length": 29.11111111111111, "alnum_prop": 0.6068702290076335, "repo_name": "hqpr/findyour3d", "id": "8d5314bc248c0e11b1abd2a396f237530199b2c3", "size": "597"...
import numpy as np from bayespy.utils import misc from .node import Node, Moments class Constant(Node): r""" Node for presenting constant values. The node wraps arrays into proper node type. """ def __init__(self, moments, x, **kwargs): if not isinstance(moments, Moments) and issubclass(...
{ "content_hash": "32e5e10fc44d3de4d68be64e92034b22", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 85, "avg_line_length": 32.10126582278481, "alnum_prop": 0.6021293375394322, "repo_name": "jluttine/bayespy", "id": "ccc578cbb4bfbf9939b3e1816684de08c4315d20", "size": "2796...
from ac_mediator.exceptions import ImproperlyConfiguredACService, ACException from services.acservice.constants import * import requests import logging requests_logger = logging.getLogger('requests_sent') class BaseACService(object): """ Base class for Audio Commons Service. An Audio Commons service shou...
{ "content_hash": "371b9d3923ef08b077cfa30832144924", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 125, "avg_line_length": 40.2247191011236, "alnum_prop": 0.6255586592178771, "repo_name": "AudioCommons/ac-mediator", "id": "2a3b017792a778ed51f3ea0535c5a41d53d8c28d", "siz...
"""Should be run on a GCE instance to set up the build environment.""" from __future__ import print_function import getpass import os from chromite.compute import compute_configs from chromite.compute import bot_constants from chromite.lib import cros_build_lib from chromite.lib import osutils # Make the script mo...
{ "content_hash": "9b4ddee44b560c23d070778d9eb8c876", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 80, "avg_line_length": 37.81372549019608, "alnum_prop": 0.642727508426238, "repo_name": "mxOBS/deb-pkg_trusty_chromium-browser", "id": "8c6c1133699562841808e7b39aec708fe29d8...
import numpy as np from baseline.remote import ( RemoteModelREST, RemoteModelGRPC, register_remote, RemoteRESTClassifier, RemoteRESTTagger, RemoteRESTSeq2Seq, RemoteRESTEmbeddings, RemoteGRPCClassifier, RemoteGRPCTagger, RemoteGRPCSeq2Seq, RemoteGRPCEmbeddings, ) class Remo...
{ "content_hash": "09175ac1090a1e51426792df09feb021", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 108, "avg_line_length": 37.552, "alnum_prop": 0.7334895611418832, "repo_name": "dpressel/baseline", "id": "cc31f2d1d53cb1679df09aa941e9fc614c46cb62", "size": "4694", "bi...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import os import xml.etree.ElementTree as ET from flexget import plugin from flexget.utils.imdb import is_valid_imdb_title_id from flexget.event import even...
{ "content_hash": "8a7fba80f5d04bf03e69748be9ce0e5e", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 120, "avg_line_length": 41.16086956521739, "alnum_prop": 0.599767613816415, "repo_name": "drwyrm/Flexget", "id": "ddc49c527b7d15ad4ac83fcfc32ded28465d5a2f", "size": "9467"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ui/shared_ui_planet_rori.iff" result.attribute_template_id = -1 result.stfName("loc_n","rori") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "88df3febfaff9391b5c00e5ea83f68f2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 22, "alnum_prop": 0.6783216783216783, "repo_name": "anhstudios/swganh", "id": "2ec1c11dd7d27162e92fefb9de2661bd6ab3effd", "size": "431", "binary": ...
"""Game mechanic modules.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 Will Hutcheson # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
{ "content_hash": "62b08fef2fedfae4ed26e8735be2ca5a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 73, "avg_line_length": 53.25, "alnum_prop": 0.7230046948356808, "repo_name": "whutch/atria", "id": "b91a8af17dd386b3446199bb1ef0ae139ce6650e", "size": "237", "binary": fal...
"""This code example gets all creative sets for a master creative. To create creative sets, run create_creative_sets.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching auth...
{ "content_hash": "9f70488ee7f651fda5ca94eaaf5ca4f8", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 33.642857142857146, "alnum_prop": 0.6698513800424628, "repo_name": "richardfergie/googleads-python-lib", "id": "f47d345a6808869354944d83fbdfc8da40b4de6...
from requests import HTTPError import urllib from oslo_log import log as logging from f5_openstack_agent.lbaasv2.drivers.bigip import exceptions as f5_ex from f5_openstack_agent.lbaasv2.drivers.bigip import resource_helper LOG = logging.getLogger(__name__) class PoolServiceBuilder(object): """Create LBaaS v2 ...
{ "content_hash": "da39d40908cbd47fa3583f4e406c951a", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 77, "avg_line_length": 39.875, "alnum_prop": 0.5437221580597261, "repo_name": "F5Networks/f5-openstack-agent", "id": "505e30ee086d5f9693f13b42398d18016cbb794a", "size": "1...
import _plotly_utils.basevalidators class XsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="xsrc", parent_name="histogram2d", **kwargs): super(XsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_t...
{ "content_hash": "17bb12cc7b772eaf511d64c31e017001", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 80, "avg_line_length": 36.083333333333336, "alnum_prop": 0.6004618937644342, "repo_name": "plotly/python-api", "id": "f032112fcffe759cc5895addeb163deef7b29ddc", "size": "43...
"""An example of starting https://cloud.google.com/profiler.""" # [START profiler_python_quickstart] import googlecloudprofiler def main(): # Profiler initialization. It starts a daemon thread which continuously # collects and uploads profiles. Best done as early as possible. try: googlecloudprof...
{ "content_hash": "3f0095960217be7b62dc191c4c421598", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 23.4, "alnum_prop": 0.5931623931623932, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "98206a39674eaee2c906ff7bdcd8c361c8441bfc", "si...
"""Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ import os import shutil from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error class MultiWalletTest(BitcoinTestFramework): def set_test_params(self): ...
{ "content_hash": "4bbfe27ce7729389e2eb26fe915bb1fe", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 142, "avg_line_length": 41.30232558139535, "alnum_prop": 0.6342905405405406, "repo_name": "ionomy/ion", "id": "afaf3686b28cb83c453401fd9886acaf3d2bbd59", "size": "3761", ...
import inspect import bitUtils as bu # These Tiny classes take in a FA18 processor as an argumnet and # emulate the memory and register changes that will # take place given a certain opCode class OpCode(object): requiresAddress = False def action(self, pi, addr): pass def after(self, pi, addr):...
{ "content_hash": "7c17bce01dfbf2bebb72fa87e08df77c", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 110, "avg_line_length": 24.8018018018018, "alnum_prop": 0.624318924809299, "repo_name": "meawoppl/GA144Tools", "id": "0f16fc2870042beee5f9c3bcc64c7a0df1761ed9", "size": "1...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('chipyapp', '0006_auto_20151111_0103'), ] operations = [ migrations.AlterField( model_name='activeunit', name='quarter', ...
{ "content_hash": "b7f23725e4c4f0cb1758f37e7b9e285e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 58, "avg_line_length": 26.848484848484848, "alnum_prop": 0.5643340857787811, "repo_name": "jordanbettis/chipy-mentorship", "id": "ab3a9cc14e33ef4d87a19b1fd1574fb2687d0dc7", ...
import errno import glob import os import sys import django import subprocess from pymongo import ReadPreference, MongoClient from mongoengine import connect sys.path.insert(0, os.path.dirname(__file__)) # calculated paths for django and the site # used as starting points for various other paths DJANGO_ROOT = os.pat...
{ "content_hash": "0fcc40ea2c0d5e1491f51f0e7b869f7c", "timestamp": "", "source": "github", "line_count": 528, "max_line_length": 142, "avg_line_length": 41.67045454545455, "alnum_prop": 0.6233524225070448, "repo_name": "seanthegeek/crits", "id": "05325fcbd5388dada1dd764d2e869bae96b4077e", "size": "2...
import io import unittest from doctrine.code import Code from doctrine.code import Analyzer TEST_CODE = u'''class CodeLayout(TextLayout): """This is a docstring""" tab_width = 8 def calculate_text_segments(self, text, width, wrap): """ Calculate the segments of text to display given width...
{ "content_hash": "05cb8a104b34584aaf2c63311f12e392", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 78, "avg_line_length": 35.177304964539005, "alnum_prop": 0.4659274193548387, "repo_name": "regebro/doctrine.code", "id": "6b31b15a6656dbeb1c491ef25dfc096c3e13459e", "size"...
from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from __future__ import division class Dict( dict ): def __init__( self, creator ): self._creator = creator def __missing__( self, key ): value = self[ key ] = self._creator( k...
{ "content_hash": "46bd2b9c3b7b42226d65f4e2bd9984ec", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 24.714285714285715, "alnum_prop": 0.6271676300578035, "repo_name": "davits/DyeVim", "id": "6f6083305ae8bd7ac62a3f71fd2f77a302c672b3", "size": "1491",...
""" setup.py ~~~~~~~~ on package install: - generates metadata - installs json files for use in m2g_cloud - installs `m2g` script keywords to the command line - ensures python version - installs m2g dependencies Use `pip install .` to install the package. Use `pip install -e .` to install the package in developer mod...
{ "content_hash": "e580a5c047c4e2e16181aa9be8817bdf", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 113, "avg_line_length": 27.602409638554217, "alnum_prop": 0.5665648188563945, "repo_name": "neurodata/ndmg", "id": "9ab5d0a544d48f82626b1da774ac201115deded8", "size": "2313...
""" API for the command-line I{pyflakes} tool. """ from __future__ import with_statement import sys import os import _ast from pyflakes import checker, __version__ from pyflakes import reporter as modReporter __all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main'] def check(codeString, filenam...
{ "content_hash": "50698ee57e09f4f098258d4ef47224c0", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 78, "avg_line_length": 32.11764705882353, "alnum_prop": 0.6165501165501166, "repo_name": "vicky2135/lucious", "id": "a535bff1289ea7867616f5249bb5c324eb3ee62e", "size": "60...
from django.apps import AppConfig class ExpensesConfig(AppConfig): name = 'expenses' verbose_name = 'Despesas'
{ "content_hash": "618c692de390b28333dbf96b55654ca2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 33, "avg_line_length": 20.166666666666668, "alnum_prop": 0.7272727272727273, "repo_name": "Lucasfeelix/ong-joao-de-barro", "id": "05ca574e17c855c0d1331e23df4962960c74c1ce", ...
""" Spyder Editor """ import pandas as pd from latlon import * import re from bs4 import BeautifulSoup import csv import sys import requests def scrape_birthdays_page(url=None, csv_name=None): """ Scrape info from nobelprize.org birthdays page Scrapes info from the birthdays page at: http://www....
{ "content_hash": "9ba7edadb20217886524d6b8c1931b3e", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 134, "avg_line_length": 33.104109589041094, "alnum_prop": 0.570222626831085, "repo_name": "FCH808/FCH808.github.io", "id": "998a0caafa4661bb99fc464c1d44e6c60b0ee49f", "siz...
from flask import Flask import pandas as pd import json from sqlalchemy import create_engine from sqlalchemy import text from sqlalchemy import inspect def object_as_dict(obj): return {c.key: getattr(obj, c.key) for c in inspect(obj).mapper.column_attrs} engine = create_engine('sqlite:///nba.db') def ru...
{ "content_hash": "925f136b6003ab88947d037bafc4c965", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 52, "avg_line_length": 20.473684210526315, "alnum_prop": 0.6529562982005142, "repo_name": "jk2227/nba-hack", "id": "6c6fb234f5d138bd2f4dc0d40050ca16e240db3b", "size": "778"...
from .views import * from django.utils import timezone from weather import get_geo_lookup import kronos @kronos.register('* * * * *') def update_log(): accounts = Account.objects.all() for account in accounts: status = account.get_status() if not sum(status['stations']): account.se...
{ "content_hash": "806f7e6fd1c2d49c9e0ab659e5370b6a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 117, "avg_line_length": 37.91525423728814, "alnum_prop": 0.581135449262405, "repo_name": "emmceemoore/ospi-website", "id": "288765c85ff478f24904c1a3a127351615c0e11e", "size...
import os from setuptools import setup, find_packages from dewey import VERSION ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) with open('requirements.txt') as f: requirements = f.read().splitlines() setup( name="dewey", description="A helpful CLI friend", author="GreenKahun...
{ "content_hash": "d1283385ec4f5b4bfef94e55c09e7372", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 47, "avg_line_length": 24.96153846153846, "alnum_prop": 0.6563944530046225, "repo_name": "skoczen/dewey", "id": "aadb6be831ab942d326029231a451a302e6ad3a3", "size": "670", ...
from pysys.constants import * from xpybuild.xpybuild_basetest import XpybuildBaseTest import shutil, re, os class PySysTest(XpybuildBaseTest): def execute(self): # build only the target we're interested in - this ensures the dependencies are correct self.xpybuild(args=['${OUTPUT_DIR}/CopyFromTargetsWithinDir/', '...
{ "content_hash": "6f4db61fc98ab3112c38b0a5921f7150", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 118, "avg_line_length": 56.388888888888886, "alnum_prop": 0.7832512315270936, "repo_name": "xpybuild/xpybuild", "id": "5d850890a7a77a0265ff622e861dae765fa045f9", "size": "1...
import numpy as np import pandas as pd import os TIME_SEQUENCE_LENGTH = 30 def rolling_average(df): return pd.rolling_mean(df, window=TIME_SEQUENCE_LENGTH-2, center=True).mean() def rolling_median(df): return pd.rolling_median(df, window=TIME_SEQUENCE_LENGTH-2, center=True).mean() def rolling_max(df): ...
{ "content_hash": "9550f20684aa0f9d3a3324319befce88", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 156, "avg_line_length": 29.074257425742573, "alnum_prop": 0.6354503660820705, "repo_name": "ChristopherGS/sensor_readings", "id": "24738ab2d71594dc53de7f9978564cfa7ed29741",...
import asyncio import functools import os import shutil import tempfile from unittest import mock from unittest.mock import MagicMock import pytest from aiohttp import abc, web from aiohttp.web_urldispatcher import SystemRoute @pytest.fixture(scope='function') def tmp_dir_path(request): """ Give a path for ...
{ "content_hash": "51176b80b5bb9a9c7232d151a9c78797", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 75, "avg_line_length": 29.565349544072948, "alnum_prop": 0.626297933586923, "repo_name": "alex-eri/aiohttp-1", "id": "6ce5c3400c670e405010e43af844be17d1ccc521", "size": "9...
import itertools import logging import operator import os import six import sys import weakref import ryu.contrib ryu.contrib.update_module_path() import ovs.db.data import ovs.db.types import ovs.poller from ovs import (jsonrpc, ovsuuid, stream) from ovs.db import idl from ryu.lib ...
{ "content_hash": "ae6917232f57d3d5320ec45c6d772e0a", "timestamp": "", "source": "github", "line_count": 1894, "max_line_length": 79, "avg_line_length": 37.95776135163675, "alnum_prop": 0.5452345184443331, "repo_name": "sivaramakrishnansr/ryu", "id": "8670eb355e265ffd6d39483247e70ae513daa945", "size...
from .lattice import default_optics_mode from .lattice import energy from .accelerator import default_vchamber_on from .accelerator import default_radiation_on from .accelerator import accelerator_data from .accelerator import create_accelerator from .families import get_family_data from .families import family_mappi...
{ "content_hash": "eb7aac8e1b24a6ad91b2121ed46edab5", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 53, "avg_line_length": 33.785714285714285, "alnum_prop": 0.8160676532769556, "repo_name": "lnls-fac/sirius", "id": "0843904ec2c6852ce9c9cc18e0320117f685ef1a", "size": "474"...
from google.cloud import dataform_v1beta1 async def sample_get_compilation_result(): # Create a client client = dataform_v1beta1.DataformAsyncClient() # Initialize request argument(s) request = dataform_v1beta1.GetCompilationResultRequest( name="name_value", ) # Make the request ...
{ "content_hash": "50322ec7a55caa4a1ab253df7a225915", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 70, "avg_line_length": 26.473684210526315, "alnum_prop": 0.731610337972167, "repo_name": "googleapis/python-dataform", "id": "6e42896d3ba0443b8646f8028fbef2aa4252243b", "si...
from DRMAA import * import sys, os ####################### # CREATE JOB TEMPLATE # ####################### def setup_job_template(): args=["-l", "-a"] (result, jt, error)=drmaa_allocate_job_template() if result != DRMAA_ERRNO_SUCCESS: print >> sys.stderr, "drmaa_allocate_job_template() failed: %s" % (error) ...
{ "content_hash": "c2bd1b13bba90dcdbbaf942d5357e3ad", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 88, "avg_line_length": 26.51086956521739, "alnum_prop": 0.6523165231652317, "repo_name": "oldpatricka/Gridway", "id": "9453ef63177d8fe6492255ddec842cfcc2ffae69", "size": "3...
import collections import contextlib import sys import time from neutron_lib.agent import constants as agent_consts from neutron_lib.callbacks import events from neutron_lib.callbacks import registry from neutron_lib.callbacks import resources as local_resources from neutron_lib import constants from neutron_lib impor...
{ "content_hash": "662ae001a75c045f035e08a3947a99ce", "timestamp": "", "source": "github", "line_count": 456, "max_line_length": 79, "avg_line_length": 44.800438596491226, "alnum_prop": 0.5534778990650546, "repo_name": "eayunstack/neutron", "id": "5f781481de85149477c55b55a1099e91353adc0c", "size": "...
from project.extensions import db class Problem(db.Model): __tablename__ = 'problems' id = db.Column(db.Integer, primary_key=True) number = db.Column(db.Integer, nullable=False) rate = db.Column(db.SMALLINT) time_limit = db.Column(db.SMALLINT, nullable=False) ## seconds space_limit = db.Colu...
{ "content_hash": "0c15ee08e2e36833d48c6512ef5e5e52", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 96, "avg_line_length": 32.04761904761905, "alnum_prop": 0.6835066864784547, "repo_name": "ez4u/ijust_backend", "id": "5fa531eebe31fe2082c1839439235ae94185e4b2", "size": "71...
import json import codecs from collections import defaultdict import re def make_label_kb(kbfilestr, lang): with codecs.open(kbfilestr, 'r', encoding='utf-8') as kb: labs = dict() for line in kb: lineitem = line.split() if lineitem[0].startswith('Q') and lineitem[1].startswi...
{ "content_hash": "8cd4b8388aecfc5f61a8556af00772a8", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 120, "avg_line_length": 33.47674418604651, "alnum_prop": 0.5477596387634596, "repo_name": "notconfusing/wikidata-subclass-chains", "id": "40354591100d2c9070c6b71f5d0d1c314240...
from __future__ import unicode_literals import PySide.QtGui as QtGui import PySide.QtCore as QtCore class ModifiedMarkdownHighlighter(QtGui.QSyntaxHighlighter): def __init__(self, parent=None): QtGui.QSyntaxHighlighter.__init__(self, parent) # Initialise the highlighting rules self.highl...
{ "content_hash": "790fcca6a2e9dc4aac6880d5b2f6e7c8", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 77, "avg_line_length": 41.803149606299215, "alnum_prop": 0.5705405914484837, "repo_name": "egolus/NoteOrganiser", "id": "4935f9a2b606dd09585af37a9bb74e91a232f904", "size":...
import os import sys from Bio import Seq from Bio import SeqIO from Bio import SeqRecord import pandas as pd import numpy as np import ms_module as ms import re ############################ from Bio import Entrez from Bio import SeqIO from StringIO import StringIO import time from urllib2 import HTTPError # for Python...
{ "content_hash": "58d8cc58a3b92a5518863d06a44fda2e", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 130, "avg_line_length": 32.33757961783439, "alnum_prop": 0.6560961197557613, "repo_name": "sergpolly/GlycoMadness", "id": "8c31d3cdf9bba7291b24631dadeec7f27c137c31", "size...
from __future__ import absolute_import from sentry.testutils import AcceptanceTestCase class AuthTest(AcceptanceTestCase): def enter_auth(self, username, password): self.browser.get('/auth/login/') self.browser.find_element_by_id('id_username').send_keys(username) self.browser.find_elemen...
{ "content_hash": "ef956d4e2bc62554826b9466a395c71b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 92, "avg_line_length": 34.970588235294116, "alnum_prop": 0.6534903280067283, "repo_name": "gencer/sentry", "id": "e5b3c913b348af62323fd9680d40b71deee32f58", "size": "1189",...
from __future__ import unicode_literals import gzip import os import tempfile import unittest import zlib from io import BytesIO, StringIO from django.core.files import File from django.core.files.base import ContentFile from django.core.files.move import file_move_safe from django.core.files.temp import NamedTempora...
{ "content_hash": "f20da37fd2df430be5de1ccfbceb03b7", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 114, "avg_line_length": 36.1660777385159, "alnum_prop": 0.6257938446507083, "repo_name": "RevelSystems/django", "id": "d5d952d1e04d8bf01ea71eff4e6e9eec5a5e18c7", "size": "...
import operator import os import boto from boto.exception import S3ResponseError from pyramid.decorator import reify from pyramid.events import NewResponse from pyramid.events import subscriber from pyramid.renderers import get_renderer from pyramid.response import FileResponse from pyramid.response import Response fr...
{ "content_hash": "6fa34765781b659c0772bd34b1e7b2e4", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 79, "avg_line_length": 35.80051813471503, "alnum_prop": 0.5910702655763803, "repo_name": "therewillbecode/ichnaea", "id": "ef20e0229311cae588104a978e97298f287a11b6", "size...
"""Script for unittesting the ssh module""" import os import tempfile import unittest import shutil import testutils import mocks from ganeti import constants from ganeti import utils from ganeti import ssh from ganeti import errors class TestKnownHosts(testutils.GanetiTestCase): """Test case for function writin...
{ "content_hash": "5a86b5f60408e4a930d38d81f8b1559c", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 78, "avg_line_length": 33.595419847328245, "alnum_prop": 0.6489434219495569, "repo_name": "apyrgio/snf-ganeti", "id": "b520a97cbf875a57645fca00c6ff95d965fb122c", "size": "...
"""Unit tests for upload_command_stats_unittest.py.""" import os import sys sys.path.insert(0, os.path.abspath('%s/../..' % os.path.dirname(__file__))) from chromite.cbuildbot import constants from chromite.lib import cros_build_lib from chromite.lib import cros_test_lib from chromite.lib import osutils from chromite...
{ "content_hash": "5a9199fef5c1fc4746da4e4d79f560ec", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 75, "avg_line_length": 36.095238095238095, "alnum_prop": 0.7133905013192612, "repo_name": "bpsinc-native/src_third_party_chromite", "id": "17049d1af161c477df3ff66783d1a270ac0...
"""NDArray API of MXNet.""" from __future__ import absolute_import from __future__ import division try: from __builtin__ import slice as py_slice except ImportError: from builtins import slice as py_slice import ctypes import warnings import os as _os import sys as _sys import operator import numpy as np fro...
{ "content_hash": "64fc07db92fc44db953a68ed74c08c7a", "timestamp": "", "source": "github", "line_count": 2514, "max_line_length": 99, "avg_line_length": 31.933174224343677, "alnum_prop": 0.5297334329845541, "repo_name": "coder-james/mxnet", "id": "31b7d7cfb944b1a8174ef78da7425931be8d0034", "size": "...
""" The values are set to run the application either on localhost or within docker using docker-compose. If you would like to run it a different waay fell free to change the appropriate values. """ import os try: MONGO_HOST = os.environ['ANCHOR_DB_1_PORT_27017_TCP_ADDR'] except: MONGO_HOST = 'loc...
{ "content_hash": "7842d5fc2d4caf7c574898b0f7164612", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 68, "avg_line_length": 21.68, "alnum_prop": 0.7047970479704797, "repo_name": "oldarmyc/anchor", "id": "ff7d745384bb3282e72e2dabee9e5a4692af5f03", "size": "1117", "binary"...
from __future__ import absolute_import, division, print_function, unicode_literals import re from math import floor, log10 from benchexec.tablegenerator import util __all__ = ['Column, ColumnType, ColumnMeasureType'] DEFAULT_TIME_PRECISION = 3 DEFAULT_TOOLTIP_PRECISION = 2 REGEX_SIGNIFICANT_DIGITS = re.compile('([...
{ "content_hash": "9c92f46045b11a95217a2b45436eb199", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 149, "avg_line_length": 40.9419795221843, "alnum_prop": 0.6401300433477826, "repo_name": "IljaZakharov/benchexec", "id": "5d7dae28edcd06f001485baa564bdd93c9d247ee", "size"...
from django.db import models from django.utils.translation import ugettext_lazy as _ from leonardo.module.media.fields import FileField from leonardo.module.web.models import Widget from leonardo.module.web.widgets.forms import WidgetUpdateForm class FileForm(WidgetUpdateForm): file = FileField( help_tex...
{ "content_hash": "35ea77404bdf8299d75aa98000ec335f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 30.642857142857142, "alnum_prop": 0.682983682983683, "repo_name": "django-leonardo/django-leonardo", "id": "a3187d2a0642783f1a7e217bb0a66902d9a7e324", ...
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String from sqlalchemy.orm import mapper, create_session, polymorphic_union metadata = MetaData() managers_table = Table('managers', metadata, Column('employee_id', Integer, primary_key=True), Column('name', String(50)), Column('mana...
{ "content_hash": "99ab198f2b17b900ba6c07de1a31fc49", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 125, "avg_line_length": 30.166666666666668, "alnum_prop": 0.6670015067805123, "repo_name": "obeattie/sqlalchemy", "id": "c50513b55559ad14d7e600d352a65c7576dfd3f9", "size": ...
import distribute_setup distribute_setup.use_setuptools() from setuptools import setup, find_packages from hyde.version import __version__ from distutils.util import convert_path from fnmatch import fnmatchcase import os import sys PROJECT = 'hyde' try: long_description = open('README.rst', 'rt').read() except ...
{ "content_hash": "4dbef22f08532a1993db92f463b066f8", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 86, "avg_line_length": 35.52760736196319, "alnum_prop": 0.5050941115524089, "repo_name": "Valloric/hyde", "id": "2e0a53b461f042d60096aa89c664e64a1cd9d6d6", "size": "5830",...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20160321_0954'), ] operations = [ migrations.AlterModelOptions( name='topic', options={'ordering': ['order...
{ "content_hash": "68659d8924101b81529d228df3e12df7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 88, "avg_line_length": 24.045454545454547, "alnum_prop": 0.5746691871455577, "repo_name": "anehx/anonboard-backend", "id": "6442fb1b9ac4dc2bf216667ea9acd036504c47ce", "size...
import pandas import pandasql def avg_min_temperature(filename): ''' This function should run a SQL query on a dataframe of weather data. More specifically you want to find the average minimum temperature on rainy days where the minimum temperature is greater than 55 degrees. You might als...
{ "content_hash": "bea757e398c8885488a9e532c012a49c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 93, "avg_line_length": 39.32258064516129, "alnum_prop": 0.7095980311730927, "repo_name": "KellyChan/python-examples", "id": "f9f7d7a0744e55d27e726f44c886e1f93a02f535", "siz...
"""Contains the base Layer class, from which all layers inherit.""" import copy import warnings from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.keras import backend from tensorflow.python.keras.engine import b...
{ "content_hash": "8d7c257d2e00505f7f91c98f37b83e2f", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 116, "avg_line_length": 39.13856427378965, "alnum_prop": 0.6612779389182734, "repo_name": "yongtang/tensorflow", "id": "8fba78fa4ca557ea8e06396b0567d0c63a6de31d", "size": ...
__description__ = 'Facts Listener' __author__ = 'fla' from flask import Flask, request, Response, json from facts.myredis import myredis from facts.queue import myqueue from facts.jsoncheck import jsoncheck from gevent.pywsgi import WSGIServer from keystoneclient.exceptions import NotFound from facts.config import fac...
{ "content_hash": "8b4c050d98de7d5bf1a119b1c6f6e490", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 119, "avg_line_length": 35.68263473053892, "alnum_prop": 0.6221681490182916, "repo_name": "Fiware/cloud.Facts", "id": "d02af79150ef29d3ce27b78eba596b5b453e109d", "size": "...
"""Asserts and Boolean Checks. See the [Asserts and checks](https://tensorflow.org/api_guides/python/check_ops) guide. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.eager import context from tensorflow.pytho...
{ "content_hash": "649b07dea67bf62c79a13193dfbde517", "timestamp": "", "source": "github", "line_count": 1335, "max_line_length": 101, "avg_line_length": 35.14681647940075, "alnum_prop": 0.6472581573282752, "repo_name": "girving/tensorflow", "id": "40b111ea0c2bca773e3fe6744fcb1e7d95791371", "size": ...
import unittest from future.moves.urllib.parse import urlparse, urljoin, parse_qs import pytest from addons.twofactor.tests.utils import _valid_code from nose.tools import (assert_equal, assert_false, assert_is_none, assert_is_not_none, assert_true) from osf_tests.factories import UserFactory ...
{ "content_hash": "791112f6094ad7f9885fd2042e255f50", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 78, "avg_line_length": 32.66412213740458, "alnum_prop": 0.6106566954896003, "repo_name": "baylee-d/osf.io", "id": "244f3e2e3fb995ca9d16d40813d6280f49f9d380", "size": "4279...
from __future__ import print_function, division from Hypers import tuners from Spider import * from Edge import * import time import copy import math # Needs words in lowercase, and if multiple words, join them using '_' class Wordclient: def __init__(self, word): ''' Constructor to crawl web for a word ''' ...
{ "content_hash": "2d22c40a62ef08f01c218e7783a4db7e", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 104, "avg_line_length": 23.991869918699187, "alnum_prop": 0.6645205015249068, "repo_name": "anirudhagar13/SS_Graph", "id": "4aac5c0dc90497517fe9c3fb2994dd2ed76701d6", "siz...
""" Main Lomb-Scargle Implementation The ``lombscargle`` function here is essentially a sophisticated switch statement for the various implementations available in this submodule """ import warnings import numpy as np from astropy import units from astropy.utils.compat.numpy import broadcast_arrays from .slow_impl i...
{ "content_hash": "dec03ce8b66084091b181561c1d28076", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 80, "avg_line_length": 35.946843853820596, "alnum_prop": 0.6081330868761553, "repo_name": "jakevdp/lombscargle", "id": "01e489d0bd6a623ef188a18b4aef6abf8f261567", "size": ...
import re from django.core import exceptions from django.db import models from django.forms import fields from tower import ugettext as _ class DecimalCharField(models.DecimalField): """Like the standard django DecimalField but stored in a varchar In order to gracefully read crappy data, use nullify_invali...
{ "content_hash": "aaa557315d43bf23486c2add2c7ca212", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 76, "avg_line_length": 34.7037037037037, "alnum_prop": 0.6670224119530416, "repo_name": "andymckay/zamboni", "id": "eaec93bdd484f78e8ba26e2de615d53aa07bf7d9", "size": "1874...