text
stringlengths
4
1.02M
meta
dict
import os import tempfile import mock from handroll.configuration import Configuration from handroll.director import Director from handroll.resolver import FileResolver from handroll.site import Site from handroll.tests import TestCase class TestDirector(TestCase): def test_generates_with_user_specified_outdir...
{ "content_hash": "8d6f9b20bc0b01b32c648db906e59c35", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 78, "avg_line_length": 36.08097165991903, "alnum_prop": 0.6435143626570916, "repo_name": "handroll/handroll", "id": "431e24cbcbcdf2d29995302eb6aa2256f4a4b08a", "size": "89...
"""Wrapper for creating the swimmer environment.""" import math import numpy as np import mujoco_py import os from gym import utils from gym.envs.mujoco import mujoco_env from d4rl.locomotion import mujoco_goal_env from d4rl.locomotion import goal_reaching_env from d4rl.locomotion import maze_env from d4rl import of...
{ "content_hash": "c04e33a85292dac8181ed40112f53275", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 103, "avg_line_length": 32.664, "alnum_prop": 0.6531961792799412, "repo_name": "rail-berkeley/d4rl", "id": "bb8282a7d18d5dde1a993b6241a6f40735c7f6c9", "size": "4083", "b...
"""Hyperparameter values.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import re import six from tensorflow.contrib.training.python.training import hparam_pb2 from tensorflow.python.framework import ops from tensorflow.python.util import ...
{ "content_hash": "88eebe168cebb8d5a53e999c2540c4a4", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 83, "avg_line_length": 35.45796460176991, "alnum_prop": 0.6512135770886629, "repo_name": "markslwong/tensorflow", "id": "1d1778282072b6aacb26807bf2732c3f6f91202d", "size":...
from django.forms import DateTimeField, ModelForm, Textarea from .models import Location, Room, Schedule, Alert class ScheduleForm(ModelForm): start = DateTimeField(input_formats=['%d/%m/%Y %H:%M', ]) end = DateTimeField(input_formats=['%d/%m/%Y %H:%M', ]) widgets = { 'room': Textarea(attrs={'co...
{ "content_hash": "293c44afc751c2b863f5b4b397d5fc80", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 61, "avg_line_length": 27, "alnum_prop": 0.5969498910675382, "repo_name": "maurobaraldi/brms", "id": "f7eb7d270530b0bda2e837a225ebba8c216675a3", "size": "459", "binary": ...
<<<<<<< HEAD <<<<<<< HEAD import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') # import threading after _multiprocessing to raise a more revelant err...
{ "content_hash": "fab57802ba2271bc2c33eadb7fac66c6", "timestamp": "", "source": "github", "line_count": 2061, "max_line_length": 89, "avg_line_length": 34.752062105773895, "alnum_prop": 0.6058025242935329, "repo_name": "ArcherSys/ArcherSys", "id": "35518eaa536e864afc54d00f7ab56fdff94ffead", "size":...
"""Main entry point into the EC2 Credentials service. This service allows the creation of access/secret credentials used for the ec2 interop layer of OpenStack. A user can create as many access/secret pairs, each of which map to a specific tenant. This is required because OpenStack supports a user belonging to multi...
{ "content_hash": "3873dada0d200fe2ce0fa727d92997c2", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 79, "avg_line_length": 37.461309523809526, "alnum_prop": 0.6211170255025026, "repo_name": "tylertian/Openstack", "id": "5bf40103b1b7a3a7eed9690c43806ecf30e56363", "size": ...
"""Simple commmandline utility that prints all Jupyter paths""" from jupyter_core import paths def printVars(names): """Pretty print path vars by name Parameters ---------- names list(str) - variable names""" # Calculate the left column size leftCol = max([len(name) for name in names...
{ "content_hash": "b837fc0d718110e097572350a1ad5f23", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 70, "avg_line_length": 28.745454545454546, "alnum_prop": 0.5641998734977862, "repo_name": "jovyan/jpypaths", "id": "532491776352d9c72a00fc4c99c87c6afe7674f9", "size": "1581...
from pybuilder.core import task, depends, description, use_plugin use_plugin("core") @task @description("Execute analysis plugins.") @depends("run_unit_tests") def analyze(): pass
{ "content_hash": "6a895c6b0fd4f4c08a268946f508b42e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 65, "avg_line_length": 18.7, "alnum_prop": 0.732620320855615, "repo_name": "Danielweber7624/pybuilder", "id": "ed8201c8c073dac236a18e53b385a589c35be281", "size": "856", "...
''' ## License The MIT License (MIT) GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi. Copyright (C) 2015 Dexter Industries Jetduino for the Jetson TK1/TX1: an open source platform for connecting Grove Sensors to the Jetson embedded supercomputers. Permission ...
{ "content_hash": "81648757be4784860d113f2db305b7a5", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 145, "avg_line_length": 39.82142857142857, "alnum_prop": 0.668609865470852, "repo_name": "NeuroRoboticTech/Jetduino", "id": "bde7bb7e10b5decf50b3c38c81686527419f9123", "siz...
""" Goal Sentry API Models """ from sqlalchemy import Column, Integer, String, ForeignKey, DateTime from datetime import datetime as dt from sqlalchemy.orm import relationship from database import Base class User(Base): __tablename__ = 'users' # Basic metadata id = Column(Integer, primary_key=True) ...
{ "content_hash": "08b05ce6671c04b01413b01efe4ed004", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 81, "avg_line_length": 24.695238095238096, "alnum_prop": 0.6058619359814886, "repo_name": "stevenmirabito/GoalSentry", "id": "1b92526dfe92d57a7087eba62bb628488dcdb303", "s...
import pygame as pg # import math import random def interpolate(v1, v2, range): return pg.math.Vector2(v1.x + (v2.x - v1.x) * range, v1.y + (v2.y - v1.y) * range) class Particle(pg.sprite.Sprite): def __init__(self, game, image, pos, vel, life, lifetime, fade_start,...
{ "content_hash": "8831758a57a97f6a9cb26c4a35f2dae5", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 86, "avg_line_length": 35.43703703703704, "alnum_prop": 0.5265468227424749, "repo_name": "kidscancode/gamedev", "id": "6bc34d2d5dd362761710e040b95d38349669c220", "size": "...
import os from django.conf import settings CAPTCHA_FONT_PATH = getattr(settings, 'CAPTCHA_FONT_PATH', os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'fonts/Vera.ttf'))) CAPTCHA_FONT_SIZE = getattr(settings, 'CAPTCHA_FONT_SIZE', 22) CAPTCHA_LETTER_ROTATION = getattr(settings, 'CAPTCHA_LETTER_ROTATION',...
{ "content_hash": "34748cc08d3119be110da359ab7ff002", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 141, "avg_line_length": 51.80769230769231, "alnum_prop": 0.7323682256867112, "repo_name": "madflow/seahub", "id": "e344bd910799786f99b6d394da25c9e73bb4dc38", "size": "2696"...
"""Support for Tellstick Net/Telstick Live sensors.""" from __future__ import annotations from homeassistant.components import sensor, tellduslive from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE,...
{ "content_hash": "5c72b602e8fa99f2f8bfed7925be0ea2", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 87, "avg_line_length": 31.617486338797814, "alnum_prop": 0.6491531282405807, "repo_name": "jawilson/home-assistant", "id": "729b605250757f570ac3fe1bd51e60532949ae87", "siz...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 ...
{ "content_hash": "cd9987a1e412d89576a54dc640f2e297", "timestamp": "", "source": "github", "line_count": 782, "max_line_length": 103, "avg_line_length": 30.286445012787723, "alnum_prop": 0.5352558689410573, "repo_name": "NordicSemiconductor/pyOCD", "id": "97077c5df9a07fab7f914c155423f9b378b0fab8", "...
from subprocess import call import os from django.core.management.base import BaseCommand, CommandError from ...conf import settings from ... import utils class Command(BaseCommand): help = 'Pushes english locale source' requires_system_checks = False def handle(self, *args, **options): # Requ...
{ "content_hash": "c0a8d4afa157695edbc924132e728a55", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 29.966666666666665, "alnum_prop": 0.60734149054505, "repo_name": "nitely/Spirit", "id": "e84a6ef2e1671d12a039a5dedf3342d6eacfbf64", "size": "924", ...
"""Tests for Incremental PCA.""" import numpy as np import pytest from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_allclose_dense_sparse from sklearn import datasets from sklearn.decomposition import PCA, Incr...
{ "content_hash": "ff1f4bb6271aa3692fdf768342cbe114", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 79, "avg_line_length": 37.069825436408976, "alnum_prop": 0.6316851664984864, "repo_name": "ryfeus/lambda-packs", "id": "d198b67c720c1df8ee5b6cbff5ec9b27e0a1d873", "size": ...
from common import * from ast import *
{ "content_hash": "8f82a355fc4c93a0902d2074dc500474", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 20, "avg_line_length": 10.25, "alnum_prop": 0.7073170731707317, "repo_name": "ArcherSys/ArcherSys", "id": "74b83d08e56aa39afa26b9d6a37c55d8a62069d6", "size": "41", "binary...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('linked_domain', '0013_auto_20201005_2215'), ] operations = [ migrations.AlterField( model_name='domainlinkhistory', name='model', field=models.CharField(...
{ "content_hash": "1f9e47eb6f41dbe16a97cb501464d5ce", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 100, "avg_line_length": 50.56666666666667, "alnum_prop": 0.3862887277521424, "repo_name": "dimagi/commcare-hq", "id": "e721a5c178018fe689634732f5dc210eccde698f", "size": "1...
from lxml import etree import webob from nova.api.openstack.compute.contrib import keypairs from nova.api.openstack import wsgi from nova import db from nova import exception from nova.openstack.common import jsonutils from nova.openstack.common import policy as common_policy from nova import policy from nova import q...
{ "content_hash": "6e479b84cbb0eb3d8807739eae2aee86", "timestamp": "", "source": "github", "line_count": 455, "max_line_length": 79, "avg_line_length": 38.738461538461536, "alnum_prop": 0.5841938046068308, "repo_name": "viggates/nova", "id": "6ca588588ff22454aa16604582787d3397a26915", "size": "18254...
import functools import os from django.core.exceptions import ImproperlyConfigured from django.core import mail from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from django.template import Context, Template, TemplateDoesNotExist from django.template.lo...
{ "content_hash": "688ffd88b44ccb4719aef34f38d0add3", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 103, "avg_line_length": 35.492592592592594, "alnum_prop": 0.6599186058645519, "repo_name": "paxnovem/django-mailviews", "id": "2ee2ae6a704eb49226460f5ed05944cef2c117f5", "...
from distutils.core import setup long_description = open('README.rst').read() setup(name='ndar-backend', version='0.1.0', description='NDAR back-end tools', author='Christian Haselgrove', author_email='[email protected]', url='https://github.com/chaselgrove/ndar/ndar...
{ "content_hash": "3282ac7dc68a015b7e705cf6fa140f90", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 62, "avg_line_length": 37.36, "alnum_prop": 0.5674518201284796, "repo_name": "NDAR/NITRC-Pipeline-for-NDAR", "id": "ce131b83580192ab6e3c8166ba483de85535873b", "size": "953"...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^get_labels$', views.GetLabels.as_view()), url(r'^cancel_job/(?P<job_id>([0-9]+))$', views.CancelJob.as_view()), url(r'^get_status$', views.GetStatus.as_view()), url(r'^get_printers$', views.GetPrinters.as_view()), url(r'^pr...
{ "content_hash": "ed4422f50b437844ea5cb2cf81060b44", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 73, "avg_line_length": 36.5, "alnum_prop": 0.6383561643835617, "repo_name": "ojarva/home-info-display", "id": "f3a2e6cb51ce518d10b2704fd6a07e150ee7b6cd", "size": "365", "...
import pytest import os import funcy import microcache import requests_mock import pypandoc from hatchery import project from hatchery import snippets from hatchery import helpers try: from unittest import mock except ImportError: import mock PROJECT_NAME = 'myproject' PACKAGE_NAME = 'mypackage' INDEX_URL = '...
{ "content_hash": "7deda49faec7411aa2b40f55efeb06cc", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 100, "avg_line_length": 42.19230769230769, "alnum_prop": 0.6510483135824977, "repo_name": "ajk8/hatchery", "id": "d0c8049184d4acb780159ae99a6813105dceeff9", "size": "10970...
from dataclasses import dataclass from typing import List, Optional import pytest import simple_parsing from simple_parsing import ConflictResolution, field from . import TestSetup from .example_use_cases import HParams, RunConfig, TrainConfig @dataclass class ClassA: a: int = 1 @dataclass class ClassB: ...
{ "content_hash": "853c53d8c475ee4c1878155ce1626bd4", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 99, "avg_line_length": 27.55191256830601, "alnum_prop": 0.6741372471241571, "repo_name": "lebrice/SimpleParsing", "id": "f9f90b2fc688eb71b1abf39d9ccce598a0f50622", "size":...
import os from zeus.config import ConfigManager from zeus.common import FabricManager from zeus.common import PasswordManager from zeus.ubuntu import RepoManager from fabric.api import parallel, roles, run, env metadata = ConfigManager(os.environ["CONFIGFILE"]) passwords = PasswordManager(os.environ["PASSWORDCACHE"...
{ "content_hash": "0dcce6dd2a865d7617f72e07f2cea95b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 22.838709677419356, "alnum_prop": 0.7358757062146892, "repo_name": "agabert/zeus", "id": "0a5a042434a5519328796c5c781b0382b86ab360", "size": "709", ...
""" Views """ from aiohttp import web async def get_worker(request): """ Test mongodb GET. """ db = request.app['db'] cursor = db.worker.find({}) if not cursor: return web.HTTPNotFound(text='No page named') docs = await cursor.to_list(None) resp = [] for d in docs: ...
{ "content_hash": "bce829e2fbc8b5aefcc402d96ee6d82f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 53, "avg_line_length": 19.2, "alnum_prop": 0.5104166666666666, "repo_name": "grtfou/aio-tree", "id": "22895c45cc19a32b2799b1a2ef365ae208ceff7b", "size": "559", "binary": ...
import unittest from biokbase.catalog.Impl import Catalog from catalog_test_util import CatalogTestUtil class AdminMethodsTest(unittest.TestCase): def test_is_admin(self): madeUpName = 'asdfasdf' userName = self.cUtil.user_ctx()['user_id'] adminName = self.cUtil.admin_ctx()['user_id'] ...
{ "content_hash": "e54a54d3093b348f86bd8b0bf1426bc0", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 127, "avg_line_length": 54.734848484848484, "alnum_prop": 0.6060899653979239, "repo_name": "kbase/catalog", "id": "aab3a69e04de654c665bed2a547064301235049a", "size": "1445...
__doc__ = """ Generic Taskmaster module for the SCons build engine. This module contains the primary interface(s) between a wrapping user interface and the SCons build engine. There are two key classes here: Taskmaster This is the main engine for walking the dependency graph and calling things to...
{ "content_hash": "1977964b92cfbe074ef6772f4fb86a1a", "timestamp": "", "source": "github", "line_count": 1010, "max_line_length": 115, "avg_line_length": 38.353465346534655, "alnum_prop": 0.5744895061569043, "repo_name": "Distrotech/scons", "id": "be4b599195d19d95e12debb5dee02f041dde0c16", "size": "...
from django.db.backends.mysql.base import * from django.db.backends.mysql.base import DatabaseWrapper as MySQLDatabaseWrapper from django.db.backends.mysql.base import DatabaseOperations as MySQLDatabaseOperations class DatabaseOperations(MySQLDatabaseOperations): def last_executed_query(self, cursor, sql, params)...
{ "content_hash": "84207280587cff25844132765c7cc527", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 87, "avg_line_length": 45.11764705882353, "alnum_prop": 0.7366362451108214, "repo_name": "350dotorg/akcrm", "id": "097e169b4431ac64f9c695f0bfb96c1eacdc9da2", "size": "767",...
"""The Manager orchestrates the overall process of running layout tests. This includes finding tests to run, reading the test expectations, starting the required helper servers, deciding the order and way to run the tests, retrying fails tests and collecting the test results, including crash logs, and mismatches with ...
{ "content_hash": "b689190dada977418045b6208aaec632", "timestamp": "", "source": "github", "line_count": 533, "max_line_length": 171, "avg_line_length": 48.332082551594745, "alnum_prop": 0.6309149489538449, "repo_name": "danakj/chromium", "id": "67ca8bce188b6127c091266b79da0dc5c264aa6c", "size": "27...
from django.core.urlresolvers import reverse from rest_framework import status from utils.testing_helpers import AuthenticatedAPITestCase class FolderSelfTest(AuthenticatedAPITestCase): def testSuccess(self): # Create response = self.client.post(reverse('folder-self-list'), { 'name'...
{ "content_hash": "23812692ac537b9310dd77dd47ba9dbc", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 107, "avg_line_length": 38.37179487179487, "alnum_prop": 0.6271299699298363, "repo_name": "projectweekend/Links-API", "id": "dfdfa80be57669d3fdb2e1cefc0ce284544bf6ed", "siz...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/wearables/armor/composite/shared_armor_composite_boots.iff" result.attribute_template_id = 0 result.stfName("wearables_name","armor_composite_boots") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ...
{ "content_hash": "6fbd66921d536dc5ef6c61633638af6d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 95, "avg_line_length": 26.23076923076923, "alnum_prop": 0.7214076246334311, "repo_name": "obi-two/Rebelion", "id": "9b4e4bb17b61edb5e705be1d1ff9023c42cca6eb", "size": "486"...
from datetime import time import numpy as np import pytest import pytz from pandas._libs.tslibs import timezones from pandas import ( DataFrame, date_range, ) import pandas._testing as tm class TestAtTime: @pytest.mark.parametrize("tzstr", ["US/Eastern", "dateutil/US/Eastern"]) def test_localized_a...
{ "content_hash": "960e8859ddba06b44f997fd7eb52f199", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 81, "avg_line_length": 35.578125, "alnum_prop": 0.5781730346947739, "repo_name": "gfyoung/pandas", "id": "2d05176d20f5f76fb0414fbd860524e81648ad98", "size": "4554", "bin...
import operator from xadmin import widgets from xadmin.util import get_fields_from_path, lookup_needs_distinct from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured, ValidationError from django.db import models from django.db.models.fields import FieldDoesNotExist from django.db.models.fields.re...
{ "content_hash": "5cfb1bbea029b21d30a0eb73d40dae96", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 143, "avg_line_length": 43.598130841121495, "alnum_prop": 0.5534833869239014, "repo_name": "Mtax/xadmin-khb", "id": "adfa70da9cadfc02b8741216ee0cd17f48b14219", "size": "93...
""" Cisco_IOS_XE_mpls_ldp This module contains a collection of YANG definitions for the Cisco MPLS LDP configuration and operational data. The configuration is held in the mpls\-ldp\-config container which is broken into the following sections\: 1) global\-cfg contains configuration applicable to the entire ...
{ "content_hash": "a40317699f64b4495ef4653ed9324c18", "timestamp": "", "source": "github", "line_count": 13983, "max_line_length": 882, "avg_line_length": 38.275191303725954, "alnum_prop": 0.4504112465947437, "repo_name": "111pontes/ydk-py", "id": "8fa0715d5888f6d0dd1ac74077a15ed27406aaa5", "size": ...
from django import forms from django.template.loader import render_to_string from uni_form.helpers import FormHelper, Submit, Reset from uni_form.helpers import Layout, Fieldset, Column, Row, HTML class TestForm(forms.Form): character_field = forms.CharField(label="Character Field", help_text="I am help te...
{ "content_hash": "b8595aed04c1f0b24d73ccb891cd2d2f", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 146, "avg_line_length": 41.083333333333336, "alnum_prop": 0.44949290060851926, "repo_name": "codepython/CollectorCity-Market-Place", "id": "8daa73a00cc31896831c83a91ff2cc8dc...
import mock from openstackclient.common import exceptions from openstackclient.network import common from openstackclient.tests import utils RESOURCE = 'resource' RESOURCES = 'resources' NAME = 'matrix' ID = 'Fishburne' class TestFind(utils.TestCase): def setUp(self): super(TestFind, self).setUp() ...
{ "content_hash": "e6da7443278131227233d3c02ee6fa06", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 33.67796610169491, "alnum_prop": 0.6134876698540513, "repo_name": "JioCloud/python-openstackclient", "id": "b30fdfcb35951aa5435bc0c70808f00362e6d626", ...
""" 39. Testing using the Test Client The test client is a class that can act like a simple browser for testing purposes. It allows the user to compose GET and POST requests, and obtain the response that the server gave to those requests. The server Response objects are annotated with the details of the contexts and ...
{ "content_hash": "1e247e365626d4ed1c58ee6e00fa24e2", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 148, "avg_line_length": 42.33888888888889, "alnum_prop": 0.6542448497572497, "repo_name": "oscaro/django", "id": "df8515bcff3bdd65d144550be50a2ac9e0a158b8", "size": "22887...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np # type: ignore import onnx from ..base import Base from . import expect class Tanh(Base): @staticmethod def export(): # type: () -> None ...
{ "content_hash": "dbc09634a67b1acff8bde64856adce92", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 26.193548387096776, "alnum_prop": 0.5591133004926109, "repo_name": "mlperf/training_results_v0.6", "id": "c01e76b88a358bcde4ccb440f23cd728a04125cb", ...
from django.db import models from . import Geoposition from .forms import GeopositionField as GeopositionFormField from django.utils.encoding import smart_unicode class GeopositionField(models.Field): description = "A geoposition (latitude and longitude)" __metaclass__ = models.SubfieldBase def __init__...
{ "content_hash": "31a37ad8a6bc8422ff033c5038a5102d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 66, "avg_line_length": 28.313725490196077, "alnum_prop": 0.6052631578947368, "repo_name": "coxmediagroup/django-geoposition", "id": "dc841f4b5d3934e5390d69f87f8ea1d83f86702f"...
from pymongo import MongoClient from flask import session client = MongoClient() db = client.pcparts def register(username,password,chkpw,email): if(db.users.find({"username":username}).count()) != 0: return "There is a account with that username" elif(chkpw != password): return "Passwords ar...
{ "content_hash": "57d8c293410b7cc7be593a9d793c9052", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 88, "avg_line_length": 34.07692307692308, "alnum_prop": 0.6455981941309256, "repo_name": "stuycs-softdev-fall-2013/proj3-6-JJTS", "id": "2525397bd73bbaba2e67b295ad64e094dcdd8...
import os import json from flask import Flask, request, Response from flask import render_template, send_from_directory, url_for app = Flask(__name__) app.config.from_object('url_short.config') app.url_map.strict_slashes = False import url_short.views
{ "content_hash": "407c0e147a149d8d78b534439bb68b6c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 63, "avg_line_length": 21.333333333333332, "alnum_prop": 0.765625, "repo_name": "neerajrao/redis-url-shorten", "id": "eeaf94bc1cc992a6b54b6587ecaaef2a86dfb5cd", "size": "25...
from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models class ExpressRouteCircuitAuthorizationsOperations(object): """ExpressRouteCircuitAuthorizationsOperations operations. ...
{ "content_hash": "179d226fd721b63c276d91396db5fa08", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 180, "avg_line_length": 47.17836257309941, "alnum_prop": 0.651688875116207, "repo_name": "SUSE/azure-sdk-for-python", "id": "46a69e0b448eadb55950b0d77461cae721d096e8", "si...
from flask import Blueprint admin = Blueprint('admin', __name__) from . import views
{ "content_hash": "d5cdaf392621d75dbcc13f7f09ef3dad", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 36, "avg_line_length": 17.4, "alnum_prop": 0.7126436781609196, "repo_name": "StarInworld/voluntary", "id": "66bcf9bafc530b3c3f01213e4a17c570fe6da457", "size": "178", "bina...
from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("contentstore", "0007_auto_20171102_0950"), ("subscriptions", "0007_auto_20171102_0950"), ] operations = [ m...
{ "content_hash": "5a63e2bc5b6f9427ee6f20212539f3c3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 73, "avg_line_length": 31, "alnum_prop": 0.4186684969114619, "repo_name": "praekelt/seed-staged-based-messaging", "id": "c5235a3fa5c72455c43f60e73e714453ea06ef04", "size": ...
from flask import redirect, url_for from flask_login import current_user from .account import SignIn, signout,\ github_auth, github_auth_grant, github_auth_revoke,\ weibo_auth, weibo_auth_grant, weibo_auth_revoke from .dashboard import dashboard from .posts import posts, PostsWrite from .srm import list_proble...
{ "content_hash": "8bd7cec5235765065b005331adca778e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 56, "avg_line_length": 31.176470588235293, "alnum_prop": 0.7339622641509433, "repo_name": "warmsea/warmsea.net", "id": "d5905e184b64b4bf4bf5cdec6cf7297871e1efa4", "size": "...
""" James found a love letter his friend Harry has written for his girlfriend. James is a prankster, so he decides to meddle with the letter. He changes all the words in the letter into palindromes. To do this, he follows 2 rules: (a) He can reduce the value of a letter, e.g. he can change 'd' to 'c', but he cannot ...
{ "content_hash": "b9d7fc73ce567c7f52200942b5b89ca5", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 120, "avg_line_length": 30.836363636363636, "alnum_prop": 0.6179245283018868, "repo_name": "algorhythms/HackerRankAlgorithms", "id": "c005d0a854790442ca611a76587f5223ca5bbc66...
import unittest import io class TestThreadedTaskDispatcher(unittest.TestCase): def _makeOne(self): from waitress.task import ThreadedTaskDispatcher return ThreadedTaskDispatcher() def test_handler_thread_task_is_None(self): inst = self._makeOne() inst.threads[0] = True ...
{ "content_hash": "0c333945a1b15695f00d0c960cbc8410", "timestamp": "", "source": "github", "line_count": 931, "max_line_length": 82, "avg_line_length": 37.578947368421055, "alnum_prop": 0.6047561881895616, "repo_name": "stefanv/aandete", "id": "2a2759a23a041940465c264f9e31538b68ebd1e0", "size": "349...
import os import shutil import yaml import glob from momo.utils import run_cmd, mkdir_p, utf8_encode, txt_type, eval_path from momo.plugins.base import Plugin BASE_CONFIG_NAME = '__base__' class Mkdocs(Plugin): mkdocs_configs = { 'theme': 'readthedocs', } momo_configs = { 'momo_root_name...
{ "content_hash": "074b04463b03e0011c694fe1d12dba56", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 79, "avg_line_length": 38.49683544303797, "alnum_prop": 0.5071927661323469, "repo_name": "shichao-an/momo", "id": "c19d73a1ac5887d0b3c645920b673a668f3a1f63", "size": "1216...
""" Copyright 2022 Google LLC 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, software distri...
{ "content_hash": "d10c1c44ceb32fb2c0946891d3cee2bd", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 78, "avg_line_length": 37.8421052631579, "alnum_prop": 0.605702364394993, "repo_name": "gsuitedevs/python-samples", "id": "82efa71dfc004279a4e48f5074cefba15ce608fa", "size"...
""" Definitions of standard actions """ from abc import abstractmethod from obviousli.defs import State, Action, Truth class GiveUpAction(Action): """ Do a single thing: give up. """ def __init__(self): super(GiveUpAction, self).__init__(None) def __lt__(self, other): return isin...
{ "content_hash": "a9d6df2eb5216907b97c76f34ee2c8c3", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 117, "avg_line_length": 31.324324324324323, "alnum_prop": 0.6160483175150993, "repo_name": "arunchaganty/obviousli", "id": "3091db1f617c41e75bb60f8c059943d7ff0b5739", "siz...
from djinni.support import MultiSet # default imported in all files from djinni.exception import CPyException # default imported in all files from djinni.pycffi_marshal import CPyObject, CPyString from PyCFFIlib_cffi import ffi, lib from djinni import exception # this forces run of __init__.py which gives cpp option t...
{ "content_hash": "3ba6cc1f87026945548ab4575b91f754", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 125, "avg_line_length": 40.166666666666664, "alnum_prop": 0.6758875057630245, "repo_name": "trafi/djinni", "id": "0b7ab7baaf14593f7a8e79857ca6cc0abc0e2e96", "size": "2267",...
from django.views import generic from .forms import TestForm from .models import TestModel class TestView(generic.UpdateView): model = TestModel form_class = TestForm template_name = 'form.html' def get_success_url(self): return self.request.path
{ "content_hash": "e66b2771a434c0f4c18086b87c627553", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 35, "avg_line_length": 21.153846153846153, "alnum_prop": 0.72, "repo_name": "Eraldo/django-autocomplete-light", "id": "38d82b9100f2956d27393c6920e9362856365bfc", "size": "2...
""" Use the AppVeyor API to download Windows artifacts. Taken from: https://bitbucket.org/ned/coveragepy/src/tip/ci/download_appveyor.py # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """ from __future__ import ...
{ "content_hash": "1e5c9b7145deb986a4a7238a917b84b9", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 104, "avg_line_length": 35.31481481481482, "alnum_prop": 0.6137912952281069, "repo_name": "rfleschenberg/django-shop-rest-checkout", "id": "e8098c888ce5f958686d0f4fbd782fb04...
from .about import *
{ "content_hash": "73e8389d352e499a3772441c1153bcea", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 20, "avg_line_length": 21, "alnum_prop": 0.7142857142857143, "repo_name": "ryfeus/lambda-packs", "id": "a55014485a1e94a14df8dfaf1bce1c2921d047c3", "size": "21", "binary": ...
import json from twisted.trial import unittest from hashlib import sha256 from nacl.public import PrivateKey, PublicKey, Box from .common import TwoNodeMixin from ..mailbox import channel from ..mailbox.server import parseMsgA, parseMsgB class msgC(TwoNodeMixin, unittest.TestCase): def test_create_and_parse(self):...
{ "content_hash": "d3d55088be7e91033dc69dfed7698ac7", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 79, "avg_line_length": 42.1, "alnum_prop": 0.6190887497300799, "repo_name": "warner/petmail", "id": "030522a30e0995e579a53f6b9b5a7bf2fd709216", "size": "4631", "binary":...
"""Middleware classes for johnny cache.""" from django.middleware import transaction as trans_middleware from django.db import transaction from johnny import cache, settings class QueryCacheMiddleware(object): """ This middleware class monkey-patches django's ORM to maintain generational info on each tab...
{ "content_hash": "a2ea8771098837b865e92cc00dcd8c7e", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 78, "avg_line_length": 33.73770491803279, "alnum_prop": 0.6574344023323615, "repo_name": "havard024/prego", "id": "3df96611aaa45bd919ce934c002c3ff2d3fdbb61", "size": "2105"...
"""Boto3 session example.""" import boto3.session from dependency_injector import containers, providers class Service: def __init__(self, s3_client, sqs_client): self.s3_client = s3_client self.sqs_client = sqs_client class Container(containers.DeclarativeContainer): config = providers.Con...
{ "content_hash": "43f514ad6a285e036e513b75cabf7957", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 97, "avg_line_length": 28.51388888888889, "alnum_prop": 0.665854846566001, "repo_name": "ets-labs/dependency_injector", "id": "33ed85f6dd4ffb0cf0fd7d12844a69a572b02a71", "s...
import os from distutils.core import setup from pyngdom import __version__ try: f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) long_description = f.read() f.close() except: long_description = '' setup( name='pyngdom', version=__version__, packages=['pyngdom'], author=...
{ "content_hash": "1ceab4594e64af2c6f6d5725f21043f3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 82, "avg_line_length": 30.314285714285713, "alnum_prop": 0.6248821866163996, "repo_name": "Epi10/pyngdom", "id": "3f34507bf59f858513080a161a5c8e56315d67dc", "size": "1062",...
from flask import g from oauthlib.oauth2.rfc6749.clients.web_application import WebApplicationClient from werkzeug.local import LocalProxy from flask_dance.consumer import OAuth2ConsumerBlueprint __maintainer__ = "Ryan Schaffer <[email protected]>" AUTH_HEADER = "auth_header" URI_QUERY = "query" BODY = "body" ZO...
{ "content_hash": "cf422ead408e699218c8b0a19ccb4192", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 103, "avg_line_length": 37.856115107913666, "alnum_prop": 0.6554541999239832, "repo_name": "singingwolfboy/flask-dance", "id": "12f25716c07716925d307dffe3095f9b4216ea68", ...
from django.db import models # Create your models here. class Author(models.Model): name = models.CharField(max_length=127, unique=True) def __str__(self): return self.name class Gender(models.Model): name = models.CharField(max_length=3, unique=True) description = models.CharField(max_length...
{ "content_hash": "744c8fbf0b05e1eddc08eaf291f61226", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 126, "avg_line_length": 43.53333333333333, "alnum_prop": 0.6822358346094947, "repo_name": "philpot/tocayo", "id": "8a321b338c0dd5106dad3ad8edebb7bfd1e1bc21", "size": "5224...
from django.test import TestCase customer_data = { 'username': 'panosl', 'first_name': 'Panos', 'last_name': 'Laganakos', 'email': '[email protected]', 'address': 'omirou 17', 'city': 'Kalamata', 'country': '1', 'password1': '12345', 'password2': '12345', } class CustomerCreationTest(TestCase): fi...
{ "content_hash": "fe053b94dccd027a9fd2ccc711c84e68", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 78, "avg_line_length": 25.925925925925927, "alnum_prop": 0.7014285714285714, "repo_name": "panosl/helios", "id": "7f1f79f25ec35b122bee1d2c4536690fb0757dc8", "size": "780", ...
from setuptools import setup, find_packages setup( name='sorl-thumbnail', use_scm_version=True, description='Thumbnails for Django', long_description=open('README.rst').read(), author="Mikko Hellsing", author_email='[email protected]', maintainer="Jazzband", maintainer_email="roadies@jazzba...
{ "content_hash": "afc425ee6f4cd18e671e469e7f00cec8", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 59, "avg_line_length": 35.62162162162162, "alnum_prop": 0.5986342943854325, "repo_name": "jazzband/sorl-thumbnail", "id": "c5d60b234308cfd31e16b7e8c677c3a02752cc0c", "size"...
#!/usr/bin/env python """ Example usage for the LearnTransducer class. The algorithm is used to infer a sample python implementation of the ReplaceComments() function used by Mod-Security to deobfuscate inputs before they are passed through SQL injection filters. For details on the inference algorithm see the paper * ...
{ "content_hash": "29255f4fcccb38ad5412ab6ce4eb366b", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 85, "avg_line_length": 30.873015873015873, "alnum_prop": 0.5956298200514138, "repo_name": "GeorgeArgyros/sflearn", "id": "b96456260e73c2d0d8e204f6747777147ea2c4cb", "size"...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "BoxCox", sigma = 0.0, exog_count = 100, ar_order = 12);
{ "content_hash": "aa18f884040987697c376c623b2117ff", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 162, "avg_line_length": 37.42857142857143, "alnum_prop": 0.7022900763358778, "repo_name": "antoinecarme/pyaf", "id": "84080296487f9ee5ff2c39e05b117ef02de54cc1", "size": "262...
"""Abseil Python logging module implemented on top of standard logging. Simple usage:: from absl import logging logging.info('Interesting Stuff') logging.info('Interesting Stuff with Arguments: %d', 42) logging.set_verbosity(logging.INFO) logging.log(logging.DEBUG, 'This will *not* be printed') ...
{ "content_hash": "aa78a809eb3b28452e71557ba8d0bacf", "timestamp": "", "source": "github", "line_count": 1226, "max_line_length": 97, "avg_line_length": 33.296900489396414, "alnum_prop": 0.670006369114693, "repo_name": "abseil/abseil-py", "id": "c0ba4b0fa245fe01bb4cdf9872a96836afb1e781", "size": "41...
"""The datastore models for histograms and diagnostics.""" import json import sys from google.appengine.ext import ndb from dashboard.models import graph_data from dashboard.models import internal_only_model class JsonModel(internal_only_model.InternalOnlyModel): # Similarly to Row, we don't need to memcache the...
{ "content_hash": "87e26fdd7af671f502ac7b0c9ea54c5b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 33.03448275862069, "alnum_prop": 0.7317327766179541, "repo_name": "catapult-project/catapult-csm", "id": "ae81d148a5d7744522b9fa1c4e0dfdedeb2b2d01", ...
import json import logging import os import platform import typing from io import TextIOWrapper # Data class for a running step. class _RunningPart: def __init__(self, event_id: int, name: str, desc: str) -> None: self.event_id = event_id self.name = name self.desc = desc # Handle connec...
{ "content_hash": "416821343b414c0b927b7108144c2fb5", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 85, "avg_line_length": 28.942528735632184, "alnum_prop": 0.5702938840349484, "repo_name": "facebook/redex", "id": "d080acc2cc207e9cdf006676d786f7d2473aa58e", "size": "5256...
from http.client import HTTPConnection import json import re import base64 import sys import os import os.path settings = {} def hex_switchEndian(s): """ Switches the endianness of a hex string (in pairs of hex chars) """ pairList = [s[i:i+2].encode() for i in range(0, len(s), 2)] return b''.join(pairList...
{ "content_hash": "7d22d52d0dcbb3666ffdb067b91d6c76", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 108, "avg_line_length": 33.62237762237762, "alnum_prop": 0.5809068219633944, "repo_name": "chaincoin/chaincoin", "id": "8529470e09b8a7afa6d3a24c404e1509896e9947", "size": ...
import numpy as np from system.hardware.tici.power_monitor import sample_power if __name__ == '__main__': print("measuring for 5 seconds") for _ in range(3): pwrs = sample_power() print("mean %.2f std %.2f" % (np.mean(pwrs), np.std(pwrs)))
{ "content_hash": "3b7d8d111f27a3a31d4231fafdbb6540", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 63, "avg_line_length": 31.625, "alnum_prop": 0.6403162055335968, "repo_name": "commaai/openpilot", "id": "5d6885136792db3dc5d5c3aeb4685a64380e8b0b", "size": "276", "binary...
"""Support for Abode Security System covers.""" import logging import abodepy.helpers.constants as CONST from homeassistant.components.cover import CoverDevice from . import AbodeDevice from .const import DOMAIN _LOGGER = logging.getLogger(__name__) async def async_setup_platform(hass, config, async_add_entities,...
{ "content_hash": "0d77140bef92383a3cb57cbe936cb2f3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 86, "avg_line_length": 26, "alnum_prop": 0.6794871794871795, "repo_name": "leppa/home-assistant", "id": "a4fce7e7b8acacf6086a27d53c6990a955ed69ff", "size": "1170", "binar...
from datetime import datetime import logging from rest_framework import generics from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view from django.conf import settings from django.shortcuts import render_to_response from django.template import R...
{ "content_hash": "739df7200d295d473d5b3e86490beb95", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 116, "avg_line_length": 33.37883008356546, "alnum_prop": 0.6362346657765168, "repo_name": "bluven/eonboard", "id": "8dca1b265f1553495246f1df2f0c2c5813a44b44", "size": "120...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import io import os import os.path import sys import stat import tempfile import traceback from collections import namedtuple from yaml import load as yaml_load try: # use C version if possible for speedup from yaml import...
{ "content_hash": "91084a2e46563d6e4d3001ca3a9e217e", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 157, "avg_line_length": 42.265917602996254, "alnum_prop": 0.582100132919805, "repo_name": "SergeyCherepanov/ansible", "id": "ec3fc8e60143e24c625b73b5c5721c909a4f3378", "si...
import re from cradmin_legacy import crinstance from devilry.apps.core.models import Assignment from devilry.devilry_examiner.cradminextensions import devilry_crmenu_examiner from devilry.devilry_cradmin import devilry_crinstance from devilry.devilry_examiner.views.assignment import grouplist from devilry.devilry_exa...
{ "content_hash": "e6068909f2253cdaf5fa4b7b24f02beb", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 89, "avg_line_length": 33.58490566037736, "alnum_prop": 0.700561797752809, "repo_name": "devilry/devilry-django", "id": "7d627ce41617e86436864d3db440aaa06bcfb7c6", "size": ...
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized, parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface im...
{ "content_hash": "4b4b92c38c5051e80cb896063b3a388c", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 118, "avg_line_length": 38.67272727272727, "alnum_prop": 0.6114245416078985, "repo_name": "huggingface/transformers", "id": "8fb60d64a61f8cf5e5123795057cc0eed52ec69a", "si...
"""Parallel workflow execution via Condor DAGMan """ import os import sys import uuid import time from warnings import warn from .base import (GraphPluginBase, logger) from ...interfaces.base import CommandLine class CondorDAGManPlugin(GraphPluginBase): """Execute using Condor DAGMan The plugin_args input...
{ "content_hash": "eeaa5a5ce5be120481f0b3f87ece2437", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 102, "avg_line_length": 46.05917159763314, "alnum_prop": 0.545606372045221, "repo_name": "iglpdc/nipype", "id": "4f89a13ce684cbb250b5a007e6891863162fc031", "size": "7784",...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('dictionary', '0002_word_category'), ] operations = [ migrations.AddField( model_name='word', name='times_practiced', ...
{ "content_hash": "3d330dfb01145d3760d9a7e4da2e7577", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 57, "avg_line_length": 22.263157894736842, "alnum_prop": 0.5981087470449172, "repo_name": "burun/FinnDict-sqlite", "id": "fc1d495ae40329aabf9ff769d6b34c41a134fe28", "size":...
from django.views import i18n from django.conf.urls import url from django.urls import path from django.contrib import admin from django.contrib.auth.views import LoginView import mittab.apps.tab.views as views import mittab.apps.tab.judge_views as judge_views import mittab.apps.tab.team_views as team_views import mit...
{ "content_hash": "5a7d50ff4d981be38f711ddb23f70c09", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 83, "avg_line_length": 41.15725806451613, "alnum_prop": 0.6247673165474674, "repo_name": "jolynch/mit-tab", "id": "03b0f9b5186972942c1c630faa6c5e6f1c0998e9", "size": "1020...
"""nova HACKING file compliance testing built on top of pep8.py """ import fnmatch import inspect import logging import os import re import subprocess import sys import tokenize import warnings import pep8 # Don't need this for testing logging.disable('LOG') #N1xx comments #N2xx except #N3xx imports #N4xx docstrin...
{ "content_hash": "a43bdfd83f6cab05922000531dac9f8a", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 79, "avg_line_length": 34.42004264392324, "alnum_prop": 0.5689772656879143, "repo_name": "fajoy/nova", "id": "a860aa37b4c5fba33e883adae89b65fb4a18a159", "size": "16843", ...
from __future__ import division from laspy.file import File import numpy as np import pandas as pd import time, math def timing(f): def wrap(*args): time1 = time.time() ret = f(*args) time2 = time.time() print('%s function took %0.3f ms' % (f.func_name, (time2-time1)*1000.0)) ...
{ "content_hash": "ffebe48b7eae244011f761cc7abd6df8", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 142, "avg_line_length": 37.85087719298246, "alnum_prop": 0.6047122441096948, "repo_name": "ArcticSnow/dempy", "id": "4a43fd1adc81b5d0235d6e60129b9448ec625da5", "size": "12...
from datetime import datetime from collections.abc import Iterable import confluent_kafka from config import get_kafka_args from db.models import WeiboData from logger import crawler conf = get_kafka_args() data_type_dict = {'dataset': 0, 'datastream': 1, 'keyword': 2, 'home': 3} def produce_data_list(topic: str, d...
{ "content_hash": "327929aba6bc686b018f7b646124a7a5", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 108, "avg_line_length": 39.73913043478261, "alnum_prop": 0.6265499635302699, "repo_name": "yzsz/weibospider", "id": "9e455d6d3289285fab954c27ac0d27cb0d5c6e8a", "size": "297...
import numpy as np import tvm import tvm.testing from tvm import relay from tvm.relay.backend.interpreter import Value, TupleValue, TensorValue from tvm.relay.backend.interpreter import RefValue, ConstructorValue from tvm.relay.scope_builder import ScopeBuilder from tvm.relay import testing, create_executor def check...
{ "content_hash": "0d0ff4db873ca94dd6273313bad21aff", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 99, "avg_line_length": 34.06995884773662, "alnum_prop": 0.614325401618553, "repo_name": "Huyuwei/tvm", "id": "c1a19c4d9bb19d66e20c431b0f631277fda24347", "size": "9064", ...
"""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" __revision__ = "$Id: build_ext.py 65670 2008-08-14 07:35:13Z hirokazu.yamamoto $" import sys, os, re from site import USER_BASE, ...
{ "content_hash": "fb13da603d448b9f809854133b360fa3", "timestamp": "", "source": "github", "line_count": 730, "max_line_length": 86, "avg_line_length": 43.14794520547945, "alnum_prop": 0.5621626769953648, "repo_name": "MalloyPower/parsing-python", "id": "32b041bd99a8ccc3de52b0744fcc00b99a48ca28", "s...
from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = webdriver.Firefox() driver.get("http://www.python.org") assert "Python" in driver.title elem = driver.find_element_by_name("q") elem.clear() elem.send_keys("pycon") elem.send_keys(Keys.RETURN) assert "No results found." not in driv...
{ "content_hash": "a277db4838b497336185f0cb9ab858a0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 52, "avg_line_length": 29.166666666666668, "alnum_prop": 0.7657142857142857, "repo_name": "ruslan2k/public-files", "id": "19523ddcd15ff808743fc85bd5a4a3a4cbf2eee9", "size":...
from __future__ import division import net.grinder.script.Grinder package_path = net.grinder.script.Grinder.grinder.getProperties().getProperty( "grinder.package_path") import sys sys.path.append(package_path) from coverage import coverage cov = coverage() cov.start() import time import utils import ingest impo...
{ "content_hash": "b3d4479260b551b15b7da61fc7118989", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 237, "avg_line_length": 44.959847036328874, "alnum_prop": 0.5921578634005273, "repo_name": "VinnyQ/blueflood", "id": "b06876c815f9aeafe39badcf80cdc2bddcca64f3", "size": "2...
""" Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 The version of the OpenAPI document: 1.5.1-pre.0 Contact: [email protected] Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: fr...
{ "content_hash": "40049bfa49bc85f0a82e0328d8912410", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 85, "avg_line_length": 27.723076923076924, "alnum_prop": 0.5477247502774695, "repo_name": "cliffano/swaggy-jenkins", "id": "6feaf46d4ab0bdb114ee593e7b5c13c7b99979db", "siz...
""" WSGI config for django_shopfront project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJ...
{ "content_hash": "15887500e9b941a6c61038c4af76f6a5", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.625, "alnum_prop": 0.775609756097561, "repo_name": "rapilabs/django-shopfront", "id": "8d1f3b5c498741f67f58f5c9ad90d4de24a8afc6", "size": "410", ...
""" various utilities """ import os import logging import urllib from urllib.request import urlopen from email.utils import formataddr from email.mime.text import MIMEText from configparser import ConfigParser __all__ = ["Configuration", "get_page", "setup_logging"] class Borg(object): """ A class which "share...
{ "content_hash": "e9847afb5188d16f5fca1a325747b876", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 99, "avg_line_length": 27.257142857142856, "alnum_prop": 0.6546121593291404, "repo_name": "pmav99/check_prices", "id": "3becfd1e7c4c0982fe87ee387a9a447c0098c34d", "size": "...
from rest_framework import serializers from mkt.webapps.serializers import SimpleAppSerializer, SimpleESAppSerializer from mkt.websites.serializers import ESWebsiteSerializer, WebsiteSerializer class TVAppSerializer(SimpleAppSerializer): tv_featured = serializers.IntegerField() class Meta(SimpleAppSerializer...
{ "content_hash": "d2a0f9003624bb05854c7b93bc195015", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 36.45614035087719, "alnum_prop": 0.6467757459095284, "repo_name": "diox/zamboni", "id": "2e11ffe79d2e05651e77fb7ff26ea4e0e9381cec", "size": "2078", ...
import smtplib from email.mime.text import MIMEText from config import GMAIL_CONFIG def send_mail(to_list,sub,content): ''' to_list:发给谁 sub:主题 content:内容 send_mail("[email protected]","sub","content") ''' mail_host = GMAIL_CONFIG['mail_host'] mail_port = GMAIL_CONFIG['mail_port'] m...
{ "content_hash": "c31b0b27c2b4a59b64a503073670c9af", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 51, "avg_line_length": 26.323529411764707, "alnum_prop": 0.5910614525139665, "repo_name": "zhkzyth/a-super-fast-crawler", "id": "e89c85c69693f27ee33f482edc8a0f001b591a3e", ...
"""A converter from a tf1 ALBERT encoder checkpoint to a tf2 encoder checkpoint. The conversion will yield an object-oriented checkpoint that can be used to restore a AlbertTransformerEncoder object. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function impor...
{ "content_hash": "506ccf56de154ef3ba1bad3e8de6eecf", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 80, "avg_line_length": 37.26271186440678, "alnum_prop": 0.7088924266545372, "repo_name": "tombstone/models", "id": "402bc1445bed575362598d09212d14d03b629179", "size": "508...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/misc/shared_mt_flatbread.iff" result.attribute_template_id = -1 result.stfName("item_n","mt_flatbread") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "638f1dcfdc3c9a350ace9529a9c66bec", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 70, "avg_line_length": 23.076923076923077, "alnum_prop": 0.69, "repo_name": "obi-two/Rebelion", "id": "cbb73781f986ff1c0804f1332df42f1bdbd7516d", "size": "445", "binary":...
"""An I/O event loop for non-blocking sockets. In Tornado 6.0, `.IOLoop` is a wrapper around the `asyncio` event loop, with a slightly different interface for historical reasons. Applications can use either the `.IOLoop` interface or the underlying `asyncio` event loop directly (unless compatibility with older version...
{ "content_hash": "c8e21d13c24c676be5d367713096c23b", "timestamp": "", "source": "github", "line_count": 969, "max_line_length": 88, "avg_line_length": 37.60061919504644, "alnum_prop": 0.6072732262933992, "repo_name": "lilydjwg/tornado", "id": "cf5a85c9f2a28968844e1bad97660f774fbda20b", "size": "370...
''' Script to plot evolution of parameters in neurotune ''' import math import numpy as np def plot_generation_evolution(sim_var_names, target_values = {}, individuals_file_name = '../data/ga_individuals.csv', s...
{ "content_hash": "725bac59014b9e15d43faedd359b7ea4", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 130, "avg_line_length": 33.112994350282484, "alnum_prop": 0.5405220952055964, "repo_name": "vellamike/neurotune", "id": "b486966ad0994940b2f583ca5a3cc061cb703f89", "size":...
''' Created on 2017. 02. 12 Updated on 2017. 02. 12 @author: ''' from __future__ import print_function import os from commons import DataLoader from commons import Subjects from commons import VersionUtil from utils import Progress class CodeRelevancy(DataLoader): __name__ = u'CodeRelevancy' isSplitCamel = False ...
{ "content_hash": "ac19d66d56cfd6431ae0485d55dbe661", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 173, "avg_line_length": 37.544, "alnum_prop": 0.6294481142126571, "repo_name": "irblsensitivity/irblsensitivity", "id": "3444cc95fa94dd3106e14657ee717c6cc3bcd5b1", "size":...
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation class Tena...
{ "content_hash": "e210e110109eb02a1ed65db093d9dda5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 219, "avg_line_length": 37.0609756097561, "alnum_prop": 0.7351102336294834, "repo_name": "Mozu/mozu-python-sdk", "id": "56a9622a352903ee2fad6cb2f003471c36bb0342", "size": "...
"""Base class for optimizers.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc from tensorflow.python.eager import backprop from tensorflow.python.eager import context from tensorflow.python.framework import dtypes...
{ "content_hash": "c6f424ae009ed3e9d257c352278957f9", "timestamp": "", "source": "github", "line_count": 1039, "max_line_length": 115, "avg_line_length": 38.75553416746872, "alnum_prop": 0.6738023691856856, "repo_name": "Xeralux/tensorflow", "id": "bf79714f9682e60b97788b8b470821cfe9290886", "size": ...
""" Run a genetic algorithm to find an appropriate architecture for some image classification task with Keras+TF. To use, define a `GenomeHandler` defined in genomehandler.py. Then pass it, with training data, to a DEvol instance to run the genetic algorithm. See the readme for more detailed instructions. """ from __...
{ "content_hash": "e56ec334fadd06bbdf27a5e43593d3ba", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 104, "avg_line_length": 36.92657342657343, "alnum_prop": 0.5544929457437743, "repo_name": "joeddav/devol", "id": "0eab94655442cae6352f2148c64e53e04eec46ad", "size": "10561...
import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data import matplotlib.pyplot as plt import matplotlib.cm as cm import argparse import sys import numpy as np import os.path import csv import random csv_file_name = "train.csv" test_csv_file_name = "test.csv" train_file_n...
{ "content_hash": "ca26e7fa1472cb1e912fdc2622bad710", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 154, "avg_line_length": 40.19047619047619, "alnum_prop": 0.5844717033732925, "repo_name": "sijiangdu/Tensorflow", "id": "45a8dc4c861d5a52f2b81e332f2f90434b8ab187", "size":...
""" `Unit tests for cargo.builder.create_user` --·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·-- 2016 Jared Lunde © The MIT License (MIT) http://github.com/jaredlunde """ import unittest import psycopg2 from vital.security import randkey from cargo import ORM, db, fields, Func...
{ "content_hash": "110fd3bacf3c69cba835cb21e2836303", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 80, "avg_line_length": 31.296296296296298, "alnum_prop": 0.5568047337278107, "repo_name": "jaredlunde/cargo-orm", "id": "3ed465f7099b070cfcc46cf21851df99211c8e6c", "size": ...