text
stringlengths
4
1.02M
meta
dict
from corehq.apps.reports.dont_use.fields import ReportField, ReportSelectField from corehq.apps.reports.dont_use.fields import SelectFilteredMobileWorkerField from corehq.apps.fixtures.models import FixtureDataType, FixtureDataItem from corehq.apps.reports.filters.base import (BaseSingleOptionFilter, BaseDrilldownO...
{ "content_hash": "3dcec1083adf7b76d9f96028a39c9e0f", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 149, "avg_line_length": 36.020833333333336, "alnum_prop": 0.621283979178716, "repo_name": "SEL-Columbia/commcare-hq", "id": "258bfb35cc2536c683d4cf99863235301880f41f", "si...
from __future__ import unicode_literals from django.db import migrations, models import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('djconnectwise', '0023_auto_20170605_0705'), ] operations = [ migrations.CreateModel( name='Opportunit...
{ "content_hash": "c1c1b310b0893ff79b4aa0fcdbe1ec22", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 124, "avg_line_length": 34.857142857142854, "alnum_prop": 0.5799180327868853, "repo_name": "AparatTechnologies/django-connectwise", "id": "b072245d281750fc82a9c3fe09ce530627d...
"""Support for Homekit switches.""" from aiohomekit.model.characteristics import ( CharacteristicsTypes, InUseValues, IsConfiguredValues, ) from homeassistant.components.switch import SwitchEntity from homeassistant.core import callback from . import KNOWN_DEVICES, HomeKitEntity OUTLET_IN_USE = "outlet_i...
{ "content_hash": "c0fb3679794795538667eb76f0bd8b1b", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 86, "avg_line_length": 32.08403361344538, "alnum_prop": 0.6639601885804086, "repo_name": "balloob/home-assistant", "id": "3408d036b584936a779bd4c568d641d518e2758b", "size"...
from __future__ import print_function # Python 2/3 compatibility """ Example of script to parcellate mutli-subject data. May take some time to complete. Author: Bertrand Thirion, 2005-2009 """ from os import mkdir, getcwd, path from numpy import array from nipy.labs.spatial_models.parcel_io import parcel_input, \ ...
{ "content_hash": "fba2aa1791bedbd19847f6d5ee52fba6", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 30.106060606060606, "alnum_prop": 0.7106190236537494, "repo_name": "arokem/nipy", "id": "c304554feee53f49423487336dee51b5e044e0fc", "size": "2123", ...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_list_issues.py Before run the sample, please set the values of the client ID, ten...
{ "content_hash": "1000fcb7ce8bccb1343a919476f7bbc8", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 146, "avg_line_length": 32.470588235294116, "alnum_prop": 0.7273550724637681, "repo_name": "Azure/azure-sdk-for-python", "id": "9d69bec09967c999734bc992f6f19e98808ebf19", "...
import sys, os, time, random, ctypes #-------------------------------------------------------------------------------------------------- def BytesString(n): suffixes = ['B','KB','MB','GB','TB','PB','EB','ZB','YB'] suffix = 0 while n % 1024 == 0 and suffix+1 < len(suffixes): suffix += 1 n ...
{ "content_hash": "eae47b47533265362ea9ab98e611e5d4", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 106, "avg_line_length": 33.8477366255144, "alnum_prop": 0.5324012158054712, "repo_name": "arekbulski/Cameleonica", "id": "ef6d61940dee773ec35a5be54e57390b34efbf1b", "size"...
import sys from workflow import Workflow from lipsum import lipsum def main(wf): lipsum(wf, "bytes") if __name__ == u"__main__": wf = Workflow() sys.exit(wf.run(main))
{ "content_hash": "a7e6b046ea2b1efee7f5aa319ea08177", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 29, "avg_line_length": 16.636363636363637, "alnum_prop": 0.6338797814207651, "repo_name": "lipsumio/alfred-lipsum", "id": "afe49b771d51855467f945f9608ac9ebb2b461cc", "size"...
import argparse import json import os import sys _CWD = os.getcwd() GRD_BEGIN_TEMPLATE = '<?xml version="1.0" encoding="UTF-8"?>\n'\ '<grit latest_public_release="0" current_release="1" '\ 'output_all_resource_defines="false">\n'\ ' <outputs>\n'\ ...
{ "content_hash": "b990e128ca4b6193acbaf7c28c3ed84e", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 96, "avg_line_length": 41.630872483221474, "alnum_prop": 0.570530388521683, "repo_name": "nwjs/chromium.src", "id": "3f3476d26040d4a81e904a0112f1fc8a0c813303", "size": "79...
"""Test a Fast R-CNN network on an imdb (image database).""" from fast_rcnn.config import cfg, get_output_dir from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv import argparse from utils.timer import Timer import numpy as np import cv2 import caffe from fast_rcnn.nms_wrapper import nms import cPickle...
{ "content_hash": "1cef1ebf259e84abe68739f265c4382b", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 89, "avg_line_length": 38.58385093167702, "alnum_prop": 0.5643915003219575, "repo_name": "JosephKJ/SDD-RFCN-python", "id": "074ba9f0cfaf4a0d2bc2b7f0e5fa7b5bf02eda63", "siz...
import numpy as np from optparse import OptionParser from pylearn2.models.independent_multiclass_logistic import IndependentMulticlassLogistic from galatea.s3c.feature_loading import get_features from pylearn2.utils import serial from pylearn2.datasets.cifar10 import CIFAR10 from pylearn2.datasets.cifar100 import CIFAR...
{ "content_hash": "20dfd1097976b21b93058fa50f0bc7dc", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 99, "avg_line_length": 31.33606557377049, "alnum_prop": 0.6215014386607376, "repo_name": "shiquanwang/pylearn2", "id": "1de75bac5dd913ae93f388cdf1808f32495b941e", "size": ...
from __future__ import absolute_import, unicode_literals class SessionStorage(object): def get(self, key): raise NotImplementedError() def set(self, key, value, ttl=None): raise NotImplementedError() def delete(self, key): raise NotImplementedError() def __getitem__(self, k...
{ "content_hash": "8c4daf338a45fe72b87f0ceefecd6ba2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 56, "avg_line_length": 21.545454545454547, "alnum_prop": 0.6118143459915611, "repo_name": "Luckyseal/wechatpy", "id": "5a6fd74c9b79c64120158ff5d920d57340ce50a2", "size": "4...
""" created_by: Aninda Manocha created_date: 3/5/2015 last_modified_by: Keshav Patel last_modified_date: 3/6/2015 """ # imports import constants import utils import json from sql.user import User from sql.question import Question from sql.session import Session from sql.test_case import Test_Case #For...
{ "content_hash": "00357047a87c80c931b4f301bc7133c6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 23.529411764705884, "alnum_prop": 0.695, "repo_name": "NCSSM-CS/CSAssess", "id": "76d3ad85d0c743b1e9bc479ea91b2565ee4c8040", "size": "826", "binary...
"""Github repo wrapper.""" from __future__ import print_function # Standard library imports import datetime import sys import time # Local imports from loghub.external.github import ApiError, ApiNotFoundError, GitHub class GitHubRepo(object): """Github repository wrapper.""" def __init__(self, username=No...
{ "content_hash": "1465ea2c9747f2f5239163c8272247b7", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 84, "avg_line_length": 35.1474358974359, "alnum_prop": 0.5110341054167427, "repo_name": "spyder-ide/loghub", "id": "18d2ba528eb3d79d02f3a13afa8219c93c76dff2", "size": "112...
import datetime as dt # from flask_login import UserMixin from skeleton.extensions import bcrypt from skeleton.database import ( Column, db, Model, ReferenceCol, relationship, SurrogatePK, ) from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, Bad...
{ "content_hash": "7e494703de449840d27417180db5ec4e", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 80, "avg_line_length": 31.164556962025316, "alnum_prop": 0.6344435418359058, "repo_name": "outpark/skeleton", "id": "e945872d32351ec5d7044a8bf60937c0cb1b68a1", "size": "248...
import sys import os import time launcher_path = os.path.realpath(sys.argv[0]) argv0 = sys.argv[0] def executable_in_path(program): def is_executable(filepath): return os.path.exists(filepath) and os.access(filepath, os.X_OK) for path in os.environ["PATH"].split(os.pathsep): executable_file =...
{ "content_hash": "dabf52354762375a30fd411479e76600", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 159, "avg_line_length": 38.22641509433962, "alnum_prop": 0.5783563672260612, "repo_name": "tema-mbt/tema-tg", "id": "e49af044041c3888f1fefea0ad2714a3c472aba7", "size": "92...
"""Printing subsystem""" from pretty import * from latex import latex, print_latex from mathml import mathml, print_mathml from python import python, print_python from ccode import ccode, print_ccode from gtk import * from preview import preview from str import StrPrinter, sstr, sstrrepr _StrPrinter = StrPrinter() ...
{ "content_hash": "116390467af5c8e6b9422abb8681ed2a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 42, "avg_line_length": 21.4, "alnum_prop": 0.7906542056074767, "repo_name": "fperez/sympy", "id": "1ade76dfa1a26ecdce212eb47460fe75ae7a5803", "size": "535", "binary": fal...
""" Signals relating to questions and answers. """ from django.dispatch import Signal # Sent just before a answer will be posted (after it's been approved and # moderated; this can be used to modify the answer (in place) with posting # details or other such actions. If any receiver returns False the answer will be # d...
{ "content_hash": "d049c6ea4a7d525dd118b4a8892b167a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 87, "avg_line_length": 49.708333333333336, "alnum_prop": 0.7518860016764459, "repo_name": "alexisbellido/django-vodkamartini-qa", "id": "cde029ca79a0787a9f76703040c7b568f250e...
import unittest import os from runtime.python.parser import Parser, TreeCatg from runtime.python.position import Position from runtime.python.token import Keyword from grammar import TestGrammar class ParserTest(unittest.TestCase): def setUp(self): self._parser = Parser(TestGrammar()) sel...
{ "content_hash": "c3a0e7191b0798b688c966b6b38ad473", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 105, "avg_line_length": 33.15384615384615, "alnum_prop": 0.5860788863109049, "repo_name": "ThomasBollmeier/bovinus", "id": "c8f3b77de240ed69792adc26c6aea04c37b1eb44", "size...
import os import sys import unittest from unittest.mock import patch import ray from ray.rllib import _register_all from ray.tune import TuneError from ray.tune.schedulers import FIFOScheduler from ray.tune.result import DONE from ray.tune.registry import _global_registry, TRAINABLE_CLASS from ray.tune.trial import T...
{ "content_hash": "9fd0d5db6c3b5d0175af6f4607b38510", "timestamp": "", "source": "github", "line_count": 395, "max_line_length": 78, "avg_line_length": 37.164556962025316, "alnum_prop": 0.5944141689373297, "repo_name": "pcmoritz/ray-1", "id": "81beeb0a92fedb8a4466e670402a0849f4c2801d", "size": "1468...
from setuptools import setup import os, shutil version = '0.1' setup(version=version, name='kestrel', description = "kestrel", scripts = [ "bin/kestrel_import_mailapp.py", "bin/kestrel_init.py", "bin/kestrel_newconf.py", "bin/kestrel_runcron.py", ...
{ "content_hash": "92ade8cec80f05f2465a4aa9e2e8b034", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 95, "avg_line_length": 27.71875, "alnum_prop": 0.5501691093573844, "repo_name": "iandennismiller/kestrel", "id": "4ea7132f306e9158bc37c3c95b9a83cc9572b511", "size": "887", ...
import importlib import traceback from utils.log import logger from Kunlun_M.const import VENDOR_ECOSYSTEM from Kunlun_M.settings import ACTIVE_SCA_SYSTEM def get_vulns_from_source(language, vendor_name, vendor_version): result = [] sources = VENDOR_ECOSYSTEM.get(language, {}) for source in sources.keys...
{ "content_hash": "0623c75fa6f1f081fd085d51011e2787", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 108, "avg_line_length": 25.685714285714287, "alnum_prop": 0.6229143492769744, "repo_name": "LoRexxar/Cobra-W", "id": "ff393910170e50654c49ab53cd70c5c1b6c4e892", "size": "89...
from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.shortcuts import get_object_or_404 from django.urls import reverse from django.views import generic from django_filters.views import FilterView from providers.filtersets import ProviderService...
{ "content_hash": "b852247e34dd82293f7d439ac1b1c9bf", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 117, "avg_line_length": 33.76223776223776, "alnum_prop": 0.6777133388566694, "repo_name": "aniruddha-adhikary/bookit", "id": "d090bbc2928b64ff77385f1bc96356099ca07153", "s...
import requests import json import sys from getpass import getpass from urllib.parse import urljoin API_BASE = "https://api.waas.barracudanetworks.com/v4/waasapi/" def waas_api_login(email, password): res = requests.post(urljoin(API_BASE, 'api_login'), data=dict(email=email, password=password)) res.raise_for...
{ "content_hash": "7a847d10a12ac0ef4744850a88ed8507", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 119, "avg_line_length": 33.13725490196079, "alnum_prop": 0.6372781065088757, "repo_name": "barracudanetworks/waf-automation", "id": "782ff08b36da54fee7da63a845644fe9ae7c3867"...
from __future__ import absolute_import import json import datetime import os import os.path import sys import traceback from distutils import log from .base import BaseBuildCommand class BuildAssetsCommand(BaseBuildCommand): user_options = BaseBuildCommand.user_options + [ ('asset-json-path=', None, ...
{ "content_hash": "726e299d97871bfdd18fd99e3e3a1f02", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 81, "avg_line_length": 32.311688311688314, "alnum_prop": 0.5582797427652733, "repo_name": "JackDanger/sentry", "id": "2c79a530083bb1855307d46ee3af05bc24767218", "size": "4...
from uuid import uuid1 import time from flask import request from apps.utils.format.obj_format import json_to_pyseq class RestSession: """ 区别与flask-session 针对Rest api请求的Session """ def __init__(self): self.sid = None def init_app(self, app, **kwargs): self._get_interface(app) ...
{ "content_hash": "791656249dcad8fffb6acfc2df3d5e32", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 117, "avg_line_length": 33.477987421383645, "alnum_prop": 0.4803682134134886, "repo_name": "osroom/osroom", "id": "daabdc22f7d78a1df2d20b18555dc00d940e737b", "size": "5547...
from sys import stderr from tempfile import mkdtemp, mkstemp from os import close, rmdir from moi.job import system_call from qiita_core.qiita_settings import qiita_config from qiita_ware.wrapper import ParallelWrapper from qiita_db.logger import LogEntry from qiita_db.data import RawData from qiita_db.metadata_templ...
{ "content_hash": "ffc4c24601af212c9bbec5895a24302a", "timestamp": "", "source": "github", "line_count": 673, "max_line_length": 79, "avg_line_length": 37.335809806835066, "alnum_prop": 0.5839535161380188, "repo_name": "RNAer/qiita", "id": "2273a0c21f830f1d528dd72c99fda7a041f0b8fa", "size": "25478",...
import os import sys import time from collections import Counter, OrderedDict from typing import List, Union # this is needed because we want to add 'torchtext/examples/data_pipeline' directory to the # `sys.path` variable in order to import the pytext_vocab (since its not a module) sys.path.insert(0, os.path.join(os....
{ "content_hash": "b930143ac6cfdb2e42409c3dbb928d99", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 116, "avg_line_length": 41.78391959798995, "alnum_prop": 0.6821407095610342, "repo_name": "pytorch/text", "id": "21053a31f0fb7e4f0b6f8e4ea8949314f8b82093", "size": "8315",...
"""Definition and configuration of the Flask application.""" import flask.ext.restless as rest from flask import Flask, render_template from flask.ext.assets import Environment, Bundle from flask.ext.triangle import Triangle from readme.model import Recommendation from readme.db import session from readme import con...
{ "content_hash": "4c4d7179c8e254522239781add6f7df3", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 60, "avg_line_length": 25.34, "alnum_prop": 0.7103393843725335, "repo_name": "brouberol/readme", "id": "d64a0c823dc24c7a0f4408b573636339523a6826", "size": "1292", "binary...
import sys import socket import select def run_client(): """ Run the client. This should listen for input text from the user and send messages to the server. Responses from the server should be printed to the console. """ # Specify where the server is to connect to server_address = '127.0.0...
{ "content_hash": "cd62f24836d6b67dc3e91d0f2fe3098b", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 88, "avg_line_length": 37.568627450980394, "alnum_prop": 0.5715031315240083, "repo_name": "patevs/python_chat_app", "id": "6e9c84ab66c628f0c4b1a5d947e29174d86ee133", "size"...
from django.conf.urls.defaults import * from piston.resource import Resource from snapboard.api.handlers import ThreadHandler from snapboard.api.auth import StaffHttpBasicAuthentication auth = StaffHttpBasicAuthentication(realm="Snapboard") thread = Resource(ThreadHandler, authentication=auth) urlpatterns = patter...
{ "content_hash": "19b78da9091eec00d020c02c6e8d592a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 25.357142857142858, "alnum_prop": 0.8, "repo_name": "johnboxall/snapboard", "id": "e9118779800c827e8b5449ff4ba267e545229390", "size": "355", "binar...
import sys import os from robot.parsing import VALID_EXTENSIONS as RESOURCE_EXTENSIONS from robot.errors import DataError from .robotbuilder import LibraryDocBuilder, ResourceDocBuilder from .specbuilder import SpecDocBuilder if sys.platform.startswith('java'): from .javabuilder import JavaDocBuilder else: de...
{ "content_hash": "f5424541c5b5d7d538a497eeaace9deb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 31.708333333333332, "alnum_prop": 0.7477003942181341, "repo_name": "ktan2020/legacy-automation", "id": "d5e661e7da5f1a54a5b3bb339a7b2d4307f8fbb5", "s...
import asyncio import random sentences = [ "справился с упражнением", "мастер сетевых протоколов!", "просто мастер Python!", "будет вести следующую лекцию" ] class EchoServerProtocol(asyncio.Protocol): def __init__(self): super(EchoServerProtocol, self).__init__() self.transport...
{ "content_hash": "16ef5364e8a39630b1788e3819271726", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 27.18032786885246, "alnum_prop": 0.6115802171290712, "repo_name": "park-python/course", "id": "799a4610f59350f6cf3706e9774d1bd6a987d617", "size": "17...
import re, sys from difflib import unified_diff, ndiff import pprint import logging import svntest logger = logging.getLogger() ###################################################################### # Exception types class SVNUnexpectedOutput(svntest.Failure): """Exception raised if an invocation of svn results ...
{ "content_hash": "b723bdc635917134cedb5769c6bd7471", "timestamp": "", "source": "github", "line_count": 931, "max_line_length": 113, "avg_line_length": 35.39634801288937, "alnum_prop": 0.6195909449535717, "repo_name": "YueLinHo/Subversion", "id": "98682a2461bd5b2c26fa5fa3c7acec8fd5691705", "size": ...
"""Research Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Tbc2lRq0hTZRSlh74SbIAStMMLDBU210 """ from google.colab import drive drive.mount('/content/gdrive') import sys customized_path_to_homework = "/content/gdrive/My Drive/Research" sys.path.appen...
{ "content_hash": "b7d7f2fd9794d7a46a40301476214c51", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 223, "avg_line_length": 40.0625, "alnum_prop": 0.678059849666714, "repo_name": "OpenDSA/Analysis", "id": "a97ed52ff564b74d63d8f740426f6450c145debf", "size": "7075", "bin...
import pickle from moviepy.editor import * from moviepy.video.tools.tracking import manual_tracking, to_fxfy # LOAD THE CLIP (subclip 6'51 - 7'01 of a chaplin movie) clip = VideoFileClip("../../videos/chaplin.mp4").subclip((6,51.7),(7,01.3)) # MANUAL TRACKING OF THE HEAD # the three next lines are for the manual t...
{ "content_hash": "4bb73207514241cb95216c2652e37f42", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 75, "avg_line_length": 31.058823529411764, "alnum_prop": 0.6742424242424242, "repo_name": "misterbisson/moviepy", "id": "5d55f04bce3663c5b14a639a5ec4020c8280014d", "size": ...
""" Management of Zabbix host groups. :codeauthor: Jiri Kotlin <[email protected]> """ def __virtual__(): """ Only make these states available if Zabbix module is available. """ if "zabbix.hostgroup_create" in __salt__: return True return (False, "zabbix module could not be loaded"...
{ "content_hash": "687ef163d94bd1bc93693638b0101aa0", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 119, "avg_line_length": 34.58682634730539, "alnum_prop": 0.6028393351800554, "repo_name": "saltstack/salt", "id": "9822f160eec6057f65e0c96359e28ab676892a10", "size": "5776...
from django.db import models from django.db.models import permalink from django.utils.translation import ugettext_lazy as _ from model_utils.models import TimeStampedModel from model_utils.fields import MonitorField, StatusField from model_utils import Choices from audit_log.models import AuthStampedModel from ananta...
{ "content_hash": "420144d7f41c5a8f10313a547b224343", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 30.78, "alnum_prop": 0.6575698505523067, "repo_name": "mayapurmedia/tovp", "id": "a039217a8d10cd45d71a982adf297f4efbd5410c", "size": "1539", "binar...
import datetime from oslo_utils import timeutils import testtools from ec2api.api import common from ec2api.api import ec2utils from ec2api import exception from ec2api.tests.unit import tools class EC2ValidationTestCase(testtools.TestCase): """Test case for various validations.""" def test_validate_net(se...
{ "content_hash": "b593b03be6f1e4c1310cafe8710b2dfd", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 78, "avg_line_length": 40.688259109311744, "alnum_prop": 0.6367164179104478, "repo_name": "MayankGo/ec2-api", "id": "fd977bf642e5ee18a0958f426e952a6b25dfc4f4", "size": "10...
from io import StringIO import re vhost_start = re.compile(r'<VirtualHost\s+(.*?)>') vhost_end = re.compile(r'</VirtualHost') docroot_re = re.compile(r'(DocumentRoot\s+)(\S+)') def replace_docroot(conf_string, vhost, new_docroot): '''yield new lines of an httpd.conf file where docroot lines matching the s...
{ "content_hash": "71dac95c53287e063321cbbade38aa06", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 113, "avg_line_length": 33.09090909090909, "alnum_prop": 0.6532967032967033, "repo_name": "lluxury/P_U_S_A", "id": "d61c7cbf1a3ee74e4564d0f1326db588a0e9dad3", "size": "2137...
import httplib, urllib import time from datetime import datetime #Import modules for CGI handling import cgi, cgitb #Import line from line import LineClient, LineGroup, LineContact import Cookie, os, time cookie = Cookie.SimpleCookie() cookie_string = os.environ.get('HTTP_COOKIE') def getCookies(): if not cook...
{ "content_hash": "885581d3df45e326d1e3b5ffc1b39230", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 220, "avg_line_length": 40.342465753424655, "alnum_prop": 0.5200905489530278, "repo_name": "5610110083/Safety-in-residential-project", "id": "1c96706fe4a16f5476fce2e25498770...
""" Exceptions that can occur while using maxcdn-ssl-client """ import traceback class SslApiClientException(Exception): """ A superclass for all exceptions raised by maxcdn-ssl-client """ __slots__ = ('message', 'cause') def __init__(self, message, cause=None): self.message = message ...
{ "content_hash": "4ed6b4085b929c31957edaa66b35f4af", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 69, "avg_line_length": 25.54, "alnum_prop": 0.5904463586530931, "repo_name": "neverpanic/maxcdn-ssl-client", "id": "331ff3a080f17ea1e15f3fa749cb4e1666d3971c", "size": "1277...
from debile.slave.wrappers.lintian import parse_lintian from debile.utils.commands import run_command def lintian(targets, analysis, lintian_binary='lintian'): if not isinstance(targets, list): targets = [targets] log = "" failed = False for target in targets: out, _, _ = run_command...
{ "content_hash": "02c0bd68c643c01d3de3e7859ed62d1b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 61, "avg_line_length": 28.029411764705884, "alnum_prop": 0.5739769150052466, "repo_name": "tcc-unb-fga/debile", "id": "d2c556a142e6a46654936a9f96230ece0e2250e5", "size": "2...
import os import cv2 import math import time import shutil import imghdr import numpy as np import tensorflow as tf from tensorflow.python.platform import gfile from Util.ProgressBar import ProgressBar class Config: n_class = 19 extractors_path = "Models/Extractors/" predictors_path = "Mo...
{ "content_hash": "8f9e07989bfd66be755c8b5d932b59fc", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 119, "avg_line_length": 45.47222222222222, "alnum_prop": 0.4562716351048666, "repo_name": "carefree0910/MachineLearning", "id": "b3217ed8552cb24644c4d09ba0cbdc382d4d9df9", ...
import logging import os import zc.buildout import pkg_resources from zc.recipe.egg import Egg class Symlinks(Egg): """Put symlinks to different files, into one directory. For example, such section can be defined to bring pyexiv2, from standart debian package to isolated buildout: [buil...
{ "content_hash": "f45ecf14c928e88c72020a13c3164ff1", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 89, "avg_line_length": 30.92248062015504, "alnum_prop": 0.5447480571571822, "repo_name": "svetlyak40wt/svetlyak40wt.recipe.symlinks", "id": "7a8a3bbf6e8abcc89515e4e0f28309ca...
from django import template register = template.Library() @register.filter def print_model(value): """Removes all values of arg from the given string""" klass = value.__class__ fields = klass._meta.get_all_field_names() result = {} for f in fields: (field, model, direct, m2m) = klass._met...
{ "content_hash": "a7af992f20900f760607692ca1dfd0f9", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 26.151515151515152, "alnum_prop": 0.608342989571263, "repo_name": "xenim/django-radioportal-review", "id": "f4e9e79c1a516f70370647a1e992224cf3f2aeee", ...
import time class Timer(object): """ basic second-based timer """ def __init__(self, start=None): self.reset() def after(self, seconds): return self.now - self.start >= float(seconds) def reset(self, start=None): self.start = float(start) if start is not None else time.time(...
{ "content_hash": "c896072080a7d57a6757618155a003b8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 21.27777777777778, "alnum_prop": 0.597911227154047, "repo_name": "Yasumoto/zktraffic", "id": "075dd54ecc4ffeb56f5bcaaa189c408bee7f1af8", "size": "128...
from flask import Flask, g, request import deepdream_test app = Flask(__name__) #@app.before_first_request #def load_model(): # g.net = deepdream_test.make_net('../caffe/models/bvlc_googlenet/') @app.route('/', methods=['GET', 'POST']) def make_dream(): net = deepdream_test.make_net('../caffe/models/bvlc_goo...
{ "content_hash": "3977f4b01b96ddefd5554b2a5802c693", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 89, "avg_line_length": 35.16129032258065, "alnum_prop": 0.6422018348623854, "repo_name": "hoqqanen/dreaming-as-a-service", "id": "b4165d37a8b383ded1cd5fabd53afe74f8d073a3", ...
from __future__ import print_function # Form implementation generated from reading ui file '.\acq4\modules\Patch\devicePagetemplate.ui' # # Created: Thu Jan 15 20:16:09 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fr...
{ "content_hash": "758fab7e584971fb3736feb30f400192", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 97, "avg_line_length": 46.367816091954026, "alnum_prop": 0.6829449677739217, "repo_name": "meganbkratz/acq4", "id": "17b493ece089feba796d5d1c1bc6d018cec626e5", "size": "405...
from airflow import DAG from airflow.providers.cncf.kubernetes.operators import kubernetes_pod from airflow.providers.google.cloud.transfers import gcs_to_bigquery default_args = { "owner": "Google", "depends_on_past": False, "start_date": "2021-03-01", } with DAG( dag_id="epa_historical_air_quality....
{ "content_hash": "c0417b1dc33b53a73b7b945ce48b20c3", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 752, "avg_line_length": 51.36708860759494, "alnum_prop": 0.5367175948743224, "repo_name": "llooker/public-datasets-pipelines", "id": "cba70d8f7f69ee8631f08bbdd6f7e1c9b15f275...
db.define_table('rolling_code_seeds', Field('myindex','integer',length=8), Field('m_w','integer',length=32, default=20110715), Field('m_z','integer',length=32, default=20110911)) # a table to store users and their roles db.define_table('valid_members', Field('emailaddr',requires=IS_NOT_EMPTY()), Fi...
{ "content_hash": "62332c2fdc9dc7b6f60c0cf63d074cfd", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 73, "avg_line_length": 34.208333333333336, "alnum_prop": 0.7149817295980512, "repo_name": "house4hack/openSHAC", "id": "84ad426dda5d10b7c63632a2dbbd2a85ebe7873d", "size": "...
from sys import exit def no_config(f): f.__no_config = True return f class Target(object): def __init__(self, buildozer): super(Target, self).__init__() self.buildozer = buildozer self.build_mode = 'debug' self.platform_update = False def check_requirements(self): ...
{ "content_hash": "7cb9b2e98df9bbb9efa53e5b57748722", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 77, "avg_line_length": 28.178571428571427, "alnum_prop": 0.5339036755386565, "repo_name": "eHealthAfrica/buildozer", "id": "4ba9f0e4841f5f19fe2d463e619ffb05e3b05089", "siz...
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
{ "content_hash": "c891a1a7de8a17d9b15c70e5f0f51ac8", "timestamp": "", "source": "github", "line_count": 617, "max_line_length": 238, "avg_line_length": 37.82171799027552, "alnum_prop": 0.5909753171066164, "repo_name": "uonyx/kvr", "id": "1692dc1b0d60af405559c97274a9bebcf3d04f25", "size": "23336", ...
''' Created on Apr 18, 2014 @author: oliwa ''' import os import imp import traceback import sys from prody.proteins.compare import matchTNMAChains from Hungarian import Hungarian class TNMABase(object): ''' TNMABase is the TNMA base class ''' def __init__(self): ''' Constructor ...
{ "content_hash": "fe17f1ad886f2dde9c919ea8be45e542", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 203, "avg_line_length": 51.62671232876713, "alnum_prop": 0.6160530679933665, "repo_name": "Shen-Lab/cNMA", "id": "da86f8e6e8298b1580ac96922c85f01426123345", "size": "15075...
"""urls for bootcamps""" from django.urls import path, include from rest_framework import routers from klasses.views import BootcampViewSet router = routers.DefaultRouter() router.register("bootcampruns", BootcampViewSet, "bootcamp-runs") urlpatterns = [path("api/", include(router.urls))]
{ "content_hash": "0e4c125f23600b2e5defd6cfefde4d3a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 65, "avg_line_length": 24.583333333333332, "alnum_prop": 0.7728813559322034, "repo_name": "mitodl/bootcamp-ecommerce", "id": "91971d9d69a36d5c95bdf84bb0346555bf255c15", "si...
from django.db import models class Snapshot(models.Model): snapped_at = models.DateField(unique=True) href = models.CharField(max_length=55) completed = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class ...
{ "content_hash": "47de2e7b4152d9091a77ad87ca79aa79", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 72, "avg_line_length": 34.775, "alnum_prop": 0.7124370956146657, "repo_name": "Tjorriemorrie/trading", "id": "9e3f022f54c825f10104f8ac0e3cdc32ff077451", "size": "1391", "...
""" Scheme Info editor widget. """ from AnyQt.QtWidgets import ( QWidget, QDialog, QLabel, QTextEdit, QCheckBox, QFormLayout, QVBoxLayout, QHBoxLayout, QDialogButtonBox, QSizePolicy ) from AnyQt.QtCore import Qt from ..gui.lineedit import LineEdit from ..gui.utils import StyledWidget_paintEvent, StyledWidge...
{ "content_hash": "dc9842357a9cab8666315d6b5fd36054", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 70, "avg_line_length": 31.69142857142857, "alnum_prop": 0.5928597187161918, "repo_name": "cheral/orange3", "id": "9a63b2a99113912bde376d7112a9f8eb7e891632", "size": "5546"...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/structure/dantooine/shared_dant_large_rock_hut_dest_01.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return resu...
{ "content_hash": "23def84efe5b968a78c4660df65afc5f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 93, "avg_line_length": 24.76923076923077, "alnum_prop": 0.6987577639751553, "repo_name": "obi-two/Rebelion", "id": "af478f35590eb6d0402d4b21e3e20c3eca32da8e", "size": "467"...
import numpy as np import fabio import re import os from .det2lab_xds import det2lab_xds, rotvec2mat import h5py from numpy.linalg import norm def r_get_numbers(matchgroup, num): """A helper function which can be used similarly to fscanf(fid,'%f',num) to extract num arguments from the regex iterator""" res = ...
{ "content_hash": "0f57c1c550a16592d0789d52d1f62be5", "timestamp": "", "source": "github", "line_count": 522, "max_line_length": 131, "avg_line_length": 45.05555555555556, "alnum_prop": 0.5202602151452017, "repo_name": "aglie/meerkat", "id": "f20fedce910a23e2f0062ff28f4eb19f90cf996a", "size": "23519...
import datetime def serialize_user(user): return { 'id': user.id, 'username': user.username, 'email': user.email, 'permission': user.permission, 'updated_at': None if user.updated_at is None else user.updated_at.isoformat(), 'created_at': user.created_at.isoformat()...
{ "content_hash": "749806850b1cc06ab47797c4ddb12763", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 87, "avg_line_length": 26.181818181818183, "alnum_prop": 0.5972222222222222, "repo_name": "h4wldev/Frest", "id": "d88e112938c3edc050f31a4dc11570625fe9cc31", "size": "600", ...
import logging from optimiz.optimizer import Optimizer class StochasticGradientDescent(Optimizer): def __init__(self, iteration=100, alpha=0.01): self.__iteration = iteration self.__alpha = alpha def optimize(self, func, x, y, model): if len(x) != len(y): raise ValueError...
{ "content_hash": "1401e324b2ef43c96822ebf580def01b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 85, "avg_line_length": 34.608695652173914, "alnum_prop": 0.5175879396984925, "repo_name": "learn-ml/ml", "id": "049006daf0b99c3368cec2730569ed27f808ab2f", "size": "817", ...
import json if __name__ == "__main__": with open("alt_text.json", "w") as outfile: for i, line in enumerate(open("tweets.json")): tweet = json.loads(line) new_line = {"id": tweet["id_str"], "media": []} for media in tweet["extended_entities"]["media"]: ...
{ "content_hash": "26adbc9569ca480aa5b7de8ed4661f20", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 62, "avg_line_length": 34.05263157894737, "alnum_prop": 0.4327666151468315, "repo_name": "alexwlchan/alexwlchan.net", "id": "c0725a5cb7c072a7dd572240d6e634dd0291e477", "siz...
import os from leela.client import event class Load(object): def measure(self): (l1, l5, l15) = os.getloadavg() return([event.Event("loadavg.1", l1), event.Event("loadavg.5", l5), event.Event("loadavg.15", l15) ])
{ "content_hash": "a95ebb4ab0e486c4ac940518291b0cb7", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 46, "avg_line_length": 25.727272727272727, "alnum_prop": 0.5300353356890459, "repo_name": "locaweb/leela-client", "id": "d3d7d4237c761c94e398c871691133a1153c3b87", "size": ...
def join_outer(self, right, left_on, right_on=None): """ join_outer performs outer join operation on one or two frames, creating a new frame. Parameters ---------- :param right: (Frame) Another frame to join with :param left_on: (List[str]) Names o...
{ "content_hash": "46e2bb320cc579619ed63de07e713a8c", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 154, "avg_line_length": 35.36309523809524, "alnum_prop": 0.49183639117993605, "repo_name": "shibanis1/spark-tk", "id": "1aceb20e8b4d3a8ac103e94fb866b2083191f965", "size": ...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "daf67d40817defc93667cb7c1ca0e2e7", "timestamp": "", "source": "github", "line_count": 2879, "max_line_length": 981, "avg_line_length": 65.84682181312957, "alnum_prop": 0.6926144545900523, "repo_name": "google/gnxi", "id": "4e7c740a0894655604aa287e23622edc994abc86", "size": "189597...
""" report test results in JUnit-XML format, for use with Jenkins and build integration servers. Based on initial code from Ross Lawley. Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/ src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd """ import functools i...
{ "content_hash": "8355d28255efbeca7095571d56dd2d28", "timestamp": "", "source": "github", "line_count": 692, "max_line_length": 112, "avg_line_length": 33.74277456647399, "alnum_prop": 0.5644539614561028, "repo_name": "ekwoodrich/python-dvrip", "id": "ea33e606c30407ec3cfbdb3a0db9386d757a4a82", "siz...
""" Copyright (c) 2017-2022 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. Writes a Dockerfile using information from container.yaml - the Dockerfile results in an image with the actual filesystem tree we care abou...
{ "content_hash": "1cebb914699aaaad76361a1f6f7b86cd", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 94, "avg_line_length": 39.33064516129032, "alnum_prop": 0.6456838220217347, "repo_name": "projectatomic/atomic-reactor", "id": "b9d3d380f354020f204c39ed06bea7fa9a809766", ...
from django.conf.urls import patterns, url, include urlpatterns = patterns( '', url(r'^accounts/', include('django.contrib.auth.urls')), )
{ "content_hash": "13ae9bf9951c8c913fd7b8a72da6ef45", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 60, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6824324324324325, "repo_name": "webkom/django-auth-abakus", "id": "7ae483931c2be7fd784c5d19221c9ac99b5bae8f", "siz...
class Searcher(object): def __init__(self, index, ret_field): self.index = index self.ret_field = ret_field def find(self, query, ret_field=None): intersect_lists = [] ret_field = ret_field if ret_field is not None else self.ret_field ret_field_id = self.index.field_ke...
{ "content_hash": "d1d284960bbeb47d4255c95b67bf5329", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 33.6271186440678, "alnum_prop": 0.5246975806451613, "repo_name": "zaycev/metaphor-search", "id": "92cdb14bea0da28ba2a0958332ec2428d5ae3765", "size": ...
import os from config import Config from flask import Flask from flask_ask import Ask, request, session, question, statement from werkzeug.contrib.fixers import ProxyFix from unidecode import unidecode import logging from sl import SL try: from urllib.parse import quote_plus except: from urllib import quote_pl...
{ "content_hash": "262d927a11096206d5d967338f4fb13e", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 131, "avg_line_length": 34.78977272727273, "alnum_prop": 0.6178343949044586, "repo_name": "clearminds/alexa-sl", "id": "ebc2df8bc617725d4f1b5413fe9b00077a98ba80", "size": ...
problem = """ We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once. For example, 2143 is a 4-digit pandigital and is also prime. What is the largest n-digit pandigital prime that exists? """ from itertools import permutations, imap from math import sqrt primes = set...
{ "content_hash": "ee109bed771648b5f95a5b29765ebd1b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 165, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6052631578947368, "repo_name": "lorenyu/project-euler", "id": "a9de5dcf9eb46750d24eb254f6f8ae78dc60c08a", "size"...
from pool import physics class TestTriangleArea(): def test_triangle_area1(self): assert physics.triangle_area(1, 1, 0) == 0 def test_triangle_area2(self): assert physics.triangle_area(3, 4, 5) == 0.5 * 3 * 4
{ "content_hash": "43754c2895722ae4c6e7e646e568205d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 60, "avg_line_length": 29.375, "alnum_prop": 0.6425531914893617, "repo_name": "max-kov/pool", "id": "9c476bbe7b20c28ca6580fed024b1989552705b9", "size": "235", "binary": fa...
import argparse import math import tkinter as tk import tkinter.messagebox as tk_messagebox import PIL.ImageTk import PIL.Image import numpy as np IMAGE_SIZE = (600, 400) class ImageManipulationWindow: def __init__(self, image_path): self.root = tk.Tk() self.root.grid_columnconfigure(3, weight=...
{ "content_hash": "9384cf9c8743b19cd9f6f9207579f92a", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 78, "avg_line_length": 35.398936170212764, "alnum_prop": 0.549060856498873, "repo_name": "CG2016/barkovsky_3", "id": "5a44f5cb824ceeacf106292eb6658e78b89d0dc7", "size": "1...
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import NoSuchElementException from credentials import edx_username, edx_password from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from login...
{ "content_hash": "bda006d44a1670b82cd323830dca7e18", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 101, "avg_line_length": 37.015625, "alnum_prop": 0.6884761502743774, "repo_name": "Lyla-Fischer/get_edx_data", "id": "665f7fbf4693de11bb484c3286377f268d354372", "size": "24...
""" The MIT License (MIT) Copyright (c) 2016 xdei (https://github.com/xdei/Phobos) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to ...
{ "content_hash": "db85c83577efa6f04a47b175951bd9d9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 42.41935483870968, "alnum_prop": 0.7688212927756654, "repo_name": "xdei/Phobos", "id": "4985c0eeb079eab77f53a896817b573e173c3b69", "size": "1339", ...
class Model(object): def __init__(self, *args, **kwargs): for k, value in kwargs.items(): if k in dir(self): setattr(self, k, value) @classmethod def to_instance(cls, json): return cls(**json) def to_json(self): return_json = {} for field_n...
{ "content_hash": "7d522c1989b9627469a5b5a1d75d2740", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 109, "avg_line_length": 25.95, "alnum_prop": 0.54373795761079, "repo_name": "felipevolpone/ray", "id": "3578ffdb0b535a83ae672ea66c95439e20c9fab2", "size": "2596", "binar...
""" Recurrent layers. TODO: write more documentation """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import copy import theano import theano.tensor as TT # Nicer i...
{ "content_hash": "02d2d984125e5145f1a5d3f4fb34ad49", "timestamp": "", "source": "github", "line_count": 2057, "max_line_length": 119, "avg_line_length": 39.77442877977637, "alnum_prop": 0.49495208761122517, "repo_name": "kyunghyuncho/GroundHog", "id": "f4ccb752318133e709f9827e3c3176d39cc4abb1", "si...
""" interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import pdb import sys from doctest import UnexpectedException from _pytest import outcomes from _pytest.config import hookimpl from ...
{ "content_hash": "1430cf13cd41672fcb05a717d57a2930", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 86, "avg_line_length": 33.333333333333336, "alnum_prop": 0.5477477477477477, "repo_name": "cloudera/hue", "id": "99d35a5ab77e180e9933af75d39d4f54f6ceedcd", "size": "11124"...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <openssl/engine.h> """ TYPES = """ static const ...
{ "content_hash": "a137b86f44cd40b311d4e2f3767434e5", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 79, "avg_line_length": 36.294520547945204, "alnum_prop": 0.7329684846197396, "repo_name": "jayceyxc/hue", "id": "afdd54e42913888f7472995ea85bdf1da5294c02", "size": "5299",...
""" OVERALL CREDIT TO: t0mm0, Eldorado, VOINAGE, BSTRDMKR, tknorris, smokdpi, TheHighway urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free So...
{ "content_hash": "0d658128b56dd581694d725b3fa7c0cc", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 91, "avg_line_length": 35.656716417910445, "alnum_prop": 0.6019254918375889, "repo_name": "mrknow/filmkodi", "id": "07c19699bd88df9696e2e14a1bdd63d91e73b00d", "size": "2389...
import sys class Loader: def __init__(self, code_size, data_size=0): from peachpy.util import is_int if not is_int(code_size): raise TypeError("code size must be an integer") if not is_int(data_size): raise TypeError("data size must be an integer") if code_s...
{ "content_hash": "18550d6d33b5e3c35268ff4f0fe15d85", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 110, "avg_line_length": 44.394366197183096, "alnum_prop": 0.546002538071066, "repo_name": "silky/PeachPy", "id": "25e3227ab21c34ed9e04e1f8c7a7297ac1c5d666", "size": "6450"...
from odoo import api, fields, models, _ class ProductTemplate(models.Model): _inherit = ['product.template'] attachment_count = fields.Integer(compute='_compute_attachment_count', string="File") @api.multi def _compute_attachment_count(self): attachment_data = self.env['ir.attachment'].read_...
{ "content_hash": "e90da82016698c87a1b1f17e5701ee52", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 188, "avg_line_length": 50.234375, "alnum_prop": 0.5660964230171073, "repo_name": "vileopratama/vitech", "id": "9ad8dc20c8d3192cc94fb2a640e9e33f1b780cff", "size": "3315", ...
import csv import json import math import os import time # Config BPM = 60 # Beats per minute, e.g. 60, 75, 100, 120, 150 DIVISIONS_PER_BEAT = 4 # e.g. 4 = quarter notes, 8 = eighth notes, etc PX_PER_BEAT = 40 VARIANCE_MS = 20 # +/- milliseconds an instrument note should be off by to give it a little more "natural" fe...
{ "content_hash": "7c1aca5ae6c475e1c81c6582a687ab32", "timestamp": "", "source": "github", "line_count": 522, "max_line_length": 603, "avg_line_length": 34.706896551724135, "alnum_prop": 0.6694817022685875, "repo_name": "shawngraham/music-lab-scripts", "id": "01a0abcddd853ac9d7ef03b89ab31bb28330c660",...
import numpy as np from landlab import Component, RasterModelGrid, CLOSED_BOUNDARY from landlab import BAD_INDEX_VALUE, FIXED_VALUE_BOUNDARY, FIXED_LINK from landlab import FIXED_GRADIENT_BOUNDARY from ...utils.decorators import use_file_name_or_kwds class KinematicWaveRengers(Component): """ This code is ba...
{ "content_hash": "f3afe13495db4aa170ef3c2f03742638", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 79, "avg_line_length": 45.58684210526316, "alnum_prop": 0.6090746406511575, "repo_name": "laijingtao/landlab", "id": "e3b0395403a8b26360e54bbcd3936c299ca7f0eb", "size": "1...
import types from text import text_file class Configuration(): def __init__(self, filename): self.conf = self.__load(filename) def __load(self, filename): conf = {} lines = text_file.read_file(filename) for line in lines: line = line.strip() if line...
{ "content_hash": "62702995fb18851a4410af25fda0aecf", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 52, "avg_line_length": 27.88235294117647, "alnum_prop": 0.46905766526019693, "repo_name": "interhui/py-text", "id": "5a815a23e608c96d29c3dfdfc90dc2056f1975f3", "size": "143...
"""The tests for the Input select component.""" # pylint: disable=too-many-public-methods,protected-access import unittest from blumate.components import input_select from blumate.const import ( ATTR_ICON, ATTR_FRIENDLY_NAME) from tests.common import get_test_home_assistant class TestInputSelect(unittest.TestCa...
{ "content_hash": "d3e486ccc85e6399ad20faee553cb69e", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 79, "avg_line_length": 31.3953488372093, "alnum_prop": 0.5232098765432098, "repo_name": "bdfoster/blumate", "id": "3643854bfcb4a30ada1a9ff594d4e9b310c1bd86", "size": "4050...
''' The addresslib package exposes a simple address parsing library that can handle email addresses and urls. See the address.py module for the public interfaces to the library and the parser.py module for the implementation of the recursive descent parser used to parse email addresses and urls. To override the defau...
{ "content_hash": "c7386f6e1abc05c2b993d74028aa263f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 104, "avg_line_length": 31.98, "alnum_prop": 0.7267041901188243, "repo_name": "EncircleInc/addresslib", "id": "bcacdb774aaa3123f4b7f1c06f809223ff0c2530", "size": "1599", ...
from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.utils.translation import ugettext_lazy from mptt import models as mptt_models from learningprogress.accounts.models import User class Section(mptt_models.MPTTModel): """ Model for sectioning the c...
{ "content_hash": "607ea948b6bc23d7308d05587552ff2a", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 110, "avg_line_length": 30.424242424242426, "alnum_prop": 0.6277390438247012, "repo_name": "LearningProgress/LearningProgress", "id": "f9370f9b76a143cf16d7cb24c4d57fad5b066d...
# -*- coding: utf-8 -*- import sphinx_rtd_theme # # RTD Spielwiese documentation build configuration file, created by # sphinx-quickstart on Tue Oct 04 12:39:10 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in ...
{ "content_hash": "d682826a738b9f8e2d8def08b0433f1b", "timestamp": "", "source": "github", "line_count": 457, "max_line_length": 131, "avg_line_length": 28.282275711159738, "alnum_prop": 0.6958607350096712, "repo_name": "gpufit/Gpufit", "id": "7369e043835e2be900ec0bd881e0757043153919", "size": "1292...
__author__ = "geduldig" __date__ = "June 7, 2013" __license__ = "MIT" from .BearerAuth import BearerAuth as OAuth2 from .constants import * from datetime import datetime from requests.exceptions import ConnectionError, ReadTimeout, SSLError from requests.packages.urllib3.exceptions import ReadTimeoutError, ProtocolEr...
{ "content_hash": "b8293a7c60090d58da465e3e8ceb809b", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 95, "avg_line_length": 36.80707395498392, "alnum_prop": 0.5448589149995632, "repo_name": "mpvoss/RickAndMortyWeatherTweets", "id": "a238649d2001eb6429029365c69c216e6125783a"...
""" permissions.py: Permisos adicionales para los Api rest y Apis vies @author Camilo Ramírez @contact [email protected] [email protected] @camilortte on Twitter @copyright Copyright 2014-2015, RecomendadorUD @license GPL @date 2...
{ "content_hash": "10aaa3bca151261647cf3631d1efbad2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 73, "avg_line_length": 28.424242424242426, "alnum_prop": 0.6428571428571429, "repo_name": "camilortte/RecomendadorUD", "id": "983e97801869e59d76ffde2c17a10c6bfb15c635", "si...
""" App callables used to test post data """ def test_return_post_data(environ, start_response): post_data = environ['wsgi.input'].read() return_value = repr(post_data) start_response("200 OK", [('content-length', '%s' % len(return_value))]) return [return_value]
{ "content_hash": "c8e707aa14d8b0f24fdf2d90edc2669d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 76, "avg_line_length": 31.88888888888889, "alnum_prop": 0.6445993031358885, "repo_name": "alvin319/CarnotKE", "id": "01477019e8bb5c7f136882b606aeded825a6ecb8", "size": "808"...
from django.db import migrations class Migration(migrations.Migration): """ Remove the old ClassicalWork and DancePiece relationships to Events, now we've copied their data to the new version with a through model. """ dependencies = [ ("spectator_events", "0013_copy_classical_and_dance_da...
{ "content_hash": "5a2c0695ba92b404fdbf74139631f97d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 72, "avg_line_length": 25, "alnum_prop": 0.5965217391304348, "repo_name": "philgyford/django-spectator", "id": "555fea5d61d82cc84b35c8268cb137d159b074e1", "size": "622", ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import time from flexget import plugin from flexget.event import event from flexget.utils.log import log_once from flexget.utils.titles.movie import MoviePa...
{ "content_hash": "f8b5338cd900d712a6875249eff9b2fa", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 111, "avg_line_length": 32.14, "alnum_prop": 0.6502800248911015, "repo_name": "OmgOhnoes/Flexget", "id": "2695c8c91ec9ae0851fc03199aab3ca0646723a6", "size": "1607", "bina...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/armor/shared_armor_segment_bone_advanced.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "19f613eef4df7562a1648b06b304af19", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 88, "avg_line_length": 24.384615384615383, "alnum_prop": 0.7003154574132492, "repo_name": "anhstudios/swganh", "id": "2719dcb71f0a83ff605af538261d9a1f798de3ce", "size": "46...
""" Created on Fri May 13 22:59:53 2016 @author: Methinee """ import pandas as pd import numpy as np import pickle df_file = pd.read_csv('../data/df_sub_more20_merge.csv',delimiter=",", skip_blank_lines = True, error_bad_lines=False) headers=list(df_file.columns.values) subjects = [] countSub = 0 #C...
{ "content_hash": "db8681c33bb562c056333fb8cddd7d24", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 96, "avg_line_length": 29.020408163265305, "alnum_prop": 0.6427566807313643, "repo_name": "wasit7/book_pae", "id": "dc483c94913859de783214d825f6f0d64fe11d11", "size": "1446...
from __future__ import unicode_literals, division, absolute_import, print_function import re from datetime import datetime from ._asn1 import Certificate, int_from_bytes, timezone from ._cipher_suites import CIPHER_SUITE_MAP from .errors import TLSVerificationError, TLSDisconnectError, TLSError __all__ = [ 'det...
{ "content_hash": "e55578f869e404938b0abd3cb17306b9", "timestamp": "", "source": "github", "line_count": 603, "max_line_length": 119, "avg_line_length": 29.567164179104477, "alnum_prop": 0.629816590947333, "repo_name": "wbond/oscrypto", "id": "260e9cff73772187378e1b96fb7f716ddda9dc74", "size": "1784...
from djam.riffs.models import ModelRiff from django.template.loader import render_to_string from stepping_out.forms import (LessonCreateForm, LessonTemplateForm, ScheduleBaseForm) from stepping_out.models import Lesson, LessonTemplate, Series class LessonRiff(ModelRiff): model = L...
{ "content_hash": "7b9b88f7057d25bb4f2f48c14b9b3a87", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 73, "avg_line_length": 27.46875, "alnum_prop": 0.4774364808494501, "repo_name": "melinath/django-stepping-out", "id": "e6d0b24103c4c4f8a834624289c2cdc5034ea286", "size": "2...
from openstack.tests.functional import base class TestMeter(base.BaseFunctionalTest): def test_list(self): names = set([o.name for o in self.conn.telemetry.meters()]) self.assertIn('storage.objects', names)
{ "content_hash": "ad9810d0c47c4808d35fab7a706b8d61", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 28.75, "alnum_prop": 0.7043478260869566, "repo_name": "sjsucohort6/openstack", "id": "7c639d5ea3a9fae7b466b894f864ef4da9ffd537", "size": "776", "bin...
""" WSGI config for graph 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTING...
{ "content_hash": "ff5f3e141038cc987ddab790d65c6834", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.0625, "alnum_prop": 0.7662337662337663, "repo_name": "sergeysynergy/graph", "id": "5ce6ac50a710e5d123e49e54334e6945718122e0", "size": "385", "bi...
""" ML Estimation of Spatial Error Model """ __author__ = "Luc Anselin [email protected],\ Serge Rey [email protected], \ Levi Wolf [email protected]" import numpy as np import numpy.linalg as la from scipy import sparse as sp from scipy.sparse.linalg import splu as SuperLU import pysal ...
{ "content_hash": "08c05465e90fdafacb23244d400cf596", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 129, "avg_line_length": 36.44589552238806, "alnum_prop": 0.5255694906577937, "repo_name": "schmidtc/pysal", "id": "ce26a973bdac89e66c3a4bd1f924cf9b3b84c377", "size": "1953...