text
stringlengths
4
1.02M
meta
dict
from pattern.graph import Graph, Node, Edge import json class NoPathException(Exception): pass class DependencyParse(object): def __init__(self, parse, enhanced=True): self.parse = parse self.g, self.edge, self.node, self.root = DependencyParse.make_graph(self.parse, enhanced) @classm...
{ "content_hash": "ab9e2e1498ea4724e373e5ba1f1889ca", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 98, "avg_line_length": 32.6, "alnum_prop": 0.5438469866474197, "repo_name": "vzhong/sent2rel", "id": "334efcca93a4459a20d12a0954dcdd00ab3ec8c8", "size": "2771", "binary":...
from otp.ai.AIBase import * from toontown.toonbase import ToontownGlobals from direct.distributed.ClockDelta import * from toontown.building.ElevatorConstants import * from toontown.building import DistributedElevatorFloorAI from toontown.building import DistributedElevatorAI from direct.fsm import ClassicFSM from dire...
{ "content_hash": "6eec67d9ace542b754ba3904109b5944", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 95, "avg_line_length": 36.6, "alnum_prop": 0.6513661202185792, "repo_name": "ksmit799/Toontown-Source", "id": "2ebe47dcca64a1f1601c1e24944886f56a1a4070", "size": "1830", ...
"""The most basic test: check that the marker works. """ import pytest def test_marker_registered(ctestdir): result = ctestdir.runpytest("--markers") result.stdout.fnmatch_lines(""" @pytest.mark.dependency* """) def test_marker(ctestdir): ctestdir.makepyfile(""" import pytest ...
{ "content_hash": "53c8943978f937209e05f0fe62347a3f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 72, "avg_line_length": 28.925925925925927, "alnum_prop": 0.6619718309859155, "repo_name": "RKrahl/pytest-dependency", "id": "7be11f1829c1f7245175a239594185585dabd572", "siz...
""" Setup file """ import os from setuptools import setup HERE = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(HERE, 'README.markdown')).read() REQUIREMENTS = [ ] TEST_REQUIREMENTS = [ 'tox', 'pytest', 'pytest-cov', 'coverage', 'flake8' ] if __name__ == "__main__": se...
{ "content_hash": "5c4e2bc9d8b54e2a64b7828a2f59d539", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 59, "avg_line_length": 28.31111111111111, "alnum_prop": 0.565149136577708, "repo_name": "numberoverzero/simplex", "id": "51a89e1ccc2299b05c153bbd17838fb9bead626e", "size": ...
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from urllib.parse import parse_qs, urljoin, urlparse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, m...
{ "content_hash": "6996f4ef8389970339e72183d1de8083", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 257, "avg_line_length": 45.91580756013746, "alnum_prop": 0.6536317030273547, "repo_name": "Azure/azure-sdk-for-python", "id": "3a2b8bdce0828317e0883c7962addb287eb0d4ec", "...
"""SCons.Tool.Perforce.py Tool-specific initialization for Perforce Source Code Management system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001 - 2016 The SCons Foundation # # Permiss...
{ "content_hash": "408b2f13c4ff8e9702a9a95027463b1e", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 118, "avg_line_length": 36.83838383838384, "alnum_prop": 0.6871401151631478, "repo_name": "pzajda/eloquence", "id": "47d609658dd2b6099010b52d93cf8896d6db6832", "size": "364...
""" Copyright 2015 Creare 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 writing...
{ "content_hash": "aaf9fde5a78a030413a93020b83bc043", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 79, "avg_line_length": 30.186274509803923, "alnum_prop": 0.6294251380318285, "repo_name": "perrygeo/pydem", "id": "e26ffd1c575652f83becdebd803522ff7f8c5211", "size": "3079...
""" Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.enums import HTTP_HEADER from lib.core.settings import WAF_ATTACK_VECTORS __product__ = "Incapsula Web Application Firewall (Incapsula/Imperva)" def detect(get_page): ...
{ "content_hash": "badea7c188632db0cf0cda17e7e4b599", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 111, "avg_line_length": 29.52173913043478, "alnum_prop": 0.6715758468335787, "repo_name": "JeyZeta/Dangerous", "id": "0ba8138a4a25e009f7cd76d684bcb301c433eb5c", "size": "70...
import os import Image, StringIO import allura from nose.tools import assert_true from ming.orm.ormsession import ThreadLocalORMSession from allura import model as M from allura.lib import helpers as h from allura.tests import decorators as td from alluratest.controller import TestController from forgewiki import m...
{ "content_hash": "2118ff6b32c3f2106a6fcc904df99927", "timestamp": "", "source": "github", "line_count": 517, "max_line_length": 116, "avg_line_length": 39.22050290135397, "alnum_prop": 0.5258174286137003, "repo_name": "leotrubach/sourceforge-allura", "id": "2f2bfa9107f39021967caef78d4518d5b59ff822", ...
''' @author: m0t ''' #search for blocks colored purple(0x9933cc) and creates a disabled breakpoint at the start of each. #To be used with process stalker to immediately see "interesting" blocks from idc import * from idautils import * purple = 0x9933cc #our definition of purple... #get start address of each funct...
{ "content_hash": "7e980b980195133e331a9762424ddee7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 99, "avg_line_length": 23.685714285714287, "alnum_prop": 0.7141133896260555, "repo_name": "m0t/ida-scripts", "id": "5eff4f616e1bf74af785abd760f50d2a582846ad", "size": "829"...
from django.contrib import admin from interview_project.models import House, Owner admin.site.register(House) admin.site.register(Owner)
{ "content_hash": "73e6c48795692f6e274ea6dbae078497", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 49, "avg_line_length": 27.6, "alnum_prop": 0.8260869565217391, "repo_name": "nick-garcia/interview_project", "id": "071a07f8cdf164e48b016cff878edd33e94d5334", "size": "138",...
import tempfile from pyontutils.config import auth __doc__ = f"""Client library generator for SciGraph REST api. Usage: scigraph-codegen [options] [--dynamic=<PATH>...] Options: -o --output-file=FILE save client library here [default: {tempfile.tempdir}/scigraph_client.py] -a --api=API ...
{ "content_hash": "7f6ab323bfb946b2f6d1f4ef74f75c48", "timestamp": "", "source": "github", "line_count": 973, "max_line_length": 134, "avg_line_length": 34.10791366906475, "alnum_prop": 0.5060113900021093, "repo_name": "tgbugs/pyontutils", "id": "536df437ce35ebaf4c9f4b8fadba8adc51b2140f", "size": "3...
from PySide import QtCore, QtGui class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(318, 130) self.g1 = QtGui.QGroupBox(Dialog) self.g1.setGeometry(QtCore.QRect(10, 10, 301, 80)) self.g1.setObjectName("g1") self.lblIP = Q...
{ "content_hash": "d11c462b01cd9eafd9bb1f23812acb03", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 132, "avg_line_length": 50.05882352941177, "alnum_prop": 0.6897767332549941, "repo_name": "prospero78/pyTrans", "id": "6bae8ea915f6ba4317f2aad40ad834d47bc29bff", "size": "2...
from random import randint from unittest import TestCase from rapidtest import Case, Result from rapidtest.executors import Operation, Operations from rapidtest.utils import nop, identity, randints class TestCase_(TestCase): def test_process_args(self): c = Case() res = c.process_args([1, 2, 3],...
{ "content_hash": "020b8e8a83beac6dbaf9006f5dabba63", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 92, "avg_line_length": 35.49612403100775, "alnum_prop": 0.5317754968333698, "repo_name": "yehzhang/RapidTest", "id": "81f206f9e91239b82535a9183c437658c9d72ac5", "size": "4...
"""Error codes - copied from the PS6000 programmer's manual.""" # To get formatting correct do following copy-replace in # Programmers Notepad # 1. Copy/replace ' - ' with '", "' # 2. Copy/replace '\r' with '"],\r' (enable slash expressions when doing) # 3. Copy/replace '^([0-9A-F]{2} ){1}' with '0x\1, "' (w/ regex) #...
{ "content_hash": "2d66efb470786753de34f689960cb5bf", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 51.67659574468085, "alnum_prop": 0.6655961791831357, "repo_name": "arunpersaud/pico-python", "id": "47cd7c0dbc3b7ef28b33685343cfe716ec30dcb9", "size...
import threading import socket import time class WorkerThread(threading.Thread): # task_queue = queue.Queue(maxsize=1) def __init__(self, task_q, serial_task_q): threading.Thread.__init__(self) global task_queue task_queue = task_q global serial_task_queue serial_task_...
{ "content_hash": "c28a4fc0b26150ea6fd6dd49a9c59a7c", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 97, "avg_line_length": 32.43382352941177, "alnum_prop": 0.4801632282929041, "repo_name": "Basecrayfish/LEDServer", "id": "a72236f7ff7757a47792c2e50778f17deca0aee4", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ('posts', '0004_auto_20151106_0329'), ] operations = [ migrations.AddField( model_name='post', ...
{ "content_hash": "0be3e83dbaa169d4437631c0d46f8e0a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 22.57894736842105, "alnum_prop": 0.5827505827505828, "repo_name": "tuanquanghpvn/bideox", "id": "11f86235e664a5731df60279bff2a56fb4b81f26", "size": "...
from __future__ import absolute_import, unicode_literals from chatpro.rooms.models import Room from dash.orgs.models import Org from dash.utils import intersection from dash.utils.sync import ChangeType from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugette...
{ "content_hash": "0cbd1fd52139d7e8549ad1e9b369bc3c", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 118, "avg_line_length": 37.1328125, "alnum_prop": 0.6225541763096991, "repo_name": "rapidpro/chatpro", "id": "f8b15f8afd5806b97eaab8b231b7fdb6c99ca614", "size": "4753", ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: vyos_lldp version_added: "2.4" author: "Ricardo Carrillo Cruz (@rcarrillocruz)" short_description: Manage LLDP configuration on VyOS network devices ...
{ "content_hash": "9a790a23e42cf4ece9dff15df1efde1e", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 93, "avg_line_length": 24.7, "alnum_prop": 0.6404858299595142, "repo_name": "SergeyCherepanov/ansible", "id": "88159ea4c4af5db9e2eddd28d9a193f95306d820", "size": "3217", ...
"""The device tracker tests for the Mazda Connected Services integration.""" from homeassistant.components.device_tracker import SOURCE_TYPE_GPS from homeassistant.components.device_tracker.const import ATTR_SOURCE_TYPE from homeassistant.const import ( ATTR_FRIENDLY_NAME, ATTR_ICON, ATTR_LATITUDE, ATTR...
{ "content_hash": "d887123fa0ab5127e7ea3df908b2c03e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 38.233333333333334, "alnum_prop": 0.7436791630340017, "repo_name": "toddeye/home-assistant", "id": "4af367c1c04b1e5c0aa54c03a43f9a78d3602c84", "size"...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'EnginePatch.migrate_engine_equivalent_patch' db.delete_column(u'physical_engine...
{ "content_hash": "e95dab7f7b459c99fcba0f6a09ec85b6", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 239, "avg_line_length": 94.0105633802817, "alnum_prop": 0.5653395258249373, "repo_name": "globocom/database-as-a-service", "id": "06bb158d0aee23dc8e389c5a979072e353e0eb9d", ...
import bouncebox.core.api as bb import pandas as pd class TestEventComponent(bb.Component): listeners = [(bb.Event, "handle_event")] def __init__(self): super(TestEventComponent, self).__init__() self.sum = 0 def handle_event(self, event): print event def end(self, _event): ...
{ "content_hash": "8aad4b15ea7ae9fbacaa2eec9245a5ab", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 61, "avg_line_length": 22.366666666666667, "alnum_prop": 0.6736214605067065, "repo_name": "dalejung/bouncebox", "id": "336f3ae37ab299f23f254c9f4301590c31ead743", "size": "6...
from PyQt4 import QtCore, QtGui from resources import Resources class Systray(QtGui.QSystemTrayIcon): urgent = False def __init__(self, window): super(Systray, self).__init__(QtGui.QIcon.fromTheme("scudcloud"), window) self.connect(self, QtCore.SIGNAL("activated(QSystemTrayIcon::ActivationRea...
{ "content_hash": "f7d448b707c5767e485bc1d39a872406", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 110, "avg_line_length": 37.745098039215684, "alnum_prop": 0.623896103896104, "repo_name": "aikikode/scudcloud", "id": "1cc38bf2358d45b0d1d012945e5bc5b6a5fa4b20", "size": "1...
import os import re # ccbb libraries from ccbbucsd.utilities.analysis_run_prefixes import get_timestamp, get_run_prefix from ccbbucsd.utilities.notebook_runner import execute_notebook, export_notebook_to_html __author__ = "Amanda Birmingham" __maintainer__ = "Amanda Birmingham" __email__ = "[email protected]" __st...
{ "content_hash": "df434bdf39c0b759e8f818bf9f1b03a5", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 111, "avg_line_length": 37.68888888888889, "alnum_prop": 0.7037146226415094, "repo_name": "ucsd-ccbb/jupyter-genomics", "id": "a1670575b03a25cc5e89bfcaf08724a2df052c89", "s...
import io import logging import os import pathlib import pstats import tempfile import unittest from unittest import mock import openhtf from openhtf import plugs from openhtf.core import base_plugs from openhtf.util import test from openhtf.util import validators class DummyError(Exception): """Raised for testin...
{ "content_hash": "3a5be7738ac8e3bb8471d91339a8cca1", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 97, "avg_line_length": 34.495384615384616, "alnum_prop": 0.7149228436357149, "repo_name": "google/openhtf", "id": "af139999a639da5a5d5ab0f9b1636f5eeda9a3b3", "size": "1180...
import tulip messages = tulip.DataBuffer() messages.feed_data('a message') @tulip.task def print_messages(): while True: print((yield from messages.read())) print_task = print_messages() loop = tulip.get_event_loop() loop.call_later(1, print_task.cancel) loop.call_later(2, messages.feed_eof) loop.call_l...
{ "content_hash": "b89074ae6e44f4d998db0f0b7c07537f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 43, "avg_line_length": 21.058823529411764, "alnum_prop": 0.7122905027932961, "repo_name": "bslatkin/pycon2014", "id": "2e1e39db822090c22865ebe65a91360e2ae902bc", "size": "3...
""" Tasks for running a command in a subprocess Command - run a command with optional environment variables SalesforceCommand - run a command with credentials passed SalesforceBrowserTest - a task designed to wrap browser testing that could run locally or remotely """ import json import os imp...
{ "content_hash": "351e5f61e6336d8b2844b6913027a3cb", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 93, "avg_line_length": 34.41237113402062, "alnum_prop": 0.5681545835829839, "repo_name": "e02d96ec16/CumulusCI", "id": "ff85b2168c257a8843d3eb2290e496b2227ab493", "size": ...
from socketserver import ThreadingMixIn from http.server import SimpleHTTPRequestHandler, HTTPServer class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): pass def get_input(): import argparse parser = argparse.ArgumentParser(description='test http server') parser.add_argument('--host', '-ho', de...
{ "content_hash": "8e25657c49944a5a9fa07432f624d827", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 27.70967741935484, "alnum_prop": 0.6344586728754366, "repo_name": "umyuu/Sample", "id": "dcb5c25761f49ffd45b12f93d358adec37cc842e", "size": "883", ...
"""Tests for the parsers manager.""" import unittest from plaso.parsers import interface from plaso.parsers import manager from plaso.parsers import plugins from tests import test_lib as shared_test_lib class TestParser(interface.BaseParser): """Test parser.""" NAME = u'test_parser' DESCRIPTION = u'Test par...
{ "content_hash": "60119b913f236e508cddd56a639ac389", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 79, "avg_line_length": 37.3810888252149, "alnum_prop": 0.7205273647094895, "repo_name": "dc3-plaso/plaso", "id": "552f42670f1cb8d2e52ed45b0765954030a5eb13", "size": "13088...
def dotproduct(x,y): return math.sqrt(x**2 + y**2) # This is used to convert the meters per second velocity into a miles per hour value. def tomph(velocity): return velocity * 2.24 ''' This function is used to convert the units for increment traveled from meters to feet; because we measure over each secon...
{ "content_hash": "c4204bd3938368ea644f1818ca01650d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 124, "avg_line_length": 19.75, "alnum_prop": 0.679324894514768, "repo_name": "georgetown-analytics/skidmarks", "id": "453b6fe895d881f4faf3e3a65f1e878c0e214cf6", "size": "17...
from unittest import main from qiita_pet.test.tornado_test_base import TestHandlerBase from qiita_db.handlers.tests.oauthbase import OauthTestingBase class StudyIndexHandlerTests(TestHandlerBase): def test_get_exists(self): response = self.get('/study/description/1') self.assertEqual(response.cod...
{ "content_hash": "48de3245da6b235e7fcd202784199efd", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 34.333333333333336, "alnum_prop": 0.591886269070735, "repo_name": "josenavas/QiiTa", "id": "d8e60f423d69326837690383e332c8dd82e58022", "size": "3234"...
""" =============================================== Reconstruct with Generalized Q-Sampling Imaging =============================================== We show how to apply Generalized Q-Sampling Imaging (Yeh et al. IEEE TMI 2010) to diffusion MRI datasets. You can think of GQI as an analytical version of DSI orientation ...
{ "content_hash": "5d419a24184733fbc30b5a6ea093603b", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 84, "avg_line_length": 23.965034965034967, "alnum_prop": 0.6247446746425445, "repo_name": "maurozucchelli/dipy", "id": "197eb89e15a66380bd64a5277e21c208ea172fac", "size": ...
"""This module contains test for KeyValue helpers.""" __author__ = "Krzysztof Trzepla" __copyright__ = """(C) 2016 ACK CYFRONET AGH, This software is released under the MIT license cited in 'LICENSE.txt'.""" from test_common import * from common_test_base import * import pytest THREAD_NUMBER = 8 BLOCK_SIZE = 1024 d...
{ "content_hash": "ea836697aae9b7a73c888cb2d50035e2", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 80, "avg_line_length": 33.64, "alnum_prop": 0.6492271105826397, "repo_name": "onedata/helpers", "id": "6f5737b8af2ff0c9f91612f53e769576ea314d04", "size": "3364", "binary...
import random originalKey = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] class Rotors(object): def __init__(self, *args): self.originalDict = [i for i in originalKey] ...
{ "content_hash": "e826af9730145d51acecdc7af8237b14", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 70, "avg_line_length": 28.112903225806452, "alnum_prop": 0.5364314400458978, "repo_name": "ccqpein/Enigma-machine-sample", "id": "e153fd83a83f989e98bd6aa839b94b6778662050", ...
""" Common Policy Engine Implementation Policies can be expressed in one of two forms: A list of lists, or a string written in the new policy language. In the list-of-lists representation, each check inside the innermost list is combined as with an "and" conjunction--for that check to pass, all the specified checks m...
{ "content_hash": "712c88798016b1864ec6bd6f988a2983", "timestamp": "", "source": "github", "line_count": 909, "max_line_length": 78, "avg_line_length": 30.88998899889989, "alnum_prop": 0.5958189394209196, "repo_name": "mrunge/openstack_horizon", "id": "b4185e65360da062c4d7d53fda82562bf93c39c7", "siz...
"""Forms for the ``enquiry`` app."""
{ "content_hash": "1c80a49ab98083d6a9803da5e9b18f22", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.5675675675675675, "repo_name": "bitmazk/django-enquiry", "id": "e83efd218b5c98f9d1184a3a137f41475da49c82", "size": "37", "binary...
import os.path as op import warnings import numpy as np from numpy.testing import assert_raises from mne import io, read_events, read_cov, read_source_spaces from mne import SourceEstimate from mne.datasets import sample from mne.viz import plot_cov, plot_bem, plot_events from mne.viz import plot_source_spectrogram ...
{ "content_hash": "b564e026d77c38ca878e2743b53e0b2c", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 79, "avg_line_length": 35.333333333333336, "alnum_prop": 0.6283018867924528, "repo_name": "jaeilepp/eggie", "id": "8b76ccf8e369120b26eb9d331245220f105240ee", "size": "4058...
from snp import SNPService, SNProtocolClientFactory, Script, CertManager from Config import Config from twisted.internet import reactor, ssl from TelegramService import TelegramService class MainService(SNPService): def __init__(self): SNPService.__init__(self) self.config = Config.getconf() ...
{ "content_hash": "5234f6f025ea8381a997485de2bb734b", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 119, "avg_line_length": 37.02272727272727, "alnum_prop": 0.5776550030693677, "repo_name": "tsnik/SkyNet", "id": "94889d3813c9c1e3417977e0093e51108d9f681d", "size": "3258", ...
try: from setuptools import setup, find_packages except ImportError: from distribute_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages version = "0.5.0" setup( name="hflossk", version=version, description="HFOSS course materials via flask", classi...
{ "content_hash": "2708f20dd880b3871803999f36bdb909", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 65, "avg_line_length": 22.354166666666668, "alnum_prop": 0.581547064305685, "repo_name": "decause/hflossk", "id": "f0bb404c783a7f1763c6c7a934cd9442fc1b57e5", "size": "1115"...
import urllib2 import gzip import re import sys from StringIO import StringIO from bs4 import BeautifulSoup __author__ = 'cheyulin' def loadData(url): request = urllib2.Request(url) request.add_header('Accept-encoding', 'gzip') response = urllib2.urlopen(request) print response.info().get('Content-En...
{ "content_hash": "b67189c91b6fc1325a723dcc26f5a0ac", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 82, "avg_line_length": 35.82, "alnum_prop": 0.5896147403685092, "repo_name": "YcheLanguageStudio/PythonStudy", "id": "af5c49dd9107b197cbc087d8323c96cc2f598371", "size": "17...
import os __version__ = open(os.path.join(os.path.dirname(__file__),'VERSION')).read().strip() from fields import JSONField
{ "content_hash": "c5cd1d0d050dd95ce3d9c0ae683ab1f2", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 84, "avg_line_length": 31.25, "alnum_prop": 0.696, "repo_name": "danigosa/django-jsonfield", "id": "c88faebc19ecdaa010aba883a4eb10fac096139a", "size": "125", "binary": fal...
"""Script for running all gpkit unit tests""" from gpkit.tests.helpers import run_tests def import_tests(): """Get a list of all GPkit unit test TestCases""" tests = [] from gpkit.tests import t_tools tests += t_tools.TESTS from gpkit.tests import t_sub tests += t_sub.TESTS from gpkit.t...
{ "content_hash": "90369497df3487f48d5cb15f10c61874", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 69, "avg_line_length": 23.311475409836067, "alnum_prop": 0.6490857946554149, "repo_name": "hoburg/gpkit", "id": "1d5148753124069a2261ada2656b5901e4b98400", "size": "1422", ...
from base import (BaseDict, BaseList, TopLevelDocumentMetaclass, get_document) from fields import (ReferenceField, ListField, DictField, MapField) from connection import get_db from queryset import QuerySet from document import Document class DeReference(object): def __call__(self, items, max_depth=1, instance=N...
{ "content_hash": "060ab07d7e08129bc714c5abf3b01d32", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 112, "avg_line_length": 44.81621621621622, "alnum_prop": 0.539741888795079, "repo_name": "mouadino/pyes", "id": "d83da7c32f5e80e036fef6e24fd1525647961d12", "size": "8338",...
print('Finding Half Light Radii and Corresponding Slopes') import astropy.table as table import numpy as np import matplotlib.pyplot as plt from defcuts import * from def_get_mags import * from def_lump_prof import * from my_def_plots import * from defflags import * indir='/Users/amandanewmark/repositories/galaxy_da...
{ "content_hash": "9d05dff9674a5d2581e86235da574881", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 188, "avg_line_length": 31.03125, "alnum_prop": 0.7275931520644512, "repo_name": "anewmark/galaxy_dark_matter", "id": "c50ab19b7edab394ff2fd0a0e5d3834cbe89d1c9", "size": "1...
from pyswagger import App, primitives, errs, io from ..utils import get_test_data_folder from pyswagger.spec.v2_0 import objects, parser from pyswagger.spec import base from pyswagger.utils import jp_compose from pyswagger.primitives import Primitive import os import unittest import datetime import six class SchemaTe...
{ "content_hash": "4d49ad01138a6e00eda51f252c4076e9", "timestamp": "", "source": "github", "line_count": 559, "max_line_length": 136, "avg_line_length": 36.075134168157426, "alnum_prop": 0.5638202915798869, "repo_name": "mission-liao/pyswagger", "id": "a3932b41e9b9bd00ccba5e64fa4e4d5327f4e032", "siz...
""" sdep.__main__ is executed when `sdep` is called as a script from the command line. """ from .cli import main main()
{ "content_hash": "5467c80fac4ddae53d2af38e59809167", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 76, "avg_line_length": 17.285714285714285, "alnum_prop": 0.6776859504132231, "repo_name": "mattjmcnaughton/sdep", "id": "89796b7fb6774fdf3a1901bc47227b4f90bf4d48", "size": "...
"""Script to auto-generate API docs. """ from __future__ import print_function, division # stdlib imports import sys import re # local imports from apigen import ApiDocWriter # version comparison from distutils.version import LooseVersion as V #***********************************************************************...
{ "content_hash": "75f5ee8ba932ce04b233b7dcb0aa5e75", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 32.46153846153846, "alnum_prop": 0.595260663507109, "repo_name": "kpolimis/sklearn-forest-ci", "id": "5fe41e7b65bf7ffc7fc3903cb9643eaa4710452d", "siz...
import time import RPi.GPIO as GPIO from calvin.runtime.south.plugins.io.gpio import base_gpiopin class GPIOPin(base_gpiopin.GPIOPinBase): """ Raspberry Pi gpio pin implementation based on the RPi.GPIO package """ def __init__(self, trigger, pin, direction, pull): super(GPIOPin, self).__init__...
{ "content_hash": "a1d67657c3f84a109f6e6a8fd834893d", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 87, "avg_line_length": 29.305882352941175, "alnum_prop": 0.5636290646326776, "repo_name": "josrolgil/exjobbCalvin", "id": "b819a6a8a5fd7f1a1e3ee506232cb20c483fffe3", "size"...
import sys import zmq import pymongo import pymongo.json_util import json class MongoZMQ(object): """ ZMQ server that adds/fetches documents (ie dictionaries) to a MongoDB. NOTE: mongod must be started before using this class """ def __init__(self, db_name, table_name, bind_addr="tcp://127.0.0.1:...
{ "content_hash": "024476da9413de872e4e8cd6e4242441", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 92, "avg_line_length": 32.30952380952381, "alnum_prop": 0.547162859248342, "repo_name": "swn1/pyzmq", "id": "c1a10fc4655256bb47cdc265aff12f0d18765edd", "size": "3052", "b...
import datetime import logging import requests from django.utils import timezone from . import AbstractFeed, AbstractFeedQuery, FeedError, FeedItem logger = logging.getLogger('wagtailsocialfeed') class InstagramFeedItem(FeedItem): """Implements instagram-specific behaviour""" @classmethod def get_post...
{ "content_hash": "20255dd9cc0caa804821a3e7d75be689", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 82, "avg_line_length": 29.82716049382716, "alnum_prop": 0.5629139072847682, "repo_name": "LUKKIEN/wagtailsocialfeed", "id": "939b1e99b227fe7af8aaca4251ee58925c3c598a", "siz...
import argparse import os import simpleaudio as sa def soundOut (soundName) : files = { 'roar':'chewy_roar.wav', 'battle':'light-sabre-battle.wav', 'sabreon':'light-sabre-on.wav', 'sabroff':'light-sabre-off.wav', 'breathing':'starwar-vader-breathing.wav', } path=os...
{ "content_hash": "d018e3c5137fa54119d748684abb741b", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 73, "avg_line_length": 29.289473684210527, "alnum_prop": 0.6082659478885895, "repo_name": "melvinma/funbots", "id": "f3b38b7c1f976cd4b702554d8e52ee2ae9159afc", "size": "111...
from SPARQLWrapper import SPARQLWrapper, JSON import os import sys import array import re # This function checks if the given string has a direct resource in dbpedia database # and returns the resource URL def getDirectResourceUrl(locationString, database): #database.setQuery("""SELECT DISTINCT ?Dir WHERE {?Dir rd...
{ "content_hash": "0e6eca32351981d9f03e4e2c05482ba4", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 118, "avg_line_length": 33.939189189189186, "alnum_prop": 0.7075452916583715, "repo_name": "andpol5/QueryParsingForInlp", "id": "587b2278af7b22bd80f422e5a626801ce4ca5903", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_geopostcodes', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='locality', options={'verbose_nam...
{ "content_hash": "bab4199e4410d87cc39fcce01b705090", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 119, "avg_line_length": 30.703703703703702, "alnum_prop": 0.5958986731001207, "repo_name": "alexhayes/django-geopostcodes", "id": "1dffda4fdb44d38b60a6b57ce5f0c817e02a0d98", ...
from __future__ import absolute_import import unittest import six from telemetry.core import os_version as os_version_module from telemetry.story import expectations from telemetry.testing import fakes class MockState(): def __init__(self): self.platform = fakes.FakePlatform() class MockStory(): def __ini...
{ "content_hash": "f3f0b88bab4443028bee9b2092c787eb", "timestamp": "", "source": "github", "line_count": 479, "max_line_length": 80, "avg_line_length": 39.95824634655532, "alnum_prop": 0.6508359456635319, "repo_name": "catapult-project/catapult", "id": "9d782ef4a6af9981976b5f398501a7d05dca6dcc", "si...
from c7n.resources.elasticache import _cluster_eligible_for_snapshot from .common import BaseTest class TestElastiCacheCluster(BaseTest): def test_eligibility_snapshot(self): # so black box testing, due to use of private interface. self.assertTrue( _cluster_eligible_for_snapshot( ...
{ "content_hash": "f2913cc2e0f545ecd62e971e172b2550", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 99, "avg_line_length": 39.71729957805907, "alnum_prop": 0.537873154148518, "repo_name": "capitalone/cloud-custodian", "id": "49bc3924e40449fc1fe30e7eca9b6b6707d77b69", "si...
import sys from keystoneclient.common import cms from oslo_log import log from oslo_log import versionutils from oslo_serialization import jsonutils from oslo_utils import importutils import six import stevedore from keystone.common import controller from keystone.common import dependency from keystone.common import ...
{ "content_hash": "fc5af1563eab63e131168a6772a0a320", "timestamp": "", "source": "github", "line_count": 669, "max_line_length": 79, "avg_line_length": 41.92974588938714, "alnum_prop": 0.5708530890164344, "repo_name": "cernops/keystone", "id": "6d32ad63817ab4f9f87b377e6055de85ea34ffbf", "size": "286...
import argparse parser = argparse.ArgumentParser(description='ARAE for 1Bword dataset') # Path Arguments parser.add_argument('--data_path', type=str, required=True, help='location of the data corpus') parser.add_argument('--kenlm_path', type=str, default='./kenlm', help='path to...
{ "content_hash": "76a01e31f238f52c073bf6e51e8970e8", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 51.3921568627451, "alnum_prop": 0.6163677985501717, "repo_name": "jakezhaojb/ARAE", "id": "d986ef3e5f9e98d312ebaf9da2c08589a0d0d26c", "size": "5242"...
from bottle import Bottle, run, static_file, request import os, bottle, gphoto, shutil, time, camerapi_config app = Bottle() @app.route('/listconfig') def list_config(): return gphoto.get_list(['--list-config']) @app.route('/getconfig') def get_config(): querystring = request.query.configkey.strip() return g...
{ "content_hash": "e93ca4f6f46e679a3c425154406b21aa", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 146, "avg_line_length": 30.8, "alnum_prop": 0.7094155844155844, "repo_name": "RezaMahmood/CameraPi", "id": "17b580285b7e9a8762bac749cd1c7979fd38e9c3", "size": "1848", "bi...
from django.shortcuts import render, get_object_or_404 from .models import Question, Reply, Comment from django.contrib.auth.decorators import login_required from django.http.response import HttpResponse from django.db.models import Q from django.core.cache import cache # Create your views here. from zhihuuser.models ...
{ "content_hash": "78e4389f386e3bfa8fb0c2ff1f8f3105", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 178, "avg_line_length": 43.705555555555556, "alnum_prop": 0.5858650057200966, "repo_name": "threegirl2014/zhihuCopy", "id": "81e5ce75aa7117a0d1e8a1840123b51c19de0541", "si...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
{ "content_hash": "1702f9923c29ef7178e35c0f30b6d5e7", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 99, "avg_line_length": 26.154882154882156, "alnum_prop": 0.5935890834191555, "repo_name": "Laurawly/tvm-1", "id": "21c460fa037169a3591e245227be92e364034d61", "size": "7768...
import copy import functools from tools.api_proto_plugin import plugin from tools.api_proto_plugin import visitor from tools.protoxform import migrate from tools.protoxform import utils # Note: we have to include those proto definitions to ensure we don't lose these # during FileDescriptorProto printing. from google....
{ "content_hash": "f048beb270153c6932fc1ce4f2169f2d", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 93, "avg_line_length": 42.20879120879121, "alnum_prop": 0.6894038010934652, "repo_name": "istio/envoy", "id": "9331877aa17fcc8e86f0b636f14e3be4228b1a93", "size": "4155", ...
""" Flex Messaging compatibility tests. @since: 0.3.2 """ import unittest import datetime import uuid import pyamf from pyamf.flex import messaging class AbstractMessageTestCase(unittest.TestCase): def test_repr(self): a = messaging.AbstractMessage() a.body = u'é,è' try: r...
{ "content_hash": "ecc6b88dc33299e3fcb48a7cde6dfba2", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 171, "avg_line_length": 33.71634615384615, "alnum_prop": 0.6331099386852987, "repo_name": "cardmagic/PyAMF", "id": "4bb52989c79af80edc0ad1da422ea7128c71ad64", "size": "711...
from __future__ import print_function import pandas as pd from glob import glob import numpy as np from itertools import combinations from sklearn.cross_validation import train_test_split from sklearn.grid_search import RandomizedSearchCV from sklearn.metrics import classification_report, confusion_matrix from sklearn....
{ "content_hash": "712cc4ae550780586e901155b930194d", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 77, "avg_line_length": 33.22875816993464, "alnum_prop": 0.5871361132966169, "repo_name": "boada/vpCluster", "id": "95cdf2264ea58f75c2e4ae070a4ab1fc6b3bcd51", "size": "5084...
from nitrile import *
{ "content_hash": "b91c49134603e75953a5feaa1e1d737c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 21, "alnum_prop": 0.8095238095238095, "repo_name": "barrettedwards/nitrile", "id": "91853fb7883347e9a35b77fb11bcf59a56c11a59", "size": "21", "binary...
"""Lookup table operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_shape from tensorflow.python.ops import ...
{ "content_hash": "af48e58b9956b91d7e5ab25c97dbfc96", "timestamp": "", "source": "github", "line_count": 659, "max_line_length": 80, "avg_line_length": 38.43702579666161, "alnum_prop": 0.6609159099881563, "repo_name": "Xeralux/tensorflow", "id": "a03e731be32c5964cb4aece8e8a67525883a4e7c", "size": "2...
from ginga.qtw.QtHelp import QtGui, QtCore from ginga.qtw import QtHelp from ginga.qtw import FitsImageCanvasTypesQt as CanvasTypes from ginga import GingaPlugin draw_colors = ['white', 'black', 'red', 'yellow', 'blue', 'green', 'pink', 'cyan', 'magenta', 'turquoise', 'aquamarine', 'purple'] default_d...
{ "content_hash": "80f771b0ca7ea95405f4cff444b85a51", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 74, "avg_line_length": 30.650306748466257, "alnum_prop": 0.5960768614891914, "repo_name": "astrofrog/ginga", "id": "04980a148792fa45bb1379fde02508bbe442a2d4", "size": "525...
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ...
{ "content_hash": "bba10fec58bc883d42d29aa337651c6c", "timestamp": "", "source": "github", "line_count": 1142, "max_line_length": 120, "avg_line_length": 40.69264448336252, "alnum_prop": 0.5774784274063395, "repo_name": "Azure/azure-sdk-for-python", "id": "624f9722d98c763e0d6870578095d870c3bb8c42", ...
import numpy as np class Base(object): @staticmethod def data_n(): """ Updates train_n and test_n numeric datasets (used for model data creation) based on numeric datatypes from train and test datasets. """ Base.train_n = Base.train.select_dtypes(include=[np.number]) Bas...
{ "content_hash": "65f4699df7f33d228ed806da1c50a1f5", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 139, "avg_line_length": 37.6, "alnum_prop": 0.6569148936170213, "repo_name": "Speedml/speedml", "id": "360371791ebfd81031e3a44888eb182599e8b22d", "size": "376", "binary":...
from plugin import (utils, constants, connection, ) from cloudify import ctx from cloudify.decorators import operation @operation def create(**_): """Create a storage account. :param ctx: The Cloudify ctx context. :return: The status code of th...
{ "content_hash": "f9b8a3c9d4a799944260f5286b94c4ee", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 99, "avg_line_length": 34.50877192982456, "alnum_prop": 0.6137519064565328, "repo_name": "fastconnect/cloudify-azure-plugin", "id": "0299321f802ce7a18095cd87313f9191a0c2c9eb...
from __future__ import absolute_import from apptools.help.help_plugin.preferences_pages import *
{ "content_hash": "a1589770fb869070e601faf73b078a8e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 57, "avg_line_length": 48.5, "alnum_prop": 0.8041237113402062, "repo_name": "enthought/etsproxy", "id": "6d477c6c79e3dab8deee88131dbbddf1c5c90cb4", "size": "112", "binary"...
"""Course explorer module.""" __author__ = 'Rahul Singal ([email protected])' from common import users from controllers import utils from models import custom_modules from models.config import ConfigProperty from models.models import StudentProfileDAO from modules.course_explorer import messages from modules.cou...
{ "content_hash": "8170361ec83fe72496565a81e1ae8673", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 31.333333333333332, "alnum_prop": 0.7007400555041629, "repo_name": "ram8647/gcb-mobilecsp", "id": "5053daff75acb494f6bee0692fcdec22fc2375b0", "size":...
"""A powerful dynamic attention wrapper object.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import functools import math import numpy as np from tensorflow.contrib.framework.python.framework import tensor_util from tensorflow.pyt...
{ "content_hash": "b69f5c7867fde8041f9139eeea109960", "timestamp": "", "source": "github", "line_count": 2524, "max_line_length": 118, "avg_line_length": 41.83280507131537, "alnum_prop": 0.6630424488095013, "repo_name": "chemelnucfin/tensorflow", "id": "0e19d1e320520f9ffe0017dadd1caf9c834e1054", "si...
import pygame import math class Tree: root = None _next_id = -1 depth = -1 numChildren = -1 positions = {} # (index,depth) array def __init__(self,depth,numChildren): self.depth = depth self.numChildren = numChildren self.root = self.buildTree(self.depth,self.getNextId) self.setIndexes(self.root,self.num...
{ "content_hash": "4ca916e016ab95936eb488f91b66f41e", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 133, "avg_line_length": 31.238938053097346, "alnum_prop": 0.6920679886685552, "repo_name": "shrub77/avtomation-blog-code", "id": "e42dda8c06ebfb4f68ae21b0a2167aab30949e4e", ...
import json import os class Configuration(object): def __init__(self, directory): self.package = None self.name = None self.icon_name = None self.version = None self.numeric_version = None self.orientation = None self.permissions = [] ...
{ "content_hash": "eae4a1551a959d1ce30383f14c8b5891", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 197, "avg_line_length": 34.51592356687898, "alnum_prop": 0.6252076028787599, "repo_name": "pymo/pymo", "id": "00c026a0636ec4e47af42d826dbfa21d5e216f14", "size": "5419", ...
import argparse import csv import sys from gzip import GzipFile import numpy as np from gensim.models.word2vec import Word2Vec parser = argparse.ArgumentParser(description='Expansion.') parser.add_argument('-d', default=1, nargs='?', type=float) parser.add_argument('--w2v', required=True, type=argparse.FileType('rb')...
{ "content_hash": "f0dbf0978e86a1ea33c3453045ae2259", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 112, "avg_line_length": 29.97872340425532, "alnum_prop": 0.6628814762242725, "repo_name": "dustalov/watlink", "id": "39dafa416094e161e615985cf8dbf37f56b410ca", "size": "143...
""" This tests the moist saturated hydrostatic balance, by setting up a vertical slice with the appropriate initialisation procedure, before taking a few time steps and ensuring that the resulting velocities are very small. """ from gusto import * from firedrake import (PeriodicIntervalMesh, ExtrudedMesh, Constant, Fu...
{ "content_hash": "77cc119ce4a04cab9f22377272f905c5", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 95, "avg_line_length": 34.156028368794324, "alnum_prop": 0.6214700996677741, "repo_name": "firedrakeproject/gusto", "id": "fa61406f5bc50e7ef67fbcddcd4378fa44f9d0eb", "size...
import datetime import functools import os import re import urllib from flask import (Flask, abort, flash, Markup, redirect, render_template, request, Response, session, url_for) from markdown import markdown from markdown.extensions.codehilite import CodeHiliteExtension from markdown.extensions.ext...
{ "content_hash": "e0d9150b51e323923a0d56f869fa0beb", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 79, "avg_line_length": 33.055813953488375, "alnum_prop": 0.6134796679330238, "repo_name": "artopping/nyu-python", "id": "d9f4adb8b75d4925ec6674a5d4be3ebaf9000bc4", "size":...
from lino.api import dd, rt, _ from lino_xl.lib.ledger.ui import ( PartnerVouchers, ByJournal, PrintableByJournal, Movements, MovementsByVoucher) from lino_xl.lib.ledger.choicelists import TradeTypes, VoucherTypes from lino_xl.lib.ledger.roles import LedgerUser, LedgerStaff from lino_xl.lib.ledger.mixins impo...
{ "content_hash": "272a5a05368068116150b2a4cf1ee24c", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 112, "avg_line_length": 31.49473684210526, "alnum_prop": 0.6789772727272727, "repo_name": "lino-framework/xl", "id": "4fe768d0521a64e67aa8231ee8b103ee1be35330", "size": "6...
from flask import render_template, session, redirect, url_for, request, current_app from . import main from flask.ext.login import login_required @main.route('/') def index(): return render_template('main/index.html')
{ "content_hash": "684735238f0b118b16ad1501ff14d023", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 17.615384615384617, "alnum_prop": 0.7292576419213974, "repo_name": "youqingkui/wx.youqingkui.me", "id": "f5df7cc24bb9b12d893a8a0ba05273d33d9a785c", "...
import sys, os import zipfile from lxml import etree def get_epub_info(fname, forceMime = False): ns = { 'n':'urn:oasis:names:tc:opendocument:xmlns:container', 'pkg':'http://www.idpf.org/2007/opf', 'dc':'http://purl.org/dc/elements/1.1/' } # prepare to read from the .epub file ...
{ "content_hash": "fea17391a947b8e6b376dc8c6434a85a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 77, "avg_line_length": 26.75, "alnum_prop": 0.5747663551401869, "repo_name": "pzia/keepmydatas", "id": "b69c8cfab062b3924f9e39fc370a5c93464c7224", "size": "1284", "binary...
""" AutoProcessor class.""" import importlib import inspect import json from collections import OrderedDict # Build the list of all feature extractors from ...configuration_utils import PretrainedConfig from ...dynamic_module_utils import get_class_from_dynamic_module from ...feature_extraction_utils import FeatureExt...
{ "content_hash": "f37ac5428ce19ffd0690a2ee818f9096", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 125, "avg_line_length": 49.311418685121104, "alnum_prop": 0.628657638060487, "repo_name": "huggingface/transformers", "id": "06d44ab33e7640942a16330d119ac748dd8c12e4", "si...
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineRespo...
{ "content_hash": "7b7641d31d06c6bcb3baa2d8017e2f52", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 216, "avg_line_length": 48.12709497206704, "alnum_prop": 0.6561420818944252, "repo_name": "Azure/azure-sdk-for-python", "id": "75ae364e9246fd2c8933f406a0ec44f6b299ad8f", "...
"""This module implements enough functionality to program the STM32F4xx over DFU, without requiring dfu-util. See app note AN3156 for a description of the DFU protocol. See document UM0391 for a dscription of the DFuse file. """ from __future__ import print_function import argparse import collections import inspect ...
{ "content_hash": "dbebb94307ba51aadd203a7b9b8d8b8b", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 99, "avg_line_length": 31.8562197092084, "alnum_prop": 0.5789847355342563, "repo_name": "adafruit/circuitpython", "id": "ce34b08a58842b6b7c3a1c3899d8d9b98c6c8a74", "size":...
""" Middleware to replace the plain text message body of an error response with one formatted so the client can parse it. Based on pecan.middleware.errordocument """ import json import six from zun.common.i18n import _ class ParsableErrorMiddleware(object): """Replace error body with something the client can p...
{ "content_hash": "bd1149c59779422add94f2cfd174040e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 35.77777777777778, "alnum_prop": 0.48274672187715667, "repo_name": "kevin-zhaoshuai/zun", "id": "1e02d42970760a1468dae3a525d9d987c48ef0e6", "size": "...
import functools # Module symbols to export __all__ = ('operators', 'get') # List of built-in operators operators = ( # Module name # Operator class to import ('attributes', ), ('url', 'UrlOperator'), ('body', 'BodyOperator'), ('json_body', 'JsonOperator'), ('method', '...
{ "content_hash": "4182425568177a9237477f880248590d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 29.783783783783782, "alnum_prop": 0.604355716878403, "repo_name": "grappa-py/http", "id": "06b31e47a2950e40c4894165df078d515221b3fe", "size": "1126",...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
{ "content_hash": "7bae5b158cff0cfc1c71b774ec248d54", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 116, "avg_line_length": 45.136986301369866, "alnum_prop": 0.7705614567526555, "repo_name": "Jay-Jay-D/LeanSTP", "id": "c8b4fa0ad728fc597b1d54aa4ddf25e8b6e937a8", "size": "3...
"""209. Minimum Size Subarray Sum https://leetcode.com/problems/minimum-size-subarray-sum/ Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't one, return 0 instead. Example: Input: s = 7, nums = [2,3,1,2,4,3] Output: 2...
{ "content_hash": "4272d252bc5fb52c342fd89676ee26b1", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 27.463414634146343, "alnum_prop": 0.5488454706927176, "repo_name": "isudox/leetcode-solution", "id": "392fdec4063bb20a18b9ac9b23565b6328452628", "siz...
import datetime from django.db import connection, models from django.core.management.color import no_style from django.db.utils import DatabaseError from south.db import generic class DatabaseOperations(generic.DatabaseOperations): backend_name = 'firebird' alter_string_set_type = 'ALTER %(column)s TYPE %(ty...
{ "content_hash": "0549def62adfd6499653b8a58f98b62a", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 142, "avg_line_length": 41.372168284789645, "alnum_prop": 0.5622653316645807, "repo_name": "mozilla/make.mozilla.org", "id": "7f47cf79242774dc927bbb8365201448bc3664b5", "s...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('characters', '0002_alignment'), ] operations = [ migrations.CreateModel( name='Class', fields=[ ('id', model...
{ "content_hash": "ee0b73d3ad472806815b124a2b3c9095", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 114, "avg_line_length": 29.37142857142857, "alnum_prop": 0.5058365758754864, "repo_name": "mpirnat/django-tutorial-v2", "id": "fbdf75700c0bc20661afb443e1d24f7dabb0b948", "s...
"""Common argument parsing-related code for unexpected pass finders.""" import logging def AddCommonArguments(parser): """Adds arguments that are common to all unexpected pass finders. Args: parser: An argparse.ArgumentParser instance to add arguments to. """ parser.add_argument('--project', ...
{ "content_hash": "c183c6a5c84efc03bdc09fb466aa9b3c", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 80, "avg_line_length": 41.92857142857143, "alnum_prop": 0.5227143668370244, "repo_name": "ric2b/Vivaldi-browser", "id": "66abbd85f1a6d499b60d0b08999824f4f301a8cb", "size": ...
try: import wpilib except ImportError: from pyfrc import wpilib class Drive(object): ''' The sole interaction between the robot and its driving system occurs here. Anything that wants to drive the robot must go through this class. ''' def __init__(self, robotDrive, analog_channel,gyro): ''' Constructo...
{ "content_hash": "83cf1ddbb6ff42016ba608831e7a1f5f", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 143, "avg_line_length": 24.300884955752213, "alnum_prop": 0.6711580480699199, "repo_name": "frc1418/2014", "id": "566830d92499e06e84dfd0cce1112b69edc6e6b6", "size": "2747"...
"""Script to generate the raw sub-package APIs Basically just drives OpenGLGenerator with options to produce the various modules we want... """ import os, sys, logging, re, compileall import openglgenerator from OpenGL import platform try: from OpenGL import GL except (ImportError, AttributeError), err: pass ...
{ "content_hash": "c69ee6d1ec82f2926e90f7d659a82c81", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 107, "avg_line_length": 38.38235294117647, "alnum_prop": 0.5478927203065134, "repo_name": "frederica07/Dragon_Programming_Process", "id": "e0ab387d7617311c82254f337d99fb5f36...
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.forms import ModelForm @login_required def member_view(request): """Return a rendered member view of member.""" all_meals = request.user.meal.all() ...
{ "content_hash": "3874e7c3b8899e46c946de51b0b2d002", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 30.72093023255814, "alnum_prop": 0.6366389099167298, "repo_name": "FoodLust/FL", "id": "340c2db3f4dc3cafded54f120eacca77f94ceac0", "size": "1321", ...
import numpy as np import pandas as pd from scipy import stats from numba import jit, prange __all__ = ['bootci_nb', 'permtest_nb'] @jit(nopython=True, parallel=True, error_model='numpy') def _bootstrap_jit(dat, statfunction, nstraps, nstats): n = dat.shape[0] res = np.zeros((nstraps, nstats)) ...
{ "content_hash": "4e405c04df8aeab5e2906e8e3fb43fa8", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 126, "avg_line_length": 36.490566037735846, "alnum_prop": 0.5919079627714581, "repo_name": "agartland/utils", "id": "ed9f2b46ed4eadbc91570add1ed0af8a1243ae49", "size": "77...
from graphviz import Digraph import math import pymongo import argparse import sys def write_list_to_file(alist, filepath): """ Simply write a python list out to a file """ with open(filepath, 'w') as file: for item in alist: file.write("{}\n".format(item)) def generate_graph(related_su...
{ "content_hash": "50f4639f8fcfb7baa54493eb7e6f33a4", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 99, "avg_line_length": 27.958677685950413, "alnum_prop": 0.5746378953591487, "repo_name": "cdated/reddit-crawler", "id": "98131a56e6e3d42405a2a683da9393c8f110faa6", "size"...
import torch import torchvision import torch.nn as nn import numpy as np import torchvision.transforms as transforms # ================================================================== # # Table of Contents # # ========================================================...
{ "content_hash": "885b20964e802370b55811527e2f908a", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 81, "avg_line_length": 33.39153439153439, "alnum_prop": 0.4821739819363017, "repo_name": "yunjey/pytorch-tutorial", "id": "744400c20d0f529d41b210cb755845f7b93d0d83", "size...
import os import tempfile from django_seo_js import VERSION from fabric.api import * SITE_DIR = "site" WHITELIST_DIRS = [".git", ] WHITELIST_FILES = [".gitignore", ] SANITY_CHECK_PROJECT_FILES = ["fabfile.py", "setup.py", "mkdocs.yml"] SANITY_CHECK_BUILD_FILES = ["index.html", "js", "css"] def _splitpath(path): ...
{ "content_hash": "a5420207c494daea516d0475f469346c", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 104, "avg_line_length": 29.9875, "alnum_prop": 0.6106711129637349, "repo_name": "skoczen/django-seo-js", "id": "ff90f4c9c2b53bad1635ec420b181de3c53f2cde", "size": "2399", ...
from functools import namedtuple Tile = namedtuple('Tile', ['top', 'bottom']) def placeDominoTile(tiles, newTile): if not tiles: return [newTile] elif len(tiles) == 1: if tiles[0].bottom == newTile.top: tiles.append(newTile) return tiles elif tiles[0].top == new...
{ "content_hash": "487d52f83c68b1701d02a4f244a4a416", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 89, "avg_line_length": 34.723404255319146, "alnum_prop": 0.5808823529411765, "repo_name": "adrianbeloqui/Python", "id": "8a9bda69f6cda02482133d6bf3918782aa69e656", "size": ...
from rest_framework import status from rest_framework.views import APIView from rest_framework.permissions import IsAuthenticated from rest_framework.throttling import AnonRateThrottle, UserRateThrottle from seaserv import seafile_api from seahub import settings from seahub.api2.utils import json_response, api_error f...
{ "content_hash": "5f12361ae87bf50be2ea364f12e75689", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 98, "avg_line_length": 42.19230769230769, "alnum_prop": 0.7529626253418414, "repo_name": "cloudcopy/seahub", "id": "123c08562c51a544ca5ca158861c5cef37ebde3b", "size": "1097...
DATA_DIR = 'Data' BACKUP_DIR = '.bkup' USS_DATABASE_FILENAME = 'USSDatabase.csv' CHANNEL_DATABASE_FILENAME = 'ChannelDatabase.csv'
{ "content_hash": "29f5afc59afef4a4a2a873b22b5ffa27", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 49, "avg_line_length": 32.75, "alnum_prop": 0.7480916030534351, "repo_name": "AdamRSterling/USS_StatsBot", "id": "d4099a366c1a610f7a7b67a3c118c895953d87de", "size": "131", ...