text
stringlengths
4
1.02M
meta
dict
%reset %pylab %pdb off # Can do "%pylab" or "%pylab inline" # Cheat sheet: # np.array([v1, v2]) # np.array([rVec[0], iVec[0], cVec[0]]) # makes a 3x3 matrix # np.linspace(v1, v2, numPoints) # np.concatenate(( a1, a2 )) # <headingcell level=3> # Import libraries # <codecell> import numpy as np import scipy.integ...
{ "content_hash": "19353dc7094dbe33c693746190171981", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 222, "avg_line_length": 42.50956937799043, "alnum_prop": 0.6847881141313523, "repo_name": "aerosara/thesis", "id": "5c93480ac8b9c9b7576a58bca26f7bf51a72737a", "size": "178...
from django import forms from django.contrib.auth.models import User from reserva.models import Libro, Reserva from functools import partial import datetime from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ DateInput = partial(forms.DateInput, {'class': 'datepicker'}...
{ "content_hash": "408970fb7720fad50f2871052e340577", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 112, "avg_line_length": 43.56818181818182, "alnum_prop": 0.6864893062076161, "repo_name": "fmoreyra/ReservaLibrosISOO", "id": "7ee241b13311f58a5924bf9d1901aea05775d41e", "s...
from subprocess import call import sys import os try: os.remove(sys.argv[2]) except: pass call(["scrapy", "crawl", sys.argv[1], "-o", sys.argv[2]])
{ "content_hash": "6ab4f131abb0cce3d6bbc847d4decfe7", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 57, "avg_line_length": 17.444444444444443, "alnum_prop": 0.6496815286624203, "repo_name": "hovhannest/TMScrappers", "id": "345d928a7a4e60c6b502b213b412cf438ee49c5d", "size":...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import shutil import tempfile from operator import itemgetter import py import pytest import yaml from ...helpers import build_config_details from compose.config import config from compose.c...
{ "content_hash": "bb7c180c80979c1e4390d1fae99a9b5d", "timestamp": "", "source": "github", "line_count": 4462, "max_line_length": 105, "avg_line_length": 33.104437471985655, "alnum_prop": 0.4513038886481802, "repo_name": "shakamunyi/fig", "id": "8f2266ed8d5cdd2fe8424e55634596bac178a24e", "size": "14...
from pandac.PandaModules import * from direct.showbase import DirectObject from direct.fsm import ClassicFSM, State from toontown.toonbase import ToontownGlobals from toontown.coghq import StageRoomSpecs import random class StageRoom(DirectObject.DirectObject): FloorCollPrefix = 'stageFloorColl' CashbotStageDo...
{ "content_hash": "626945c35c5197ed8172e80a8610f27c", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 345, "avg_line_length": 32.08653846153846, "alnum_prop": 0.6356008390770153, "repo_name": "linktlh/Toontown-journey", "id": "04da9f44838ba58c5d1b984f9785131f9dec1d2e", "si...
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import pytest from typepy import RealNumber from pingparsing import PingTransmitter from pingparsing._parser import IcmpReplyKey from .common import ping_parser # noqa: W0611 @pytest.fixture def transmitter(): return PingTransmitter() c...
{ "content_hash": "e5d9abf5f5ceaaf94e762063a7f99806", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 87, "avg_line_length": 35.33116883116883, "alnum_prop": 0.629663664767506, "repo_name": "thombashi/pingparsing", "id": "4388c8e09829c324f4f0de4d41b0e77be8834af5", "size": ...
from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import InterfaceError class DatabaseFeatures(BaseDatabaseFeatures): allows_group_by_selected_pks = True can_return_id_from_insert = True has_real_datatype = True has_native_uuid_field = True has_native_duration_...
{ "content_hash": "1d606a473783bae9a523e19fe197b3c6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 35.275862068965516, "alnum_prop": 0.729227761485826, "repo_name": "gannetson/django", "id": "3c5aebfef861d77ca1ef62ad42aeb026cdd080e9", "size": "1023...
import unittest import os from pydoop.mapreduce.string_utils import quote_string, unquote_string from pydoop.mapreduce.string_utils import create_digest from pydoop.utils.serialize import deserialize from pydoop.mapreduce.binary_streams import BinaryDownStreamFilter _CURRENT_DIR = os.path.dirname(__file__) JOB_TOKEN ...
{ "content_hash": "eb94463a66febd505c1a37c8380a9c1d", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 34.58490566037736, "alnum_prop": 0.6475722858701582, "repo_name": "ilveroluca/pydoop", "id": "b684909d0084fecbb7c56bb29cf5bc1fead32528", "size": "244...
import json def open_json_data_file(path): print('Читаем данные из файла: {}'.format(path)) try: with open(path, 'r', encoding='utf8') as f: try: data = json.loads(f.read()) return data except: print('Данных в файле не обнаружено....
{ "content_hash": "4af07011be30c73981819bb34adf7c4c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 92, "avg_line_length": 31.672131147540984, "alnum_prop": 0.6211180124223602, "repo_name": "martysyuk/PY-3-Learning", "id": "10fdc42dc16f5c8872e43dcdf45481f59ef1715f", "size...
from libs import parser, printerFeatures def getParseDict(): parseDict = {} parseDict['sizesCmb'] = '<optgroup label="Outline Sizes">' parseDict['sizesCmb'] += parser.getCmbFromList(printerFeatures.sizesOutline) parseDict['sizesCmb'] += '</optgroup>' parseDict['sizesCmb'] += '<optgroup label="Bi...
{ "content_hash": "162e8964d9f08cf6e681220436de79a7", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 82, "avg_line_length": 37.41379310344828, "alnum_prop": 0.7142857142857143, "repo_name": "chaosdorf/labello", "id": "54c54f278771e20d99a29e262479374ff576e8fd", "size": "108...
"""Support for deCONZ siren.""" from pydeconz.light import Siren from homeassistant.components.siren import ( ATTR_DURATION, DOMAIN, SUPPORT_DURATION, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SirenEntity, ) from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_di...
{ "content_hash": "03526ddad39bb12d2120510b2b58a444", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 69, "avg_line_length": 26.49367088607595, "alnum_prop": 0.6067845198279981, "repo_name": "lukas-hetzenecker/home-assistant", "id": "c3679b6ad892d5a666d06806a4c944fb1d74fcaf",...
import codecs import os import re import sys import setuptools import setuptools.command.test try: from platform import python_implementation as _pyimp except (AttributeError, ImportError): def _pyimp(): return 'Python (unknown)' NAME = 'celery' # -*- Python Versions -*- E_UNSUPPORTED_PYTHON = """ --...
{ "content_hash": "42b8b00d35f099ad693bfb930781ed71", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 74, "avg_line_length": 25.303964757709252, "alnum_prop": 0.5840877437325905, "repo_name": "cloudera/hue", "id": "e1da0647efd37b28ba1c77cfb2618a834fd606e8", "size": "5790",...
from contracts import ContractNotRespected from synthetic import DuplicateMemberNameError, InvalidPropertyOverrideError, \ NamingConventionCamelCase, NamingConventionUnderscore, \ synthesizeProperty, synthesize_member, \ synthesizeProperty, synthesize_property, \ namingConvention, naming_convention impo...
{ "content_hash": "36d17fbee212c1144b6d5bc5f668e278", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 114, "avg_line_length": 37.174193548387095, "alnum_prop": 0.7025338424158278, "repo_name": "yjaaidi/pysynthetic", "id": "095fd671644e171d3cfa226a0cb3d3ff9798e5be", "size":...
from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.urls import include, re_path from django.views.i18n import JavaScriptCatalog from django.views.static import serve from cms.test_utils.project.placeholderapp.views import detail_view from cms.u...
{ "content_hash": "3e5588d43da7f8ce8be0b878be1c827c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 37.84615384615385, "alnum_prop": 0.6727642276422764, "repo_name": "datakortet/django-cms", "id": "331bc4b0017cea9c1e1c2183f99a57172f7b849d", "size": ...
from ghostlines.storage.app_storage import AppStorage from ghostlines.windows.sign_in_window import SignInWindow from ghostlines.windows.deferred_window import DeferredWindow class Authentication(object): @staticmethod def require(cls): class AuthenticatedWindow(object): def __init__(se...
{ "content_hash": "33815c777ab4b723801c8f90f8f5098c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 34.96, "alnum_prop": 0.6086956521739131, "repo_name": "ghostlines/ghostlines-robofont", "id": "62c343b8ea5298d838e9234aeee4038034dd68f0", "size": "87...
from __future__ import unicode_literals import django.contrib.auth.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0008_alter_user_username_max_length'), ('accounts', '0002_add_extra_user_info'), ] operations = [ migratio...
{ "content_hash": "2f1225950e491b79fe64426ea601c3e2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 25.333333333333332, "alnum_prop": 0.49736842105263157, "repo_name": "Dybov/real_estate_agency", "id": "c40698e6f7c270849fe50c608e3489161a8f21de", "si...
""" --- Day 25: The Halting Problem --- Following the twisty passageways deeper and deeper into the CPU, you finally reach the core of the computer. Here, in the expansive central chamber, you find a grand apparatus that fills the entire room, suspended nanometers above your head. You had always imagined CPUs to be ...
{ "content_hash": "04dfca44e008c727e6c127129d3ebd70", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 384, "avg_line_length": 41.272222222222226, "alnum_prop": 0.6467896082918293, "repo_name": "bbglab/adventofcode", "id": "f08f713013236bd405840a1a1593853087904114", "size":...
DEPS = [ 'depot_tools/bot_update', 'chromium', 'chromium_tests', 'depot_tools/gclient', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/step', 'depot_tools/tryserver', ]
{ "content_hash": "e8f9fffb5d4b51c9a3be4391ed062ade", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 29, "avg_line_length": 20.636363636363637, "alnum_prop": 0.6607929515418502, "repo_name": "eunchong/build", "id": "15b2b35fb91ba103dc02a8c1602f0a0b3c78449b", "size": "390",...
from bolt.local.construct import ConstructLocal from bolt.spark.construct import ConstructSpark constructors = [ ('local', ConstructLocal), ('spark', ConstructSpark) ] def wrapped(f): """ Decorator to append routed docstrings """ import inspect def extract(func): append = "" ...
{ "content_hash": "bd8bd9c20325961a13e121c9f4b22bdf", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 86, "avg_line_length": 28.253012048192772, "alnum_prop": 0.5654584221748401, "repo_name": "jwittenbach/bolt", "id": "e8e781bcf642ebfc59be650dcbd56a9c162efc30", "size": "234...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import pdb import traceback class TxnMallTest(BitcoinTestFramework): def add_options(self, parser): parser.add_option("--mineblock", dest="mine_block", default=False, action="store_true", ...
{ "content_hash": "8f3a454fe2a02a44665511f917e92898", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 115, "avg_line_length": 48.74096385542169, "alnum_prop": 0.5863304906686442, "repo_name": "Bitcoin-com/BUcash", "id": "e4e941fd3b1566a8442354d0d2d1a8fbf6e8d424", "size": "...
from __future__ import unicode_literals import gettext import os from datetime import datetime, timedelta from importlib import import_module from unittest import TestCase, skipIf from django import forms from django.conf import settings from django.contrib import admin from django.contrib.admin import widgets from d...
{ "content_hash": "1b26b39b793b41fb4eded0f34ddfc8fd", "timestamp": "", "source": "github", "line_count": 1246, "max_line_length": 406, "avg_line_length": 46.03531300160514, "alnum_prop": 0.6249651324965132, "repo_name": "beni55/django", "id": "d32411ef674484810484cd51cd53eed3f662e3a3", "size": "5740...
"""This module contains the ChosenInlineResultHandler class.""" from .handler import Handler from telegram import Update from telegram.utils.deprecate import deprecate class ChosenInlineResultHandler(Handler): """Handler class to handle Telegram updates that contain a chosen inline result. Attribu...
{ "content_hash": "186bf1ff26bbcdf5e7b94a5174062e4b", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 99, "avg_line_length": 48.724137931034484, "alnum_prop": 0.6272705826845955, "repo_name": "rogerscristo/BotFWD", "id": "81f1bb4c392c8e7c2395b186f96c28cbed9ad484", "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 = "MovingMedian", cycle_length = 5, transform = "BoxCox", sigma = 0.0, exog_count = 0, ar_order = 0);
{ "content_hash": "4ef78bfc4c6285a0e7e45b42eb986661", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 162, "avg_line_length": 37.42857142857143, "alnum_prop": 0.7022900763358778, "repo_name": "antoinecarme/pyaf", "id": "d44644cd0038a88833afb71424c3a5ec554c738a", "size": "262...
from setuptools import setup, find_packages setup( name='django-file-picker', version='0.6.0', author='Caktus Consulting Group', author_email='solutions@caktusgroup.com', packages=find_packages(exclude=['sample_project']), include_package_data=True, #url='https://github.com/caktus/django-fi...
{ "content_hash": "b145a53589e686ecede909d939c6646e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 71, "avg_line_length": 36.888888888888886, "alnum_prop": 0.6485943775100401, "repo_name": "Capstrat/django-file-picker", "id": "78ec0c31576cbca34dfad56737a8bd9e77543664", "...
"""fabric commands for building sphinx docs note 1): tested with Fabric 0.9.0 full command: $ fab deploy """ import os from fabric.api import * cur_dir = os.path.dirname(os.path.abspath(__file__)) def sphinxbuild(): local('sphinx-build -b html %s %s/html' % \ (os.path.join(cur_dir, 'source'), ...
{ "content_hash": "8ecc822248e755ebd731a7942239f6b3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 19.636363636363637, "alnum_prop": 0.5895061728395061, "repo_name": "jsmits/github-cli", "id": "ce5656a7388911269b21fde10b26320ae1f1ff1b", "size": "64...
from aiohttp.web import Request as Req, Response as Res class Request(Req): """ Wraps the aiohttp request object to hide it from user """ pass class Response(Res): """ Wraps the aiohttp response object to hide it from user """ pass
{ "content_hash": "d823de597c05cc749a32188ecd468b91", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 58, "avg_line_length": 17.866666666666667, "alnum_prop": 0.6455223880597015, "repo_name": "bitsabhi/vyked", "id": "2c945fa300be5f6473aa63a2df1416cc87dc9dd3", "size": "268",...
import sys import os # print(sys.copyright) # sys.path被执行文件的当前路径 + 其他python自定的路径 print(sys.path) # python path/filename 执行时后面带的被执行文件名包括路径:path/filename print(__file__) # python path/filename 执行时所在的目录,及pwd值 print(os.getcwd())
{ "content_hash": "c49a8b3f1c2ae2d5fbf87c446186c570", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7857142857142857, "repo_name": "dianshen/python_day", "id": "1d42367ff84262a3509532089688b0433a4b464a", "size": "31...
import os.path # Django madness from django.db import transaction from django import forms from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExis...
{ "content_hash": "8a11a4b2f20e098a1c0cba0d4b8e7960", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 111, "avg_line_length": 37.97597597597598, "alnum_prop": 0.6564921714376087, "repo_name": "misaelnieto/lfs_downloads", "id": "f6ef789b46f58792ed2a8c8bfc29b100549cc934", "s...
import sys from os.path import abspath, dirname, join sys.path.insert(0, join(dirname(dirname(dirname(abspath(__file__)))),'py-bindings') ) from functools import partial from os.path import dirname from time import clock from math import fabs import unittest import copy import ompl.util as ou import ompl.base as ob imp...
{ "content_hash": "9eba73994ad27f99b20a9f329a6e9628", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 95, "avg_line_length": 33.27322404371585, "alnum_prop": 0.6034652652323863, "repo_name": "jvgomez/ompl", "id": "0e951ab5cc5e2e950cf94d49aa95f7519e154785", "size": "13991",...
from datetime import date, timedelta from model_bakery import baker from django.conf import settings from django.test import TestCase from ..models import Sponsorship, SponsorBenefit, LogoPlacement, TieredQuantity, RequiredTextAsset, RequiredImgAsset, \ BenefitFeature, SponsorshipPackage, SponsorshipBenefit from ...
{ "content_hash": "51840cc4a7a02ea379e7a85e2221a8f7", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 119, "avg_line_length": 40.31210191082803, "alnum_prop": 0.6713540843735187, "repo_name": "manhhomienbienthuy/pythondotorg", "id": "d1f46555d32aa679f58c74f3334034a4138a2c31"...
""" This is a template for creating custom ColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations """ import json from typing import Optional import blockcyph...
{ "content_hash": "9c25c4b6a9dbc72bee814b31e05800f0", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 136, "avg_line_length": 39.39506172839506, "alnum_prop": 0.6313068003760577, "repo_name": "great-expectations/great_expectations", "id": "6070ee72218183eca49d140d88cd6aff554...
from jumpgate.common import error_handling class ExtraSpecsFlavorV2(object): def __init__(self, app, flavors): self.app = app self.flavors = flavors def on_get(self, req, resp, tenant_id, flavor_id): '''Returns the extra specs for a particular flavor ''' for flavor in...
{ "content_hash": "8809d8643e43fabe3a16a257a00d7a57", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 34.5625, "alnum_prop": 0.488245931283906, "repo_name": "softlayer/jumpgate", "id": "4cb2660d5e4d86aed85a97837ca0ccd637b3408c", "size": "1659", "bin...
from salesking import api from salesking.tests.base import SalesKingBaseTestCase class SKApiTestCase(SalesKingBaseTestCase): # def test_access_token_fail(self): # clnt = api.APIClient() # token = clnt.request_access_token("dummy") # msg ="response:%s" % token # self...
{ "content_hash": "0417ee94258395347cc6409d197ca582", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 61, "avg_line_length": 34.9, "alnum_prop": 0.6217765042979942, "repo_name": "salesking/salesking_python_sdk", "id": "c05475caca71bcf1c4b0bdeea5cf346997c1c310", "size": "746...
"""Unit tests for oseoserver.utilities""" import pytest import mock from mock import DEFAULT from oseoserver import errors from oseoserver.models import Order from oseoserver import utilities pytestmark = pytest.mark.unit def test_get_generic_order_config_incorrect_order_type(): order_type = "fake" with py...
{ "content_hash": "9a7e9ca4a4f10329b3be9302e432037f", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 79, "avg_line_length": 40.96268656716418, "alnum_prop": 0.6675168518855894, "repo_name": "pyoseo/django-oseoserver", "id": "e9323cf83859895afe5b46366be2ad83a57ab591", "siz...
class Proxy(object): def __init__(self): self.content = None def __str__(self): return "tip to you: %s", self.content class ChildProxy(Proxy): def __init__(self): Proxy.__init__(self) self.content = "resource show for child or adult" class AdultProxy(Proxy): def __in...
{ "content_hash": "c4361707220a7e8d322f4be3d469bfaa", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 57, "avg_line_length": 23.894736842105264, "alnum_prop": 0.5627753303964758, "repo_name": "BEUTIFULSKIN/python-design", "id": "9f705eb0379adb4aec7065f2f9387b79f38bdaf9", "s...
import jinja2 import os import webapp2 jinja_environment = jinja2.Environment(loader= jinja2.FileSystemLoader(os.path.dirname(__file__))) class MainHandler(webapp2.RequestHandler): def get(self): template = jinja_environment.get_template('templates/input_order.html') self.response.write(tem...
{ "content_hash": "3aaaa870b7c9aa9d2d0be1c1456e6df1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 29.655172413793103, "alnum_prop": 0.6593023255813953, "repo_name": "luisibanez/cssi-appengine-templates-01", "id": "656351fc23b158b3d2dec708de6191041c1...
""" Celery queued tasks for Helios 2010-08-01 ben@adida.net """ from celery.decorators import task from models import * from view_utils import render_template_raw import signals import copy from django.conf import settings @task() def cast_vote_verify_and_store(cast_vote_id, status_update_message=None, **kwargs):...
{ "content_hash": "d0eb284c719a491a7033de0c1382723b", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 111, "avg_line_length": 31.240875912408757, "alnum_prop": 0.6619158878504673, "repo_name": "pirati-cz/helios-server", "id": "5f7bba8730120e732a48f7467314e05dcfd7b639", "si...
from jira import JIRA import sys import argparse import common class JIRAOperator(object): def __init__(self, server, username, password): # Initial jira # set verify as false to get rid of requests.exceptions.SSLError: [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:...
{ "content_hash": "63cdb8c3db5eaae56502133f7dcd6989", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 177, "avg_line_length": 38.75, "alnum_prop": 0.5987096774193549, "repo_name": "srinia6/on-build-config", "id": "8a7f2febbc24d15d5849d5875aa96c9bf92baf01", "size": "2379", ...
import unittest import arbor as A from .. import fixtures """ tests for cable probe wrappers """ # Test recipe cc comprises one simple cable cell and mechanisms on it # sufficient to test cable cell probe wrappers wrap correctly. class cc_recipe(A.recipe): def __init__(self): A.recipe.__init__(self) ...
{ "content_hash": "f24fb2215bc072870beb1e77ccda6c02", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 110, "avg_line_length": 35.214723926380366, "alnum_prop": 0.5576655052264808, "repo_name": "halfflat/nestmc-proto", "id": "c9f0d15a197e53e70db74f2c210b8ae54c370066", "size...
"""Tests for tensorflow.ops.nn_ops.Pad.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors ...
{ "content_hash": "aed7ef349714db7e007a2b6547d8aa22", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 80, "avg_line_length": 40.64141414141414, "alnum_prop": 0.5300733192494097, "repo_name": "aldian/tensorflow", "id": "30abf9a758cfe7f9929aba7a139c618e6c547ea3", "size": "16...
import time import unittest import node COMMISSIONER = 1 JOINER_ROUTER = 2 JOINER = 3 class Cert_8_2_02_JoinerRouter(unittest.TestCase): def setUp(self): self.nodes = {} for i in range(1,4): self.nodes[i] = node.Node(i) self.nodes[COMMISSIONER].set_panid(0xface) self....
{ "content_hash": "142250ba377493008f614156c32ae68c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 115, "avg_line_length": 38.791666666666664, "alnum_prop": 0.6727533118510562, "repo_name": "aeliot/openthread", "id": "2a00c5db4fd93224fb591b74a1e5518e3c4ff39b", "size": "4...
from bottle import Bottle, request, response, abort import json import logging import os from audit import init_audit from controller import Controller from utils import Encoder log = logging.getLogger("sphere11.api") logging.basicConfig(level=logging.INFO) config = json.load(open(os.environ.get('SPHERE11_CONFIG', '...
{ "content_hash": "c79208f8f426a27ce6075ddbce6d2863", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 76, "avg_line_length": 29.029411764705884, "alnum_prop": 0.674096588990206, "repo_name": "alfredgamulo/cloud-custodian", "id": "215b7c838c56cbdfa76e8160b05bdff38cd4f402", ...
from pyramid.view import view_config, view_defaults from .models.folder import RootFolder, Folder @view_defaults(renderer='json') class MySite: def __init__(self, context, request): self.context = context self.request = request @view_config(context=RootFolder) def root_view(self): ...
{ "content_hash": "63b66ba714a868ea1518fb831cfe93d8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 54, "avg_line_length": 26.88888888888889, "alnum_prop": 0.6818181818181818, "repo_name": "pauleveritt/pyramid_sqltraversal", "id": "7b8c342dc724a1784503de07052858e3e69f97e5",...
import logging import json from threading import Event, Thread from time import sleep import pika from pika.exceptions import AMQPError, ConnectionClosed class StopThread(Exception): pass class QueueConsumerAsync(object): """This is an example consumer that will handle unexpected interactions with Rabbi...
{ "content_hash": "e07436ea3eb08a58fe582869d961567a", "timestamp": "", "source": "github", "line_count": 505, "max_line_length": 117, "avg_line_length": 40.27920792079208, "alnum_prop": 0.6235190010323977, "repo_name": "SpatialMetabolomics/SM_distributed", "id": "6a0bc49267c781aa6fee31bbfa42408b0c3dd8...
""" Virtual Machine Class """ ### INCLUDES ### import os import sys import commands import glob import filecmp from py_knife import file_system from py_knife.decorators import multiple_attempts from default_settings import LOG_TS_FORMAT, MUTLIPLE_TAPE_SYSTEM ### FUNCTIONS ### def execute_backup(settings): """...
{ "content_hash": "09da4671c106259314337f0893160901", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 117, "avg_line_length": 37.67595818815331, "alnum_prop": 0.5487838712660686, "repo_name": "Barmaley13/VMWare-Backup", "id": "329b913216c0b6698581dc8a17bbccdce5181160", "si...
import json import os import sys if sys.version_info < (3, 0): from unittest2 import TestCase else: from unittest import TestCase import requests import github3 try: from unittest import mock except ImportError: import mock from io import BytesIO from requests.structures import CaseInsensitiveDict ...
{ "content_hash": "e92bef7e5a6080144f47008945701185", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 76, "avg_line_length": 25.291338582677167, "alnum_prop": 0.5616438356164384, "repo_name": "adrianmoisey/github3.py", "id": "3525fe01529c8ed1087418abd69ae9e69be422cc", "siz...
from CIM14.CPSM.Equipment.Core.PowerSystemResource import PowerSystemResource class ConnectivityNodeContainer(PowerSystemResource): """A base class for all objects that may contain ConnectivityNodes or TopologicalNodes. """ def __init__(self, ConnectivityNodes=None, *args, **kw_args): """Initialis...
{ "content_hash": "79bdd82fbe898e50dd5f401efecd2799", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 91, "avg_line_length": 34.888888888888886, "alnum_prop": 0.6840764331210191, "repo_name": "rwl/PyCIM", "id": "04e020bf60bf2caebc279635474f00b9d0e4614e", "size": "2670", "...
import unittest import simulation def state(visitors_per_bucket, baseline_conversions, treatment_conversions): return simulation.ExperimentState( baseline_conversions, visitors_per_bucket - baseline_conversions, treatment_conversions, visitors_per_bucket - treatment_conversions, ...
{ "content_hash": "f25aadc332d233a3e764637e4706fedf", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 98, "avg_line_length": 34.88721804511278, "alnum_prop": 0.596551724137931, "repo_name": "gostevehoward/absimulation", "id": "fa8fbf759b7d512fcb1a656a8f4d7b74dc2d6c33", "si...
from __future__ import annotations ERROR_FEATURE_NOT_SUPPORTED = '0A000' ERROR_CARDINALITY_VIOLATION = '21000' # Class 22 — Data Exception ERROR_DATA_EXCEPTION = '22000' ERROR_NUMERIC_VALUE_OUT_OF_RANGE = '22003' ERROR_INVALID_DATETIME_FORMAT = '22007' ERROR_DATETIME_FIELD_OVERFLOW = '22008' ERROR_DIVISION_BY_ZERO =...
{ "content_hash": "661a999d19e4538cc2d683904d419683", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 67, "avg_line_length": 28.110091743119266, "alnum_prop": 0.7402088772845953, "repo_name": "edgedb/edgedb", "id": "c1dadd885c0a92cbbaaa83932c497bb38d6f87fa", "size": "3749"...
from __future__ import print_function import getpass import json import os import argparse import yaml from elasticsearch.client import Elasticsearch def main(): parser = argparse.ArgumentParser() parser.add_argument('--host', help='Elasticsearch host') parser.add_argument('--port', type=int, help='Elas...
{ "content_hash": "043a803a3c6b1400ae6af121a4d154f4", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 119, "avg_line_length": 44.86, "alnum_prop": 0.5889433794025858, "repo_name": "megancarney/elastalert", "id": "913c7a7b89474ab3f2716ac2918b219c395578ff", "size": "4532", ...
""" init.py Starting script to run NetPyNE-based RxD model. Usage: python init.py # Run simulation, optionally plot a raster MPI usage: mpiexec -n 4 nrniv -python -mpi init.py """ from netpyne import sim from netParams import netParams from cfg import cfg # -------------------------------- # Instantiate ne...
{ "content_hash": "307eb75eafa5154e6828738c4e30d03a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 98, "avg_line_length": 35.17857142857143, "alnum_prop": 0.6345177664974619, "repo_name": "Neurosim-lab/netpyne", "id": "ba996eddf32c143a3ac2dfc95396376b6d0947c0", "size": "...
from ._monitor import TMonitor, TqdmSynchronisationWarning from ._tqdm_pandas import tqdm_pandas from .cli import main # TODO: remove in v5.0.0 from .gui import tqdm as tqdm_gui # TODO: remove in v5.0.0 from .gui import trange as tgrange # TODO: remove in v5.0.0 from .std import ( TqdmDeprecationWarning, TqdmExp...
{ "content_hash": "56463043f079d5eb795f19d52e586f9a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 86, "avg_line_length": 39.97560975609756, "alnum_prop": 0.6741915802318487, "repo_name": "kayhayen/Nuitka", "id": "a021d16e9a54eb18384d2c678675eca917753848", "size": "1639"...
import unittest from wsd.algorithm import LinkDetector from wsd.tests.database.databasemocks import * class LinkDetectorTest(unittest.TestCase): def setUp(self): self._view = WorkViewMock() def _detect_links(self, text): links = [] article = { 'id': 1, 'title': ...
{ "content_hash": "82a52de374e1ae0ab3077eff3f44bbe3", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 136, "avg_line_length": 46.129629629629626, "alnum_prop": 0.6057808109193095, "repo_name": "plaufer/wikiwsd", "id": "4561f03f406666df6a9b5ace6fbd254241b75711", "size": "249...
import sys import atrshmlog result = atrshmlog.attach() version = atrshmlog.get_version() minorversion = atrshmlog.get_minor_version() patchversion = atrshmlog.get_patch_version() print('version : ' + str(version) + ' : ') print('version : ' + str(minorversion) + ' : ') print('version : ' + str(patchversion) + ' :...
{ "content_hash": "81bc33ad6667c37600497e35a71d8d2a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 47, "avg_line_length": 16.5, "alnum_prop": 0.6556473829201102, "repo_name": "atrsoftgmbh/atrshmlog", "id": "5f9adac5033d1e53624488ee10f44f55af63a3b6", "size": "493", "bin...
# # localDocker.py - Implements the Tango VMMS interface to run Tango jobs in # docker containers. In this context, VMs are docker containers. # import random import subprocess import re import time import logging import threading import os import sys import shutil import config from tangoObjects import ...
{ "content_hash": "e42ba039667ac5dfcfd196d713edcd18", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 88, "avg_line_length": 34.06818181818182, "alnum_prop": 0.589615299088281, "repo_name": "autolab/Tango", "id": "e2bc6e1ba2bcc7269365e3f2cf6353185b7bb009", "size": "8994", ...
"""Urls which need to be loaded at root level.""" from django.conf.urls import * adminpatterns = patterns('', (r'^admin/product/configurableproduct/(?P<id>\d+)/getoptions/', 'product.views.get_configurable_product_options', {}, 'satchmo_admin_configurableproduct'), ) adminpatterns += patterns('p...
{ "content_hash": "9d234d223e56601aabaf1f08db4936f5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 41.21739130434783, "alnum_prop": 0.6244725738396625, "repo_name": "russellmayhew/satchmo", "id": "f68082d05934768eaba017d198865e3e6f44591a", "size": ...
from google.appengine.ext import db class Post(db.Model): _use_memcache = True _use_cache = True stub = db.StringProperty(indexed=True) title = db.StringProperty(indexed=True) body = db.TextProperty() publish_date = db.DateProperty(auto_now_add=True) created = db.DateTimeProperty(auto_no...
{ "content_hash": "7e0ff435e84e732a60a2031fe5a2874f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 31.703703703703702, "alnum_prop": 0.6647196261682243, "repo_name": "iandouglas/flask-gae-skeleton", "id": "01df2d988b3a1aff384caaaebd879e04a6a1df03", ...
"""Structural variant detection with GRIDSS The Genomic Rearrangement IDentification Software Suite https://github.com/PapenfussLab/gridss """ import os import toolz as tz from bcbio import utils from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import datadict as dd from bcbio.pipeline ...
{ "content_hash": "8e4aafc3491f1ae5338b0338b7b7c041", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 115, "avg_line_length": 45.796460176991154, "alnum_prop": 0.5816425120772947, "repo_name": "vladsaveliev/bcbio-nextgen", "id": "7ae8044827985679a576bdcaf22b2ba30d5f7727", ...
"""Retrieves urls that have content keywords related to a given website. Tags: TargetingIdeaService.get """ __author__ = ('api.kwinter@gmail.com (Kevin Winter)' 'Joseph DiLallo') from googleads import adwords PAGE_SIZE = 100 def main(client): # Initialize appropriate service. targeting_idea_ser...
{ "content_hash": "dbce4c4778d01f58e2771a7a259eb092", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 77, "avg_line_length": 28.016666666666666, "alnum_prop": 0.6234384295062463, "repo_name": "jdilallo/jdilallo-test", "id": "a40aac4cddea4ebf0cab773e3d274b2bb2050380", "size"...
import logging import random from collections import namedtuple import gevent from gevent.event import AsyncResult from ethereum import slogging from raiden.tasks import ( StartMediatedTransferTask, MediateTransferTask, EndMediatedTransferTask, ExchangeTask, ) from raiden.utils import pex, sha3 log =...
{ "content_hash": "062d8ceaf067cde999483da0c9333db6", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 89, "avg_line_length": 34.91596638655462, "alnum_prop": 0.5604492579221821, "repo_name": "tomaaron/raiden", "id": "9f29dbf9ad860f06cc6e40ed2f41133872813a8e", "size": "1248...
from graphviz import Digraph import yaml def isa(o, key): return key in o and o[key] def add_node(g, name, **attrs): g.node(name, label=name, **attrs) def eprops(n): """Extract edge properties""" if isinstance(n, basestring): return n, {} if isinstance(n, dict): return n.pop('n...
{ "content_hash": "0e02db855ac8039cd6528c1a18b69bce", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 62, "avg_line_length": 26.431372549019606, "alnum_prop": 0.5148367952522255, "repo_name": "ninowalker/ymlgraph", "id": "f48b867c6dca9054cc4efea548d5d9b7d5ae71bb", "size": "...
import os import sys from collections import OrderedDict import yaml from packaging.specifiers import SpecifierSet, InvalidSpecifier from packaging.version import Version, InvalidVersion from hokusai import CWD from hokusai.lib.constants import YAML_HEADER from hokusai.lib.exceptions import HokusaiError from hokusa...
{ "content_hash": "0663b93681edf7403cb5bceaf8eae15d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 96, "avg_line_length": 25.666666666666668, "alnum_prop": 0.6940836940836941, "repo_name": "izakp/hokusai", "id": "93e3bf10688d6b6e75e97f6a6e5ae59516604a19", "size": "1386",...
"""Tests for the attention layer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np from tensorflow.python import keras from tensorflow.python.keras import keras_parameterized from tensorflow.pyth...
{ "content_hash": "9740c401e7dd5807506b1e56d260a257", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 80, "avg_line_length": 43.56201550387597, "alnum_prop": 0.6683868671589999, "repo_name": "aam-at/tensorflow", "id": "4c957b8973bffdd20d63b25c5cf7936ff2699ad7", "size": "11...
"""Module for Slack Tests."""
{ "content_hash": "0b2b38ec31205d961b012408765623ff", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.6333333333333333, "repo_name": "jacobtomlinson/opsdroid", "id": "b44787274f440b508768ed2b68df648a0e714b5f", "size": "30", "binar...
from .sub_resource import SubResource class Subnet(SubResource): """Subnet in a virtual network resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param address_prefix: The address prefix for the subnet. ...
{ "content_hash": "08a4bc89c56747883012555ca3295eda", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 179, "avg_line_length": 47.0625, "alnum_prop": 0.6819389110225763, "repo_name": "v-iam/azure-sdk-for-python", "id": "2aa53c9eae2baf04b76e201dbab2995db9c3f4b8", "size": "348...
"""Checks import position rule""" # pylint: disable=unused-import,relative-import,ungrouped-imports,import-error,no-name-in-module,relative-beyond-top-level,unused-variable def method1(): """Method 1""" import x
{ "content_hash": "a506d660a5885ccf7001d833c6515f18", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 138, "avg_line_length": 44, "alnum_prop": 0.7454545454545455, "repo_name": "arju88nair/projectCulminate", "id": "3f1174f9dc2e661e287694fef80de49d49e7c62a", "size": "220", ...
from application import server server.debug = True server.run(host='0.0.0.0', port=5000)
{ "content_hash": "e006e53cb884eacb34bcf44a2e62022d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 37, "avg_line_length": 22.25, "alnum_prop": 0.7528089887640449, "repo_name": "Markcial/alembic", "id": "ce2ee3336d0d9d221edc27091cabe339c043da92", "size": "89", "binary": ...
"""So that we can modularize our application, we will use this as our our master file for application endpoints""" from .modules.todo import views
{ "content_hash": "3ff93c1fd694de71fa53135a7f2742e0", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 69, "avg_line_length": 49, "alnum_prop": 0.782312925170068, "repo_name": "configuresystems/restful-api-with-flask", "id": "87d4f9c826f08464fc765d8905f55854046c868e", "size":...
import time import clodius.fast import numpy as np import pyximport pyximport.install(setup_args={"include_dirs": np.get_include()}) x = np.array(range(2 ** 16)) t1 = time.time() t2 = time.time() print(clodius.fast.aggregate(x, 8)) print("t2:", t2 - t1)
{ "content_hash": "57e2acdb5a6e4fccc97d8d05d7a0d94f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 19.76923076923077, "alnum_prop": 0.6964980544747081, "repo_name": "hms-dbmi/clodius", "id": "3469199947ffbe66153e683b2ab10b31a1fde781", "size": "257"...
""" A connection to the VMware vCenter platform. """ import re from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import versionutils as v_utils from oslo_vmware import api from oslo_vmware import exceptions as vexc from oslo_vmware import pbm from oslo_vmware import vim from oslo_vmw...
{ "content_hash": "bdeaa10b3b6b9a6399c6d067839fd19d", "timestamp": "", "source": "github", "line_count": 528, "max_line_length": 79, "avg_line_length": 42.02651515151515, "alnum_prop": 0.5918431726002704, "repo_name": "hanlind/nova", "id": "4ddcbc3d2738f35945c28f9e9c7e3a964cffb229", "size": "22942",...
"""This module contains the user-facing API for AutoGraph.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from enum import Enum from tensorflow.python.autograph.core import config from tensorflow.python.autograph.core import converter ...
{ "content_hash": "83e282ef0591f617089bb567557c0dd7", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 80, "avg_line_length": 35.20738636363637, "alnum_prop": 0.6826434277414669, "repo_name": "girving/tensorflow", "id": "b3f056965c6c225426323bda7c9f918e180acfcd", "size": "1...
import json,os,twitter, dropbox, gzip from datetime import datetime from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener from pprint import pprint from optparse import OptionParser from progress.bar import Bar """ Example call: python twitter_fetch.py ...
{ "content_hash": "8b691e79ce0d50f5adee1d09f7750659", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 129, "avg_line_length": 36.7, "alnum_prop": 0.6546321525885559, "repo_name": "nik7273/computational-medical-knowledge", "id": "418776bef03460f134c698e48be068afb0813e9e", "...
from cherrypy.test import test test.prefer_parent_path() def setup_server(): import os curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) import cherrypy def test_app(environ, start_response): status = '200 OK' response_headers = [('Content-type', 'text/plain')] ...
{ "content_hash": "9dab3ae0e431f8cc98a53924c17fac3c", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 68, "avg_line_length": 30.278688524590162, "alnum_prop": 0.5644288034650785, "repo_name": "VHAINNOVATIONS/DmD", "id": "66baed412ac44fbf65b3fd2306d3fddd31dc53be", "size": "...
from cms.sitemaps import CMSSitemap from django.conf import settings from django.conf.urls.i18n import i18n_patterns from django.conf.urls.static import static from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.urls import include, path admin.autodiscover() urlpatterns = [ ...
{ "content_hash": "167816d773e44e0aed5732333a214110", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 92, "avg_line_length": 34.23809523809524, "alnum_prop": 0.7649513212795549, "repo_name": "nephila/djangocms-installer", "id": "8d6432e68aade6867d5016a631a9ea9183768e5e", "s...
from typing import Typing from errors import AbstractClassError from errors import NominalTypeInitError class PydytyType(object): """ Abstract type to represent a type. """ def __init__(self, loc=None, **kwargs): self.loc = loc def __str__(self): raise AbstractClassError() def __eq_...
{ "content_hash": "9e6eb733b2bd6d1c8b504090b119075d", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 78, "avg_line_length": 34.561338289962826, "alnum_prop": 0.5645907281918898, "repo_name": "davidan42/pydyty", "id": "90bebb0f3e7a8ff9085b01e5b59c7b9c27b6c49d", "size": "93...
""" ==================================================================== Extract epochs for multiple conditions, save evoked response to disk ==================================================================== This script shows how to read the epochs for multiple conditions from a raw file given a list of events. The...
{ "content_hash": "025320ba7d5259f41cc84e99ad4c0020", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 35.90277777777778, "alnum_prop": 0.6135396518375241, "repo_name": "agramfort/mne-python", "id": "4102390320d70bdddda487a43f021ec74389e950", "size": "...
from __future__ import unicode_literals from django.db import models from django.db.migrations.operations.base import Operation from django.db.migrations.state import ModelState from django.db.models.options import normalize_together from django.utils import six from django.utils.functional import cached_property fro...
{ "content_hash": "dda951083ef39517246f77fb5318422d", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 119, "avg_line_length": 39.118598382749326, "alnum_prop": 0.5672155998070695, "repo_name": "hosseinmh/Django_learning", "id": "061d6927736fe65b624a03471372c8f22a1ce359", "...
from datetime import datetime, time from lxml import etree import xmltodict class ResourceElement(object): """ The Resource Element of a Control (fr-form-resources) """ def __init__(self, control): self.control = control def __getattr__(self, name): if self.control._resource and...
{ "content_hash": "75f5c7508c3df494b318d3e4d99f9c5b", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 94, "avg_line_length": 29.476404494382024, "alnum_prop": 0.5959441945566821, "repo_name": "bobslee/orbeon-xml-api", "id": "befce1611866875c0c4018768064228eb31a1b72", "size...
""" Copyright (c) 2015 RasDom by Aeondave See the file 'LICENSE' for copying permission """ import SocketServer, time from lib import settings ACK = "\x06" SIZE = 1024 class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): def handle(self): print "Client connected with ", self.client...
{ "content_hash": "f94d649cd383f6355d5f8cfeaa60498b", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 126, "avg_line_length": 42.78294573643411, "alnum_prop": 0.4660264540677659, "repo_name": "AeonDave/RasDom", "id": "ed3bc9c29821faa4133b7a26e79eb78cb961c60a", "size": "554...
from __future__ import annotations import bz2 from functools import wraps import gzip import io import socket import tarfile from typing import ( TYPE_CHECKING, Any, Callable, ) import zipfile from pandas._typing import ( FilePath, ReadPickleBuffer, ) from pandas.compat import get_lzma_file from p...
{ "content_hash": "919d1a3ae86dcce8297b350825514f43", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 88, "avg_line_length": 28.427586206896553, "alnum_prop": 0.6050460941290635, "repo_name": "pandas-dev/pandas", "id": "527e8c1d0d0908d708f37c09186ef0dc2ad6926a", "size": "1...
from PySide import QtCore, QtGui class Ui_create_asset(object): def setupUi(self, create_asset): create_asset.setObjectName("create_asset") create_asset.setWindowModality(QtCore.Qt.ApplicationModal) create_asset.resize(326, 115) self.verticalLayout = QtGui.QVBoxLayout(create_asset) ...
{ "content_hash": "7329ecababa69b557f0902f6d86af256", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 135, "avg_line_length": 57.72727272727273, "alnum_prop": 0.7188976377952756, "repo_name": "jonntd/oyprojectmanager", "id": "143cac017ce31c9ba93ae28aba36c3e51c051cc9", "size...
import os; import sys; import traceback; ##################################################################### ## Create MQ QCF at cluster level ##################################################################### def createConnectionFactories(clusterName, connectionFactoryName, jndiName, queueMgrName, transportType...
{ "content_hash": "115c11eb3b90699be3964552dd50753e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 157, "avg_line_length": 45.05263157894737, "alnum_prop": 0.594626168224299, "repo_name": "muthu-s/chef-repo", "id": "796a8b0bd5da1d4fbc065fca22c6c555b0fd9c32", "size": "171...
from collections import defaultdict from nose.tools import eq_, ok_ from ycmd.completers import completer_utils as cu def FiletypeTriggerDictFromSpec_Works_test(): eq_( defaultdict( set, { 'foo': set( [ cu._PrepareTrigger( 'zoo'), cu._PrepareTrigger( 'bar' ) ] ), 'goo': set(...
{ "content_hash": "9d119e96299ee55810942398002f157e", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 80, "avg_line_length": 35.704918032786885, "alnum_prop": 0.568870523415978, "repo_name": "korbenzhang/vim-ycm-win", "id": "82ff5828d4f71075b64c02c97929fd9a77ef051e", "size...
import sys, os, time # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute. sys.path.insert(0, os.path.abspath('..')) sys.path.append(os.path.abspath('.'...
{ "content_hash": "d5daaaec9615116a929b6bda702282b0", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 96, "avg_line_length": 32.07909604519774, "alnum_prop": 0.700951039098274, "repo_name": "cardmagic/PyAMF", "id": "31278d69f13a591741ee2c562277a1d4cc160719", "size": "6100"...
from django.db import models import base64 class Session(models.Model): session = models.CharField(max_length=200,db_index=True) date = models.DateTimeField(auto_now_add=True, db_index=True) doc_url = models.CharField(max_length=1024) browser = models.CharField(max_length=1024) def count_events(s...
{ "content_hash": "05f9d6529bbde1e874ef9f7229d35837", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 98, "avg_line_length": 35.464285714285715, "alnum_prop": 0.7139979859013091, "repo_name": "INRIA/intertrace", "id": "a36cf96512876e01477fdb7fdef6dfdf648638ce", "size": "993...
from setuptools import setup setup( name = 'keywrapper', version = '0.1.0', description = 'Extremely simple key-value storage wrapper', url = 'https://github.com/lbosque/keywrapper', author = 'Luis Bosque', author_email = 'luisico@gmai.com', license = 'BSD-3', packages =...
{ "content_hash": "bcca22a65743509b5c213d1fd0717a62", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 65, "avg_line_length": 28.357142857142858, "alnum_prop": 0.5969773299748111, "repo_name": "luisbosque/keywrapper", "id": "e1b6c9adbe1a4552584d7bad498a14e5437328f2", "size":...
import re import sys import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def create_addresses(from_addr,to_addr,cc=[],bcc=[]): msg = MIMEMultipart() msg['From'] = from_addr msg['To'] = to_addr if cc: msg['CC'] = cc if bcc: msg['BCC'] = ...
{ "content_hash": "0ca755018b5433179ddbd9b67bc32d03", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 61, "avg_line_length": 21.375, "alnum_prop": 0.5931495405179615, "repo_name": "slamice/emailout", "id": "807847fe40b299a78e85ab332e8a96b119f4138a", "size": "1219", "binar...
from __future__ import unicode_literals from django.db.models.signals import post_save, pre_save from django.test import TestCase from .models import Account, Employee, Person, Profile, ProxyEmployee class UpdateOnlyFieldsTests(TestCase): def test_update_fields_basic(self): s = Person.objects....
{ "content_hash": "c8e5f4f0a503d5940472c6054af4ad05", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 93, "avg_line_length": 38.04924242424242, "alnum_prop": 0.594126431060229, "repo_name": "yephper/django", "id": "2afaa8c1271151c951dc125c46ca3ab45cfd8d83", "size": "10045"...
from db.SqlHelper import SqlHelper from util.exception import Con_DB_Fail try: sqlhelper = SqlHelper() sqlhelper.init_db() except Exception: raise Con_DB_Fail proxy = {'ip': '192.168.1.1', 'port': int('80'), 'type': 0, 'protocol': 0, 'country': u'中国', 'area': u'四川', 'speed': 0} sqlhelper.insert(proxy)
{ "content_hash": "9c4463962414a81174ea238dae6e894a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 119, "avg_line_length": 28.727272727272727, "alnum_prop": 0.6582278481012658, "repo_name": "KFPA/ScrapyNews", "id": "4b5285d2667b0b49e7fcbea3abeba421f6795d38", "size": "339...
__author__ = 'main' from sqlalchemy import create_engine, Column, Integer, String, Enum, ForeignKey from sqlalchemy.orm import scoped_session, sessionmaker, backref, relationship from sqlalchemy.ext.declarative import declarative_base from server.config import svrcfg engine = create_engine(svrcfg['SQLALCHEMY_DATAB...
{ "content_hash": "78b1e1ffe0c628c184cd9866987b555f", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 134, "avg_line_length": 28.392857142857142, "alnum_prop": 0.6054507337526206, "repo_name": "x1angli/DDNS-chiasma", "id": "fdca4b857a93e6cd0855cd3833c67f3a1994fad4", "size":...
def gendata(apikey, nthreads): import sys import concurrent.futures import salt.client import salt.runner import collections import warnings import json import requests from datetime import datetime warnings.simplefilter("ignore", DeprecationWarning) result = {} toreturn ...
{ "content_hash": "aa3d1d62982a374282743b0dda5295c3", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 105, "avg_line_length": 41.048780487804876, "alnum_prop": 0.6702317290552585, "repo_name": "webedia-dev/pepperboard", "id": "ce2cc159db7db622424f86bb325f4b95773f5763", "siz...
from django.conf.urls.defaults import * urlpatterns = patterns('', url(r'new/(?P<item_id>[\d]+)/$', 'reviewclone.views.create_review', name='create_review'), url(r'relations/$', 'reviewclone.views.relations_list', name='relations'), url(r'relations/new/$', 'reviewclone.views.create_relati...
{ "content_hash": "99eaaf4ee2cbddcb684e3b8c9fa175c2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 47.80952380952381, "alnum_prop": 0.6264940239043825, "repo_name": "brianmacdonald/djangodash10", "id": "68e87641cba90b8cedb618066c4aa8e66c410609", "s...
from .volttronwebrpc import VolttronWebRPC
{ "content_hash": "beb9f5225201b3f469b6131708644e73", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.8837209302325582, "repo_name": "schandrika/volttron", "id": "df47d694ea7a24a2c3c5554c945fbfd7d950bdf9", "size": "2946", "binary"...
from time import time, sleep from .processador import Processador class Escalonador_Fifo(object): """ Define uma classe que representa um escalonador fifo. """ def __init__(self, processador): self.processador = processador self.processos = [] def escalo...
{ "content_hash": "58fd3c064308119815da84671a255f48", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 79, "avg_line_length": 35.895161290322584, "alnum_prop": 0.5625702089418109, "repo_name": "DouglasHSS/operating_system", "id": "2dd3c1b24acff42f78c29860c980cd9b1da29e8d", ...
import numpy as np import unittest import chainer from chainer.datasets import TupleDataset from chainer.iterators import SerialIterator from chainer import testing from chainercv.extensions import DetectionVOCEvaluator from chainercv.utils import generate_random_bbox from chainercv.utils.testing import attr from c...
{ "content_hash": "255ff34c24bc88837125c048a9438fe8", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 79, "avg_line_length": 35.30625, "alnum_prop": 0.6149761019649496, "repo_name": "yuyu2172/chainercv", "id": "acc1bb0c546b97d811e0ec4cc9a3eb2665e46b52", "size": "5649", "...
import sys import json print json.dumps(json.load(sys.stdin, encoding='utf-8'), sort_keys=True, indent=2, ensure_ascii=False).encode('utf-8')
{ "content_hash": "1e9fb62338bfcf3845e7da85f71de645", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 78, "avg_line_length": 32, "alnum_prop": 0.6625, "repo_name": "nqpz/ku-intranet-studiebeskeder", "id": "26939cc89749d034a8ddec9b1382e48b3a222e76", "size": "183", "binary":...
"""Generic Z-Wave Entity Classes.""" import copy import logging from openzwavemqtt.const import ( EVENT_INSTANCE_STATUS_CHANGED, EVENT_VALUE_CHANGED, OZW_READY_STATES, CommandClass, ValueIndex, ) from openzwavemqtt.models.node import OZWNode from openzwavemqtt.models.value import OZWValue from ho...
{ "content_hash": "7189c0e33210a9c51a79c0c38cafb415", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 91, "avg_line_length": 35.00330033003301, "alnum_prop": 0.6183292475957005, "repo_name": "lukas-hetzenecker/home-assistant", "id": "d5cafa615df82aa3b86c8af650d48408201b252f"...
"""search.py: Django company""" from appsearch.registry import ModelSearch, search from .models import Company __author__ = "Steven Klass" __date__ = "08/07/2019 21:59" __copyright__ = "Copyright 2011-2020 Pivotal Energy Solutions. All rights reserved." __credits__ = [ "Artem Hruzd", "Steven Klass", ] cl...
{ "content_hash": "5be2e338f98af1559f6f5e389d6b61c2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 19.677419354838708, "alnum_prop": 0.6573770491803279, "repo_name": "pivotal-energy-solutions/django-appsearch", "id": "a8d50e31b53b1ed750a536519807ed0c...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0017_userprofile_avatar'), ] operations = [ migrations.AlterField( model_name='userprofile', name='avatar', ...
{ "content_hash": "b6805b84493130250309d11459d325e4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 105, "avg_line_length": 24.166666666666668, "alnum_prop": 0.6137931034482759, "repo_name": "tfiers/arenberg-online", "id": "d8959a444b5651b2548d982ba91760ce0df9e51d", "size...
class Pessoa(): OLHOS = 2 def __init__(self, nome): print('Iniciando __init__ de Pessoa') self.nome=nome def cumprimentar(this): return 'Olá, meu nome é %s'%this.nome def __eq__(self, other): return self.nome == other.nome def __hash__(self): return hash(se...
{ "content_hash": "95b6cfddf15accb6cca3118e296eb0b3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 45, "avg_line_length": 20.87878787878788, "alnum_prop": 0.6386066763425254, "repo_name": "renzon/poo-python", "id": "c4ab4bec43cddbd0e116884954493d039bf76bf7", "size": "691...