text
stringlengths
4
1.02M
meta
dict
from setuptools import setup setup( name='libipa', version='0.0.6', author='Andrew Udvare', author_email='[email protected]', packages=['ipa'], scripts=['bin/ipa-unzip-bin', 'bin/ipa-dump-info'], url='https://github.com/Tatsh/libipa', license='LICENSE.txt', description='Library to r...
{ "content_hash": "c6ae7567928dabfd04b2b16223bd76c5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 72, "avg_line_length": 26.789473684210527, "alnum_prop": 0.6149312377210217, "repo_name": "Tatsh/libipa", "id": "58d26b88136b4d1353a37d29d4efe1664eb4183e", "size": "555", ...
from __future__ import print_function from words import * from nltk.wordnet import * from operator import itemgetter import nltk import re from string import join def build_word_associations(): cfd = nltk.ConditionalFreqDist() # get a list of all English stop words stopwords_list = nltk.corpus.stopwords....
{ "content_hash": "105550d13ff855dffdbb4cfbddda90b2", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 109, "avg_line_length": 35.62162162162162, "alnum_prop": 0.5403388973191705, "repo_name": "nltk/nltk_teach", "id": "72352ae38e5c597d4ecc6a7e92b4ef213070d79b", "size": "790...
""" Crypto Utils """ import base64 import math from Crypto.Hash import SHA256 from Crypto.Random.random import StrongRandom random = StrongRandom() def random_mpz_lt(maximum, strong_random=random): n_bits = int(math.floor(math.log(maximum, 2))) res = strong_random.getrandbits(n_bits) while res >= maximu...
{ "content_hash": "705364651f76be7e588b370f3fa319f9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 67, "avg_line_length": 21.677419354838708, "alnum_prop": 0.6770833333333334, "repo_name": "benadida/helios-server", "id": "2fcce307f37bc81f0727f851c7ecbdaa60ace05c", "size"...
import io, os.path, re, sys from setuptools import setup # environment markers require a recent setuptools and/or pip version if sys.version_info >= (3, 3) or 'bdist_wheel' in sys.argv: install_requires = [] elif sys.version_info >= (3, 0): install_requires = ['ipaddress>=1.0.7'] else: install_requires = ...
{ "content_hash": "24bbd69a49b8465dc0e4393d797904fa", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 99, "avg_line_length": 37.6, "alnum_prop": 0.6106382978723405, "repo_name": "masayuko/urilib", "id": "e695f88d1b63a5e3fa37afd4cd20d864faec0eb0", "size": "1880", "binary":...
from pmxbot import quotes def test_MongoDBQuotes(mongodb_uri): q = quotes.Quotes.from_URI(mongodb_uri) q.lib = 'test' clean = lambda: q.db.remove({'library': 'test'}) clean() try: q.quoteAdd('who would ever say such a thing') q.quoteAdd('go ahead, take my pay') q.quoteAdd("let's do the Time Warp...
{ "content_hash": "2d5cb891155158251fe6d765f90f3769", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 49, "avg_line_length": 25.875, "alnum_prop": 0.6618357487922706, "repo_name": "jamwt/diesel-pmxbot", "id": "49f2116fd7a86b79102b0b8d4b5bb19ac9b6c8a9", "size": "414", "bin...
import sys, os, re import phedexApi # setup definitions if not os.environ.get('DETOX_DB'): print '\n ERROR - DETOX environment not defined: source setup.sh\n' sys.exit(0) # make sure we start in the right directory os.chdir(os.environ.get('DETOX_BASE')) deprecated = {} siteDsets = {} siteSize2Del = {} ...
{ "content_hash": "074964b8e9c4bca1b040cd074088c551", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 101, "avg_line_length": 31.125, "alnum_prop": 0.5522088353413654, "repo_name": "sidnarayanan/IntelROCCS", "id": "a03db776ef4b0758d989b05f301b8fbd1b039974", "size": "4521",...
from flask import Flask from flask.ext import admin # Views class FirstView(admin.BaseView): @admin.expose('/') def index(self): return self.render('first.html') class SecondView(admin.BaseView): @admin.expose('/') def index(self): return self.render('second.html') # Create flask ...
{ "content_hash": "f72aa41c3d3b44651315bcefd90db85a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 114, "avg_line_length": 22.75, "alnum_prop": 0.6472527472527473, "repo_name": "sfermigier/flask-admin", "id": "84acdf79b36e8536a555b66a05d946ef5092fb2c", "size": "910", "...
import django from django import forms from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.admin.sites import AdminSite from .forms import OTPAuthenticationFormMixin def _admin_template_for_django_version(): minor_django_version = django.VERSION[:2] if minor_django_version <= ...
{ "content_hash": "e86582ca386379caefddfda6b8bb0697", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 95, "avg_line_length": 37.9875, "alnum_prop": 0.6916748930569266, "repo_name": "robintema/django-otp", "id": "d92bbb0fb50b2a4e87183a2ed54a5c669f811408", "size": "3039", "...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PublicAccount' db.create_table(u'weixin_publicaccount', ( (u'id', sel...
{ "content_hash": "db9b3c2c9aed4884bfe296623c8e5330", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 195, "avg_line_length": 69.21693121693121, "alnum_prop": 0.5863017887173215, "repo_name": "lettoosoft/lettoo-weixin-platform-back", "id": "51410f8ce85322763776297ff9bc20d00c...
""" A script that takes a .svn/pristine/ hierarchy, with its existing .svn/wc.db database, and populates the database's PRISTINE table accordingly. (Use 'svn cleanup' to remove unreferenced pristines.) Usage: %s /path/to/wc [...] """ # TODO: resolve the NotImplemented() in __main__ # TODO: increment refcount upo...
{ "content_hash": "e6527a7cc858bee967f10f54cfa453fd", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 28.06741573033708, "alnum_prop": 0.6341072858286629, "repo_name": "wbond/subversion", "id": "8857371a43db38c26f2788d3038f6eb22faac933", "size": "3307...
""" Command-line sample that creates a one-time transfer from Amazon S3 to Google Cloud Storage. """ import argparse # [START storagetransfer_transfer_from_aws] from datetime import datetime from google.cloud import storage_transfer def create_one_time_aws_transfer( project_id: str, description: str, ...
{ "content_hash": "1601ca0128a2e81735025dc316ef67d8", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 77, "avg_line_length": 29.772727272727273, "alnum_prop": 0.5868702290076336, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "cde1828461e8bf408c9ccc00039b258ef...
import os import time import subprocess from hashlib import sha1 VERTICAL, HORIZONTAL = 'v', 'h' def execute(cmd): popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = popen.communicate("") if stderr: raise Exception("error: %s" % stderr) return stdou...
{ "content_hash": "be27f321e6d2734695b1070175e1808f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 149, "avg_line_length": 35.10144927536232, "alnum_prop": 0.5412881915772089, "repo_name": "emulbreh/shrubbery", "id": "3ca459865c57800735488f8b48cd9da118b302ae", "size": "2...
import os import mock from oslo.config import cfg import neutron.common.test_lib as test_lib from neutron.plugins.bigswitch import config from neutron.tests.unit.bigswitch import fake_server RESTPROXY_PKG_PATH = 'neutron.plugins.bigswitch.plugin' L3_RESTPROXY_PKG_PATH = 'neutron.plugins.bigswitch.l3_router_plugin' ...
{ "content_hash": "72794d10dd5934dd1b1832ffb5d9202e", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 76, "avg_line_length": 43.092592592592595, "alnum_prop": 0.6716802750322304, "repo_name": "uni2u/neutron", "id": "422c5b95d46432e5642865cad12c4c8ff11f0bf4", "size": "2941",...
import sys if sys.version_info < (2, 7): raise Exception('The dark matter code needs Python 2.7 or later.') # Note that the version string must have the following format, otherwise it # will not be found by the version() function in ../setup.py # # Remember to update ../CHANGELOG.md describing what's new in each ...
{ "content_hash": "62c9acf0c85fa441f9cb04ae5588da3d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 35.1, "alnum_prop": 0.7122507122507122, "repo_name": "terrycojones/dark-matter", "id": "b1783ea61cf37b93491511730791700634993555", "size": "351", "...
"""Merge all translation sources into a single JSON file.""" import glob import json import os import re from typing import Union, List, Dict FILENAME_FORMAT = re.compile(r"strings\.(?P<suffix>\w+)\.json") def load_json(filename: str) -> Union[List, Dict]: """Load JSON data from a file and return as dict or list...
{ "content_hash": "0d7ff1b424f724d86862949cb7b8e10f", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 87, "avg_line_length": 29.338983050847457, "alnum_prop": 0.6048526863084922, "repo_name": "fbradyirl/home-assistant", "id": "7f653e3651e36ab0aea1f5869f42da339e8e632c", "si...
"""A library that provides a Python client to Slicing Dice API""" import ujson from . import exceptions from .api import SlicingDiceAPI from .url_resources import URLResources from .utils import validators class SlicingDice(SlicingDiceAPI): """A python interface to Slicing Dice API Example usage: T...
{ "content_hash": "9375b87d141d2833752eab341c08a9f5", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 79, "avg_line_length": 31.973958333333332, "alnum_prop": 0.533881739697019, "repo_name": "SlicingDice/slicingdice-python", "id": "b5792b3b8d4cac276554886647e1bfaf205ac844", ...
import os import random import shutil import stat from contextlib import contextmanager from tempfile import mkdtemp @contextmanager def temp_dir(): name = make_temp_dir() yield name shutil.rmtree(name) def make_temp_dir(): if os.path.exists('/dev/shm/'): if os.stat('/dev/shm').st_mode & stat...
{ "content_hash": "52ac7f1cb3f63594ebe86fb54805667c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 28.32, "alnum_prop": 0.5988700564971752, "repo_name": "rsalmaso/django-cms", "id": "19e679ab4fcdc9391e3e5e3f1d736fda2888d207", "size": "708", "bina...
"browser coordinates object" from pycbio.sys.immutable import Immutable # FIXME: support MAF db.chrom syntax, single base syntax, etc. class CoordsError(Exception): "Coordinate error" pass class Coords(Immutable): """Browser coordinates Fields: chrom, start, end - start/end maybe None to indi...
{ "content_hash": "59e9dbdd5bc44094a6fab06f926e2657", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 102, "avg_line_length": 34.845238095238095, "alnum_prop": 0.5596173556542535, "repo_name": "ifiddes/pycbio", "id": "e941cd20971d47d6e39decf5f851eaefcbd66e00", "size": "2963...
import base64 LRS_STATEMENT_ENDPOINT = 'http://localhost:8000/xapi/statements' ENDPOINT_AUTH_USERNAME = 'tom' ENDPOINT_AUTH_PASSWORD = '1234' AUTHORIZATION = "Basic %s" % base64.b64encode("%s:%s" % (ENDPOINT_AUTH_USERNAME, ENDPOINT_AUTH_PASSWORD)) HEADERS = { 'Authorization': AUTHORIZATION,...
{ "content_hash": "d89abce351a04321e656752c89e1d5d7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 105, "avg_line_length": 29.466666666666665, "alnum_prop": 0.6085972850678733, "repo_name": "creighton/competency-example", "id": "fa8cce8adddbb7d6bad1248a58c40c8e16811554", ...
from __future__ import unicode_literals import logging import os from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import Max from django.utils.encoding import python_2_unicode_compatible from django.utils.translation i...
{ "content_hash": "30723f8bbe0c3b56af03ee04533fe02b", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 79, "avg_line_length": 36.66134185303515, "alnum_prop": 0.5860566448801743, "repo_name": "sgallagher/reviewboard", "id": "3670b64f4ce26673c6dc5d1406fab130b7c3aece", "size"...
"""Implements iptables rules using linux utilities.""" import inspect import os from neutron.agent.linux import utils as linux_utils from neutron.common import utils from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) # NOTE(vish): Iptables supports chain names of up to 28 charact...
{ "content_hash": "b8b4d234b27802dbd49cea9769af9b1e", "timestamp": "", "source": "github", "line_count": 594, "max_line_length": 79, "avg_line_length": 36.93434343434343, "alnum_prop": 0.5387209991339623, "repo_name": "citrix-openstack-build/neutron", "id": "acb32b821914cbaad6daef8aca3cd59ff49cffad", ...
""" Spark Fun Camera Facilitates communication with the Sparkfun Camera For more details see: http://wiki.cospandesign.com/index.php?title=Wb_sf_camera """ __author__ = 'Cospan Design: [email protected]' import sys import os import time import i2c from array import array as Array from nysa.host.nysa import...
{ "content_hash": "ed11f565b162b59292d94d6ceabeaaf4", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 86, "avg_line_length": 25.635204081632654, "alnum_prop": 0.5301024977609713, "repo_name": "CospanDesign/nysa", "id": "e4e7d7144c5f592f1ce73996cc6febe63c7bc138", "size": "1...
from msrest.serialization import Model class GroupGetMemberGroupsParameters(Model): """Request parameters for GetMemberGroups API call. All required parameters must be populated in order to send to Azure. :param additional_properties: Unmatched properties from the message are deserialized this coll...
{ "content_hash": "7c38b534a9611fffa0c7871b7c6e67b8", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 101, "avg_line_length": 38.43333333333333, "alnum_prop": 0.6903729401561145, "repo_name": "Azure/azure-sdk-for-python", "id": "2ff9062d6d94e77eb0bac68efb148025a9f0c618", "s...
import os import sys from distutils.util import strtobool import tempfile from subprocess import call def editor(text): EDITOR = os.environ.get('EDITOR','vi') with tempfile.NamedTemporaryFile(suffix=".tmp", delete=False) as tmpf: tmpf.write(text) tmpf.flush() call([EDITOR, tmpf.name]) ...
{ "content_hash": "cf37018a7dcd3c173ae98d3fd2f531be", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 26.458333333333332, "alnum_prop": 0.6330708661417322, "repo_name": "vvgelder/turret", "id": "9c3a9998c9432db700c27c0fc8a1e2ef43991b4d", "size": "635"...
""" :class:`.Baidu` is the Baidu Maps geocoder. """ from geopy.compat import urlencode from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT from geopy.exc import ( GeocoderQueryError, GeocoderQuotaExceeded, GeocoderAuthenticationFailure, ) from geopy.location import Location from geopy.util import lo...
{ "content_hash": "f20bbb1d2ca28d3e3ad26f9304a195a7", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 82, "avg_line_length": 30.772093023255813, "alnum_prop": 0.5480652962515115, "repo_name": "emc-tridax/appengine-python-flask-master", "id": "0fd1cc6de0feb0ba356abb4a44428d39...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from units.compat.mock import patch from ansible.modules.network.onyx import onyx_config from units.modules.utils import set_module_args from .onyx_module import TestOnyxModule, load_fixture class TestOnyxConfigModule(TestOnyxMod...
{ "content_hash": "7faad70c6620110ecb28e67151e37c48", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 95, "avg_line_length": 41.52127659574468, "alnum_prop": 0.6528311555213938, "repo_name": "thaim/ansible", "id": "f645034e5cf9c6596057dafe5addc9f4f40f1f29", "size": "4615", ...
""" Copyright (c) 2015-2020 Raj Patel([email protected]), StopStalk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights ...
{ "content_hash": "d5b0bdb56aab5cfd2bc112c4ca73cbb7", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 47.43333333333333, "alnum_prop": 0.7385804638088546, "repo_name": "stopstalk/stopstalk-deployment", "id": "bb7dcef2fb64d4a2b993f3164903fb5cf0da2888", ...
import logging import threading import time from pykit import utfjson from kazoo.client import KazooClient from kazoo.exceptions import LockTimeout from kazoo.exceptions import NodeExistsError from kazoo.exceptions import NoNodeError from .exceptions import ZKUtilError from . import zkutil from .zkconf import ZKConf...
{ "content_hash": "b73e914a095e902256ceac51d5eb7c79", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 115, "avg_line_length": 30.335311572700295, "alnum_prop": 0.5620659297662134, "repo_name": "baishancloud/pykit", "id": "e8921f5a4a940b848a24f2d1b4613ef13aaf90be", "size": ...
""" Example that shows how to list available chromecasts. """ import argparse import logging import time import pychromecast import zeroconf parser = argparse.ArgumentParser(description="Example on how to receive updates on discovered chromecasts.") parser.add_argument("--show-debug", help="Enable debug log", action=...
{ "content_hash": "e38b6ed0c3347734a1328c11723753a6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 108, "avg_line_length": 30.862068965517242, "alnum_prop": 0.7541899441340782, "repo_name": "balloob/pychromecast", "id": "795f0e9c2066313396c352016fc7fe23e0cc2039", "size":...
""" Reinforcement - Distributed Actor - Class responsible for playing the 'actor' role in the cluster by generating games """ import logging from tornado import gen from diplomacy_research.models.training.reinforcement.common import create_advantage from diplomacy_research.models.training.reinforcement.generation i...
{ "content_hash": "6ca447655c6551682ee94b20fa757d3e", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 117, "avg_line_length": 41.31818181818182, "alnum_prop": 0.7183718371837183, "repo_name": "diplomacy/research", "id": "7c4570afbb884b0920d1eff5182a913a267a217f", "size": "2...
""" The base for using sqlalchemy as a store with TiddlyWeb. """ from __future__ import absolute_import import logging from pyparsing import ParseException from base64 import b64encode, b64decode from sqlalchemy import event from sqlalchemy.engine import create_engine, Engine from sqlalchemy.exc import ProgrammingE...
{ "content_hash": "f11d20dd346921a2c495d7238832334d", "timestamp": "", "source": "github", "line_count": 597, "max_line_length": 79, "avg_line_length": 35.04857621440536, "alnum_prop": 0.5402408717262474, "repo_name": "tiddlyweb/tiddlywebplugins.sqlalchemy", "id": "96dfb7a4bcbfe72ed2a012c9cfe9df991ebe...
""" test score_mgr """ import datetime from django.test import TransactionTestCase from django.contrib.auth.models import User from apps.managers.score_mgr import score_mgr from apps.managers.team_mgr.models import Group, Team from apps.managers.score_mgr.models import ScoreboardEntry, PointsTransaction from apps.util...
{ "content_hash": "2d853f2929b961995610779ce51e98f1", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 94, "avg_line_length": 39.064516129032256, "alnum_prop": 0.5541907514450867, "repo_name": "yongwen/makahiki", "id": "94edb02c7ad65ded2d5d8d14ffaca3dd5968f78c", "size": "96...
""" Problem Definition : The following iterative sequence is defined for the set of positive integers: n = n/2 (n is even) n = 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 - 40 - 20 - 10 - 5 - 16 - 8 - 4 - 2 - 1 It can be seen that this sequence (starting at 13...
{ "content_hash": "6a8615a17c27010fd626a137bf45906b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 249, "avg_line_length": 45.52054794520548, "alnum_prop": 0.5188083057478182, "repo_name": "vivekpabani/projecteuler", "id": "fa26ed89d01b9ad4f63cb1fd1226ccdccdcb907f", "siz...
from __future__ import absolute_import, print_function import re from .util import fix_fileid, DIRNAME, NORMCASE from .info import ParentInfo FILE_ID_RE = re.compile( r""" ^ (?: ( .* [.] (?: py | txt ) \b ) # .txt for doctest files ( [^.] .* )? ) $ "...
{ "content_hash": "d5f11aefd69e9c4cf1943a922dc8bcd8", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 81, "avg_line_length": 27.87719298245614, "alnum_prop": 0.5434235368156073, "repo_name": "DonJayamanne/pythonVSCode", "id": "798aea1e93f1fd160e9ad99d737bbb9545d2b41e", "si...
"""Imports offline conversion values for specific clicks into your account. To get the Google Click ID for a click, run a CLICK_PERFORMANCE_REPORT. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more informa...
{ "content_hash": "40fe71e1a3867b2427deb0ce2533c511", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 33.8433734939759, "alnum_prop": 0.6753292986828052, "repo_name": "richardfergie/googleads-python-lib", "id": "01d725cb5ac6339127eb689e4857d2317e9b336e"...
import copy from nailgun.db.sqlalchemy.models import NeutronConfig from nailgun.db.sqlalchemy.models import NovaNetworkConfig from nailgun.objects import ClusterCollection from nailgun.objects import MasterNodeSettings from nailgun.objects import NodeCollection from nailgun.settings import settings from nailgun.statis...
{ "content_hash": "9ac885f00de937c41c3725412ad5a80c", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 79, "avg_line_length": 41.29042904290429, "alnum_prop": 0.5454400127887459, "repo_name": "prmtl/fuel-web", "id": "b1d4f75637bf1d245209df0c889952bb0015e85c", "size": "13121...
from pychron.lasers.stage_managers.remote_stage_manger import RemoteStageManager class ChromiumStageManager(RemoteStageManager): pass # ============= EOF =============================================
{ "content_hash": "1eddba2defccf7f73bbd4389dae1f756", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 80, "avg_line_length": 26, "alnum_prop": 0.5817307692307693, "repo_name": "NMGRL/pychron", "id": "ee1265695a4cc20d115ba0d867d794d8c577f835", "size": "945", "binary": false...
""" Created on May 7, 2011 @author: jake """ from decimal import Decimal from django import VERSION from django.db import models import moneyed from djmoney.models.fields import MoneyField from djmoney.models.managers import money_manager, understands_money from .._compat import register class ModelWithVanillaMon...
{ "content_hash": "ce28b9eff8e02be8b62241ef8a592d59", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 104, "avg_line_length": 28.30263157894737, "alnum_prop": 0.7333798233379824, "repo_name": "rescale/django-money", "id": "8fc7f57f690147e4c913a2e2cedc95ea10f7e31a", "size":...
import sys sys.path.insert(0, './externals') sys.path.insert(0, './apps') from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you...
{ "content_hash": "4c1549cade4a1afc61d787777902383a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 299, "avg_line_length": 41.785714285714285, "alnum_prop": 0.7196581196581197, "repo_name": "justquick/django-native-tags", "id": "f3e87d9248143ec8c8076aea18465b753d543aa7", ...
"""Test utils for tensorflow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from collections import OrderedDict import contextlib import functools import gc import itertools import math import os import random import re import tempfil...
{ "content_hash": "92a9c1a63026afab01c0263f1a4c9eae", "timestamp": "", "source": "github", "line_count": 3475, "max_line_length": 145, "avg_line_length": 35.37640287769784, "alnum_prop": 0.6554952697811003, "repo_name": "cxxgtxy/tensorflow", "id": "6b54f03e88282827e79e425577f1ba7295975263", "size": ...
""" nc_to_na.py ============= Holds the class NCToNA (sub-classing CDMSToNA) that converts a NetCDF file to one or more NASA Ames files. """ # Imports from python standard library import sys import logging # Import from nappy package import nappy from nappy.na_error import na_error import nappy.ut...
{ "content_hash": "7d57a3a765a4d88252dfa6462cf12a9e", "timestamp": "", "source": "github", "line_count": 417, "max_line_length": 157, "avg_line_length": 40.80815347721823, "alnum_prop": 0.5493917846859023, "repo_name": "eufarn7sp/egads-eufar", "id": "5c1521cbed27884fc9ee1a9bc13cffb3d6673880", "size"...
"""Run the first page of every benchmark that has a composable measurement. Ideally this test would be comprehensive, but the above serves as a kind of smoke test. """ import os import unittest from telemetry import test from telemetry.core import discover from telemetry.page import page_measurement from telemetry.u...
{ "content_hash": "2824985326758de775e8ceed0a45bb0a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 80, "avg_line_length": 34.77906976744186, "alnum_prop": 0.7265128719491809, "repo_name": "AndroidOpenDevelopment/android_external_chromium_org", "id": "32755c4ad3a37cdbff447e...
from nova.api.openstack.compute.schemas import availability_zone as schema from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import availability_zones from nova import compute import nova.conf from nova.policies import availability_zone as az_policies from nova import servicegroup ...
{ "content_hash": "c9033a2fe7a2d6d88376d406da605482", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 79, "avg_line_length": 41.778688524590166, "alnum_prop": 0.6080047086521483, "repo_name": "Juniper/nova", "id": "33e61d3fb114533c0cde5f50b69ebdb982d0fe07", "size": "5710",...
import os import re from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() versionfile = open(os.path.join(here, "nodular", "_version.py")).read() mo = re.search(r"^__version__\s*=\s...
{ "content_hash": "a6fdb0b549b7ed2df9b9811471d2b9d2", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 80, "avg_line_length": 28.90909090909091, "alnum_prop": 0.6232704402515723, "repo_name": "hasgeek/nodular", "id": "39c75f3ee5fbcb9e34dcc9cea48e92ae5bd19af8", "size": "1590"...
""" test_build ~~~~~~~~~~ Test all builders that have no special checks. :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from util import with_app, test_root, path from textwrap import dedent def teardown_module(): (test_root / '_...
{ "content_hash": "127478cf8161045fe1f38f3cafd29c5b", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 68, "avg_line_length": 23.34065934065934, "alnum_prop": 0.6393596986817326, "repo_name": "kiwicopple/MyMDb", "id": "b172184b1d29a144cb235a5a3c87e8a4687ea43f", "size": "2148...
""" Custom controler """
{ "content_hash": "3db678cf1f08a7526674034a2dfc400f", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 16, "avg_line_length": 8, "alnum_prop": 0.625, "repo_name": "mpeuster/estate", "id": "b3dc53b7d03d3cd2e1d31986b0fd7c18391cfa31", "size": "24", "binary": false, "copies":...
import re import sys def ReorderHeaders(path): with open(path, 'r') as f: source = f.read() all_lines = iter(source.split('\n')) before_includes_lines = [] includes_lines = [] after_includes_lines = [] # Collect all the lines prior to the first #include in before_includes_lines. try: while Tru...
{ "content_hash": "05c886e4ee5166abf86e3bf7a527f219", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 98, "avg_line_length": 28.152380952380952, "alnum_prop": 0.6187415426251691, "repo_name": "craffert0/envoy", "id": "148f4ca25bac95aed131b4270998fbbe5609c682", "size": "362...
from office365.entity_collection import EntityCollection from office365.onenote.entity_hierarchy_model import OnenoteEntityHierarchyModel from office365.onenote.operations.onenote import OnenoteOperation from office365.onenote.pages.page_links import PageLinks from office365.runtime.queries.service_operation import Ser...
{ "content_hash": "6071bc2aaed4b21638b713918de06f30", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 120, "avg_line_length": 42.61176470588235, "alnum_prop": 0.6612368856985091, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "8f9a5705fe56c9f9bdbc7efd21f35869ec03745...
import doctest import pickle import warnings from helpers import unittest, LuigiTestCase, with_config from datetime import datetime, timedelta import luigi import luigi.task import luigi.util import collections from luigi.task_register import load_task class DummyTask(luigi.Task): param = luigi.Parameter() ...
{ "content_hash": "83d716e97723021e7f1506fd655adde7", "timestamp": "", "source": "github", "line_count": 456, "max_line_length": 147, "avg_line_length": 35.708333333333336, "alnum_prop": 0.6153657188478782, "repo_name": "riga/luigi", "id": "cd95b88b8768bf13d9b636213a2d6673010e8e84", "size": "16886",...
__author__ = "Nils Tobias Schmidt" __email__ = "schmidt89 at informatik.uni-marburg.de" from threading import Event import threading class StopThread(threading.Thread): ''' Extends the `Thread` with an `Event` and the `terminate` method like the `multiprocessing` api offers it. Calling it will trigge...
{ "content_hash": "df3d5e6ce31c445eb4cd45d86b38a81e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 98, "avg_line_length": 35.44, "alnum_prop": 0.6399548532731377, "repo_name": "nachtmaar/androlyze", "id": "0d3c1cb2dd5c3682d3ef7699349391cb34d4e2fa", "size": "906", "bina...
"""Autogenerated file, do not edit. Submit translations on Transifex.""" MESSAGES = { "%d min remaining to read": "ulteriori %d minuti di lettura", "(active)": "(attivo)", "Also available in:": "Disponibile anche in:", "Archive": "Archivio", "Atom feed": "Feed Atom", "Authors": "Autori", "C...
{ "content_hash": "a01f2fc56d655e55335740440f81d887", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 72, "avg_line_length": 38.395833333333336, "alnum_prop": 0.6131307650569723, "repo_name": "okin/nikola", "id": "2af1a62ca793b5d2b5a8d4894ee88fe3f8a7e36d", "size": "1869", ...
import EncoderFactory from DatasetManager import DatasetManager import BucketFactory import pandas as pd import numpy as np from sklearn.metrics import roc_auc_score from sklearn.pipeline import FeatureUnion, Pipeline from sklearn.preprocessing import StandardScaler import time import os import sys from sys import a...
{ "content_hash": "1e146c71b5e14158245e2d617a581210", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 160, "avg_line_length": 45.41798941798942, "alnum_prop": 0.5971575023299162, "repo_name": "irhete/predictive-monitoring-benchmark", "id": "46480f5f639f4f49473a6925e7a7bc99e6...
from django.conf.urls import url from daguerre.views import (AdjustedImageRedirectView, AjaxAdjustmentInfoView, AjaxUpdateAreaView) urlpatterns = [ url(r'^adjust/(?P<storage_path>.+)$', AdjustedImageRedirectView.as_view(), name="daguerre_adjusted_image_redirect"), ...
{ "content_hash": "4c1acd2da3417c0d5f61e60d5990f4fd", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 34.470588235294116, "alnum_prop": 0.621160409556314, "repo_name": "littleweaver/django-daguerre", "id": "3ca4d682534ed7f498aaa655f5abc48e47a347df", "...
import sqlalchemy as sa from tests import TestCase from sqlalchemy_utils import UUIDType import uuid class TestUUIDType(TestCase): def create_models(self): class User(self.Base): __tablename__ = 'user' id = sa.Column(UUIDType, default=uuid.uuid4, primary_key=True) def ...
{ "content_hash": "3ad473648553cb441f77b21d6aa2a8db", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 24.615384615384617, "alnum_prop": 0.584375, "repo_name": "joshfriend/sqlalchemy-utils", "id": "5a1de102b8be9981e79b0b7aae9c5d910a738710", "size": "96...
import sys import os this_path = os.path.split(sys.modules['__main__'].__file__)[0] sys.path.insert(0, this_path + '/lib') import multiapt.defaultconfig all = multiapt.defaultconfig.__dict__.keys() all.sort() print '# -*- coding: utf-8 -*-' print '#' print '# All available configuration parameters, and their defaul...
{ "content_hash": "5746471d49ce34f1294a4104004b2529", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 75, "avg_line_length": 23.736842105263158, "alnum_prop": 0.6452328159645233, "repo_name": "zeha/multiapt", "id": "1fffb990e61c31a77f9af085b4cfd0802eac958f", "size": "494", ...
''' Text Markup =========== .. versionadded:: 1.1.0 We provide a simple text-markup for inline text styling. The syntax look the same as the `BBCode <http://en.wikipedia.org/wiki/BBCode>`_. A tag is defined as ``[tag]``, and should have a corresponding ``[/tag]`` closing tag. For example:: [b]Hello [color=ff000...
{ "content_hash": "6fa21c4c2d8e8a55ec99df842d6b1b36", "timestamp": "", "source": "github", "line_count": 772, "max_line_length": 79, "avg_line_length": 39.77590673575129, "alnum_prop": 0.44934379783111345, "repo_name": "vitorio/kivy", "id": "e91bccc65f7923742a00789e038c875bd1f35f92", "size": "30707"...
import os import imath import IECore import GafferScene import GafferSceneTest import GafferOSL import GafferOSLTest import GafferAppleseed class AppleseedShaderAdaptorTest( GafferOSLTest.OSLTestCase ) : def testDirtyPropagation( self ) : adaptor = GafferAppleseed.AppleseedShaderAdaptor() self.assertEqual( ad...
{ "content_hash": "97b30847bf998ae01f24b066442314bf", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 111, "avg_line_length": 36.35616438356164, "alnum_prop": 0.6989449886963075, "repo_name": "GafferHQ/gaffer", "id": "4e6985396d2f691b4e48ea1293c45221c5abc113", "size": "4457...
"""Python wrappers for CloudFormation intrinsic functions These are all available without preamble in a pyplate's global namespace. These help make the pyplate look a little more like python than JSON, and can be ignored if you want to write the raw JSON directly. (But you don't want that, right? After all, that's wh...
{ "content_hash": "a68790f4a1e1d47a610d1b454ac3d49e", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 97, "avg_line_length": 33.81869688385269, "alnum_prop": 0.6955101357011224, "repo_name": "gilt/nova", "id": "a68fb75eb59fa54b6bc28921b7d0ae9d403033a5", "size": "12558", ...
from typing import Iterable, List, Optional from ..celeryconf import app from ..discount.models import Sale from .models import Attribute, Product, ProductType, ProductVariant from .utils.attributes import generate_name_for_variant from .utils.variant_prices import ( update_product_minimal_variant_price, updat...
{ "content_hash": "0314b41891edb2049e960a82acc9e044", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 87, "avg_line_length": 37.142857142857146, "alnum_prop": 0.7415384615384616, "repo_name": "maferelo/saleor", "id": "29bdd6202687fddc5148b1c3f18396a048eab979", "size": "2600...
""" The citext PostgreSQL extension supports indexing of case-insensitive text strings and thus eliminates the need for operations such as iexact and other modifiers to enforce use of an index. """ from django.db import IntegrityError from . import PostgreSQLTestCase from .models import CITextTestModel class CITextT...
{ "content_hash": "e8fa023b81886372ab3e0758eed3d60f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 80, "avg_line_length": 31, "alnum_prop": 0.7010752688172043, "repo_name": "guettli/django", "id": "7f86f6a2056aa0046a1bc0aed9739bb57490acda", "size": "930", "binary": fal...
import unittest import numpy as np import sys sys.path.append("..") import paddle from op_test import OpTest from op_test_xpu import XPUOpTest from xpu.get_test_cover_info import ( create_test_class, get_xpu_op_support_types, XPUOpTestWrapper, ) paddle.enable_static() def huber_loss_forward(val, delta...
{ "content_hash": "25e5f8f2c1c042b89d1746ab785709f5", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 77, "avg_line_length": 27.203703703703702, "alnum_prop": 0.5547991831177672, "repo_name": "luotao1/Paddle", "id": "50d77fc1a3d5f0315bf2eedc13bc2f783bd64554", "size": "3551...
""" A fake XenAPI SDK. """ import base64 import pickle import pprint import random import uuid from xml.sax import saxutils import zlib from oslo.serialization import jsonutils from oslo.utils import timeutils from oslo.utils import units from nova import exception from nova.i18n import _ from nova.openstack.common ...
{ "content_hash": "09e23c7dabec25911dcf22ad8f36c476", "timestamp": "", "source": "github", "line_count": 1021, "max_line_length": 79, "avg_line_length": 34.47404505386876, "alnum_prop": 0.5418489686914029, "repo_name": "sajeeshcs/nested_quota_latest", "id": "b6787da7573284ab2ab89075ebd4ca4d97efd1b5", ...
import os import sys import pandas import datetime import bigtempo.core as core import bigtempo.auditor as auditor dt = datetime.datetime cities = ['CITY_A', 'CITY_B'] engine = core.DatasourceEngine() def _get_test_data_dir(): return os.path.abspath(os.path.join('tests', 'acceptance_tests_data')) def _get_tes...
{ "content_hash": "dbe118ab77442df15910d5ca3179b8c1", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 96, "avg_line_length": 34.89908256880734, "alnum_prop": 0.5291798107255521, "repo_name": "rhlobo/bigtempo", "id": "cc4bce5a5ab16d005f55470db354b472cb4adfda", "size": "3830...
import io from glossarize.glossarize import Glossary, DctFromTxtFile class TestDctFromTxtFile(object): _txt = u""" cat a domestic feline of questionable intent turtle a lovely little reptile %robot: your plastic pal ...
{ "content_hash": "14037d8d60587eb40e159bc790e2f315", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 99, "avg_line_length": 35.41304347826087, "alnum_prop": 0.5948434622467772, "repo_name": "catherinedevlin/py-glossarize", "id": "4d770447925856850a666699949385caa17dcca5", ...
import functools import inspect from oslo_concurrency import lockutils from oslo_log import log as logging from oslo_utils import excutils from nova.db import base from nova import hooks from nova.i18n import _, _LE from nova.network import model as network_model from nova import objects LOG = logging.getLogger(__n...
{ "content_hash": "c66a598c0c1255bd3d2cacbb48217173", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 79, "avg_line_length": 39.89173789173789, "alnum_prop": 0.6279102985287816, "repo_name": "hanlind/nova", "id": "010cfcd63ee54d5220866a1379b5e2ce2fd74707", "size": "14637",...
"""Index prefixing tests.""" import json from conftest import IndexFlusher from helpers import assert_hits_len, get_json, record_url from invenio_search import current_search def test_index_creation(app, prefixed_search): """Sanity check for index creation.""" suffix = current_search.current_suffix es_a...
{ "content_hash": "c0fb7f16b56eea62661b72732d249a64", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 86, "avg_line_length": 34.39393939393939, "alnum_prop": 0.626431718061674, "repo_name": "inveniosoftware/invenio-records-rest", "id": "9189ab8a290c92a1237443dc31bd9586ce45e8b...
''' Created on Mar 17, 2013 __author__ = "Elizabeth 'pidge' Flanagan" __copyright__ = "Copyright 2012-2013, Intel Corp." __credits__ = ["Elizabeth Flanagan"] __license__ = "GPL" __version__ = "2.0" __maintainer__ = "Elizabeth Flanagan" __email__ = "[email protected]" ''' from buildbot.steps.shell import Sh...
{ "content_hash": "7db25247bb6290f9a6730c9f1cdae5e0", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 199, "avg_line_length": 57, "alnum_prop": 0.5784600389863548, "repo_name": "denny820909/builder", "id": "42b6d3e1b7b2ea22235501e3a85c6126bab90411", "size": "4104", "binar...
import nose import angr import subprocess import logging l = logging.getLogger('angr.tests.sscanf') import os test_location = str(os.path.dirname(os.path.realpath(__file__))) def run_sscanf(threads): test_bin = os.path.join(test_location, "../../binaries/tests/x86_64/sscanf_test") b = angr.Project(test_bin)...
{ "content_hash": "6b198e155b3ef0883c4deb833fc5f39c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 87, "avg_line_length": 31.122448979591837, "alnum_prop": 0.6360655737704918, "repo_name": "haylesr/angr", "id": "368d22592bd26d4e4f6a48731445a44229e883f7", "size": "1525", ...
"""Ce package contient les backens de jeu. Ce fichier contient la classe BaseJeu dont doit être hérité chaque jeu. Cette classe est détaillée plus bas. """ from abstraits.obase import BaseObj class BaseJeu(BaseObj): """Classe définissant un jeu. Ce jeu est indépendant du plateau. En effet, un plateau peut...
{ "content_hash": "e3362c2ded898fde537304385a5c57d4", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 36.03703703703704, "alnum_prop": 0.6265159301130524, "repo_name": "vlegoff/tsunami", "id": "54a77c3ec3af9d0e21cfa3a952a6f596fc972056", "size": "6488...
import json import os from unittest import mock import pytest from airflow.models import Connection from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook from tests.providers.google.cloud.utils.gcp_authenticator import GCP_AWS_KEY from tests.test_utils.gcp_system_helpers import GoogleSystemTest, provide...
{ "content_hash": "4bef9868c95fe2d5a0eaa2b92416812f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 95, "avg_line_length": 37.6578947368421, "alnum_prop": 0.6519916142557652, "repo_name": "danielvdende/incubator-airflow", "id": "cb9b674eee4f76af7dc361372dddb1f453c7b9ae", ...
''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License");...
{ "content_hash": "a022f3c6b3dd41097e8f5fb05c973bc9", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 112, "avg_line_length": 39, "alnum_prop": 0.733058608058608, "repo_name": "pbchou/trafficserver", "id": "705ed4920cef6e1241b61899b017bf274d7d2a60", "size": "2184", "binar...
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from .T_S_I_V_ import table_T_S_I_V_ class table_T_S_I_J_(table_T_S_I_V_): pass
{ "content_hash": "0291543ecffd2ea4c724eda49ab19d1e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 64, "avg_line_length": 30.166666666666668, "alnum_prop": 0.7071823204419889, "repo_name": "Pal3love/otRebuilder", "id": "ca538ba9a60ffae9d88099b10a2942f312e845da", "size": "...
"""IPython Module""" from __future__ import (absolute_import, print_function, division) from ..persistence.models import * # pylint: disable=wildcard-import from ..persistence import persistence_config, relational, content def init(path=None, ipy...
{ "content_hash": "d83a929bbf50560b84d312ed41784826", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 114, "avg_line_length": 27.885714285714286, "alnum_prop": 0.6342213114754098, "repo_name": "gems-uff/noworkflow", "id": "d802e83cc9a5c6de1c15f1599b18a0d35ce4dda6", "size": ...
DEBUG = True TEMPLATE_DEBUG = True DATABASE_ENGINE = '' DATABASE_NAME = '' DATABASE_USER = ''
{ "content_hash": "712f0caa909231dc536cfa17e8bc3a19", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 21, "avg_line_length": 13.714285714285714, "alnum_prop": 0.6666666666666666, "repo_name": "fgirault/smeuhsocial", "id": "f9c7a4ee0153b2cc5e5a7dd78b0f48eaf5c3773f", "size": "...
import deployDataCenter import TestCaseExecuteEngine from optparse import OptionParser import os if __name__ == "__main__": parser = OptionParser() #TODO: deprecate and use the argparse module parser.add_option("-c", "--config", action="store", default="./datacenterCfg", dest="config", help="the path where...
{ "content_hash": "ca49dea42d878809073e1b47ec3418c2", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 182, "avg_line_length": 43.97959183673469, "alnum_prop": 0.6700696055684455, "repo_name": "argv0/cloudstack", "id": "1c82d9fcc2e7d9515f70eb527b9fe0b037d9e707", "size": "294...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Extension...
{ "content_hash": "98ede56a8b1b99dc6f63671b94bc0b67", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 281, "avg_line_length": 32.686440677966104, "alnum_prop": 0.6121337827326938, "repo_name": "mbohlool/client-python", "id": "4f888655d3bedf91dc6a20e24f2d300653addae3", "siz...
from bottle import run, route, post, request, default_app import auth import chats from urls import * users = auth.Users() users.add('adm', 'asm') cht = chats.Chats() #TODO: читать чат может только один из его пользователей авторизованный # хранить пользователей, чаты br = '<br>' br = '\n' @route(urlHist, method='POST'...
{ "content_hash": "407ec96e1ae89e2ba0fcefdd7ddbe5bf", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 71, "avg_line_length": 22.15625, "alnum_prop": 0.6370474847202633, "repo_name": "anokata/pythonPetProjects", "id": "eeb12ea62e9fe91f2efe28b7a8b27a5b498bd796", "size": "2207...
from bookmarksdb import * from utility import * log = None gnosis_db = BookmarksDb() def print_instructions(): """ Print possible command-line arguments """ print("-a, --search-all") print("-c, --clean: remove stale bookmarks") print("-g, --get \"file\": return bookmarks for file") print...
{ "content_hash": "6ea52a2ff02ec23595de1099680e6a91", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 79, "avg_line_length": 29.535911602209946, "alnum_prop": 0.5405287442324479, "repo_name": "gennaios/alfred-gnosis", "id": "893603465a1cd7b93ec4bae66d95110bbb4bca4e", "size...
"""Tests for certbot_nginx.parser.""" import glob import os import re import shutil import unittest from certbot import errors from certbot_nginx import nginxparser from certbot_nginx import obj from certbot_nginx import parser from certbot_nginx.tests import util class NginxParserTest(util.NginxTest): """Nginx...
{ "content_hash": "50561404fc27bd5780158fe82079b235", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 80, "avg_line_length": 46.14624505928854, "alnum_prop": 0.47349036402569594, "repo_name": "dietsche/letsencrypt", "id": "8ac995dfc4a3477f7f6ffeb3fae9a8a95e454240", "size":...
import arcpy import os import sys import traceback import TestUtilities def RunTest(): try: arcpy.AddMessage("Starting Test: TestModelRadialLineOfSight") if arcpy.CheckExtension("Spatial") == "Available": arcpy.CheckOutExtension("Spatial") else: # Raise a c...
{ "content_hash": "eb5d81a36cc983dffa7190ee52f17643", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 106, "avg_line_length": 37.35576923076923, "alnum_prop": 0.5837837837837838, "repo_name": "JudTown17/solutions-geoprocessing-toolbox", "id": "220acf5c28ebb8299da522248a0cf90...
import tensorflow as tf class Autoencoder(object): def __init__(self, n_input, n_hidden, transfer_function=tf.nn.softplus, optimizer = tf.train.AdamOptimizer()): self.n_input = n_input self.n_hidden = n_hidden self.transfer = transfer_function network_weights = self._initialize_we...
{ "content_hash": "9b189ae0a42af6708be22955274c5299", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 114, "avg_line_length": 38.186440677966104, "alnum_prop": 0.6271637816245007, "repo_name": "wangyang59/tf_models", "id": "cde14aa4a993cb6997eeb99e8af31fb3d438cd28", "size":...
import re from mcp21.package import MCPPackageBase from window.outputpane import EVT_ROW_COL_CHANGED class MCPPackage(MCPPackageBase): def __init__(self, mcp): MCPPackageBase.__init__(self, mcp) self.package = 'dns-com-vmoo-client' self.min = '1.0' self.max = '1.0' ...
{ "content_hash": "d89a06f8edec8414dd25d0e46533722a", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 87, "avg_line_length": 31.454545454545453, "alnum_prop": 0.5686416184971098, "repo_name": "emersonrp/wxpymoo", "id": "6ed770a260013af34aba3666df9d9920469e4234", "size": "13...
"""Core database logic for HaaS This module defines a number of built-in database objects used by HaaS. In addition, it provides some general infrastructure for dealing with the database. Extensions are permitted to create new database objects by subclassing from `db.Model`. """ # from sqlalchemy import * # from sql...
{ "content_hash": "7fb54398883ee6e8e7fd9bcb86120acc", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 81, "avg_line_length": 35.446058091286304, "alnum_prop": 0.6112379280070237, "repo_name": "henn/hil_sahil", "id": "fc853e985e445b81c2fafbd9c9ff6ca9cf639a4f", "size": "1769...
import json import os import re import subprocess import sys import tempfile import urllib2 import getpass try: import jira.client JIRA_IMPORTED = True except ImportError: JIRA_IMPORTED = False # Location of your Parquet git development area PARQUET_HOME = os.path.abspath(__file__).rsplit("/", 2)[0] PROJE...
{ "content_hash": "1481ff49114b4e2d4201651f47d73d50", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 104, "avg_line_length": 37.11716621253406, "alnum_prop": 0.6219351049772427, "repo_name": "apache/parquet-mr", "id": "c67092472125e60c15e8a0263a1efb852a0b6634", "size": "1...
import unittest from Src.BioAnalyzer.DataAccess.Entities.GenePrioritization.DifferentialDnaMethylationLevelValue import \ DifferentialDnaMethylationLevelValue from Src.BioAnalyzer.DataAccess.Entities.GenePrioritization.LocalDifferentialDnaMethylationSample import \ LocalDifferentialDnaMethylationSample class...
{ "content_hash": "62fe24a39fd93d6d8241d20cd77989fb", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 148, "avg_line_length": 72.08490566037736, "alnum_prop": 0.43672294202329537, "repo_name": "cemarchi/biosphere", "id": "dcee2e0bf7195cf3524f511d93b20332e597cd67", "size": ...
import os import struct import numpy as np import scipy.misc import skimage.exposure def read_gnt_in_directory(gnt_dirpath): def samples(f): header_size = 10 # read samples from f until no bytes remaining while True: header = np.fromfile(f, dtype='uint8', count=header_size) ...
{ "content_hash": "45c1b6dcc240bd17d59624e3d5d34e3a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 95, "avg_line_length": 33.30434782608695, "alnum_prop": 0.608355091383812, "repo_name": "integeruser/CASIA-HWDB1.1-cnn", "id": "0062db4dcf85f9343a2141f33aa67f5bc9a44f21", "...
from string import Template from datetime import date bitcoinDir = "./"; inFile = bitcoinDir+"/share/qt/Info.plist" outFile = "GeoCoin-Qt.app/Contents/Info.plist" version = "unknown"; fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro" for line in open(fileForGrabbingVersion): lineArr = line.replace(" ",...
{ "content_hash": "20eab88f4fcdd3a0e847031ff7dd6e8d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 27.208333333333332, "alnum_prop": 0.7090352220520674, "repo_name": "cryptokoin/geocoinq", "id": "02d4f6fe0fee7ed2355b9d77de6aa2399cfe66c1", "size": "...
from matplotlib import pyplot as plt import numpy as np import scipy.io as sio # Submodule to load a GNU Octave/MATLAB file image = plt.imread('input.png') bin_mask = sio.loadmat('mask.mat')['bin_mask'].astype('bool') mask = np.dstack((bin_mask, bin_mask, bin_mask)) image[~mask] = 0 plt.imsave('output.png', image)
{ "content_hash": "f5b9bc1c739587e1f0af1cfeaa05bcec", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 67, "avg_line_length": 26.666666666666668, "alnum_prop": 0.7125, "repo_name": "milq/computer-vision-resources", "id": "2872db656bac34cb6132fb84f05b4d61e48741fe", "size": "3...
import py from rpython.jit.metainterp.test import test_string from rpython.jit.backend.ppc.test.support import JitPPCMixin class TestString(JitPPCMixin, test_string.TestLLtype): # for the individual tests see # ====> ../../../metainterp/test/test_string.py pass class TestUnicode(JitPPCMixin, test_string.T...
{ "content_hash": "e34e824d6653f5669c6c722bdcda4f51", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 62, "avg_line_length": 33.46153846153846, "alnum_prop": 0.7172413793103448, "repo_name": "oblique-labs/pyVM", "id": "8f34e4595f7331f7688e3ade12f480aa7722f20d", "size": "435...
from io import StringIO from antlr4.Recognizer import Recognizer from antlr4.RuleContext import RuleContext class SemanticContext(object): # # The default {@link SemanticContext}, which is semantically equivalent to # a predicate of the form {@code {true}?}. # NONE = None # # For context ...
{ "content_hash": "eb4715602f3347bf704449059232252e", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 86, "avg_line_length": 31.75541795665635, "alnum_prop": 0.6033928049137175, "repo_name": "hce/antlr4", "id": "d4a50915dd4ba645e4e908ebe5ebb4d92a4f0984", "size": "12174", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Person.suffix' db.add_column('contacts_people', 'suffix', self.gf('django.db.models.fields.CharField')(max_l...
{ "content_hash": "57eafe25943535b6d12165fc5244c96e", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 182, "avg_line_length": 82, "alnum_prop": 0.5495017046944664, "repo_name": "huang4fstudio/django-contacts", "id": "297ca023f8354570352ec573982bc9985e9eb62f", "size": "1527...
class LustObject(object): # executes the command def handle(self, arguments): pass def print_help(self): pass class FactorialCommand(LustObject): def handle(self, arguments): try: argument = int(arguments[0]) except (ValueError, IndexError): print("fact: could not read integer argument.") r...
{ "content_hash": "37ca5a7a14e6568b6d07cd8f8d1fec67", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 83, "avg_line_length": 27.309734513274336, "alnum_prop": 0.6652624756966947, "repo_name": "dmiklic/git-tutorial-code", "id": "658f115f4e61b9bb62be29ac550c8c7acb61f3ac", "s...
""" pygments.lexers.sieve ~~~~~~~~~~~~~~~~~~~~~ Lexer for Sieve file format. https://tools.ietf.org/html/rfc5228 https://tools.ietf.org/html/rfc5173 https://tools.ietf.org/html/rfc5229 https://tools.ietf.org/html/rfc5230 https://tools.ietf.org/html/rfc5232 https://tools.ietf.org/ht...
{ "content_hash": "ee8d2cdb191b1545d46c00e2ee3133ed", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 82, "avg_line_length": 31.294871794871796, "alnum_prop": 0.528062269561655, "repo_name": "dscorbett/pygments", "id": "ab43db8ba38469e9f5011baa91d834354c3ce824", "size": "24...
<<<<<<< HEAD <<<<<<< HEAD import sys from test import support, list_tests import pickle class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(list([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = list(l0_3) self.assertEqual(l0_3, l0_3_bis) ...
{ "content_hash": "e7b3b5a4bbccdcb5531e7035840c44e4", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 84, "avg_line_length": 34.74935400516796, "alnum_prop": 0.5562165377751338, "repo_name": "ArcherSys/ArcherSys", "id": "6d4c5e6e0eb3b2471821c4ac8f4e2bc08bc4a789", "size": "...
""" This module defines all of the Mixins that provide components of XBlock-family functionality, such as ScopeStorage, RuntimeServices, and Handlers. """ from __future__ import absolute_import, division, print_function, unicode_literals from collections import OrderedDict import copy import functools import inspect...
{ "content_hash": "07e7cb0fd67a29db85a30967ac439ce4", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 116, "avg_line_length": 37.09803921568628, "alnum_prop": 0.6037262156448203, "repo_name": "mitodl/XBlock", "id": "ac5c5b9a0bfe0a99e641e818a6f5078714b9ce2b", "size": "22704...
import vision_configuration as vc import numpy as np np.random.seed(10000) lamina = vc.Lamina(24, 32, 'neuron_types_lamina.csv', 'synapse_lamina.csv', None) lamina.create_cartridges() lamina.connect_cartridges() lamina.create_non_columnar_neurons() lamina.connect_composition_II() lamina.connect_composition_I() lamina....
{ "content_hash": "23a1f6695bc48bdc4eee03d890ae116a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 81, "avg_line_length": 31.333333333333332, "alnum_prop": 0.7792553191489362, "repo_name": "cerrno/neurokernel", "id": "548852b2ea8f15047359475c9362f90d569427b9", "size": "3...
import dateutil # type: ignore import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import pandas as pd from bs4 import BeautifulSoup from sklearn.feature_extraction.text import CountVectorizer from numpy import dot from numpy.linalg import norm from email.utils import p...
{ "content_hash": "0ff74a96b7b6b77e023e25ab12fa81b6", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 120, "avg_line_length": 46.46700507614213, "alnum_prop": 0.6668669434127158, "repo_name": "demisto/content", "id": "51c992ff6df6fa788d482461745ca43ce11df5b9", "size": "183...
""" Copyright (c) 2011, Michael Jospeh Walsh. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
{ "content_hash": "c8a497f69562c0e9a515675cdd32919e", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 104, "avg_line_length": 31.466019417475728, "alnum_prop": 0.6957729095958037, "repo_name": "r0k3/Intellect", "id": "6ce5a66c091aff0a819b3b1da2c9b1f0bcaf23d7", "size": "324...
import kol.Error as Error from kol.database import ItemDatabase from kol.manager import PatternManager from kol.request.GenericRequest import GenericRequest class WokRequest(GenericRequest): def __init__(self, session, itemid1, numMake=1): super(WokRequest, self).__init__(session) self.url = sessi...
{ "content_hash": "45db082e1521daec640977b918d94a2b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 125, "avg_line_length": 51.54, "alnum_prop": 0.6806363989134653, "repo_name": "ijzer/cwbot-ndy", "id": "9970f567cfda5f4631e24d56a5c66b9b41defa68", "size": "2577", "binary...
import sys """ Extend the twx namespace """ if sys.version_info > (3, 1, 0): from pkgutil import extend_path __path__ = extend_path(__path__, __name__)
{ "content_hash": "f7976f5f6394aca5706d4d5b36f9b96c", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 21.125, "alnum_prop": 0.5798816568047337, "repo_name": "datamachine/twx.mtproto", "id": "9fad3cc80fd96ad158e83dea16da8e6e37e5d4c9", "size": "169", "...