text
string
size
int64
token_count
int64
from enum import Enum class JobStatus(Enum): PENDING = "PENDING" REJECTED = "REJECTED" SENT_TO_DPS = "SENT_TO_DPS" PROCESSED_BY_DPS = "PROCESSED_BY_DPS" COMPLETE = "COMPLETE" NOTIFIED_VALIDATION_FAILED = "NOTIFIED_VALIDATION_FAILED" CLEANED_UP = "CLEANED_UP" class ParseStatus(Enum): ...
793
334
import pandas as pd from sklearn.linear_model import LogisticRegression import mlflow import mlflow.sklearn import flask model_path = "models/logit_games_v1" model = mlflow.sklearn.load_model(model_path) app = flask.Flask(__name__) @app.route("/", methods=["GET","POST"]) def predict(): data = {"success": False} params ...
843
341
"""Handles websockets and asynchronous endpoints provided by Tornado instead of Django, but use the Django model framework for a database ORM. """ import datetime import functools import json import logging import tornado.escape from tornado.ioloop import IOLoop import tornado.web import tornado.websocket from django...
12,607
3,354
from models import Base, engine Base.metadata.create_all(engine)
66
21
#!/usr/bin/env python3 """ DFaker Model Based on the dfaker model: https://github.com/dfaker """ from keras.initializers import RandomNormal from keras.layers import Input from lib.model.nn_blocks import Conv2DOutput, UpscaleBlock, ResidualBlock from .original import Model as OriginalModel, KerasModel class Mo...
1,751
654
# encoding: utf-8 """ @author: gallupliu @contact: gallup-liu@hotmail.com @version: 1.0 @license: Apache Licence @file: train.py @time: 2018/3/5 22:58 """ import tensorflow as tf from classify.dataset import data_utils from sklearn.model_selection import train_test_split from classify.model import TextCNN def da...
2,459
859
from django.urls import path from .views import FollowStatsViews, AuthorFollowViews urlpatterns = [ # /authors/followers/ or ../following/ path("<str:follow_state>/", FollowStatsViews.as_view(), name="follows"), # /authors/<author_username>/follow path("<str:username>/follow/", AuthorFollowViews.as_vi...
342
106
from cone.app import get_root from cone.app import security from cone.app import testing from cone.app.browser.login import login_view from cone.app.browser.login import logout_view from cone.tile import render_tile from cone.tile.tests import TileTestCase from webob.response import Response from webob.exc import HTTPF...
2,299
687
from tkinter import * def TelaEditarControle(tela, controle): # Cria a tela de configuração telaEditar = Toplevel(tela) telaEditar.title('EDITA CONTROLE') telaEditar.geometry('280x180+620+120') telaEditar['bg'] = 'gray' telaEditar.resizable(False,False) telaEditar.focus_force() telaEdi...
752
331
# workaround static linked python from julia.api import Julia __julia__ = Julia(compiled_modules=False) import os import sys import subprocess from .wrappers import apply script_dir = os.path.dirname(os.path.realpath(__file__)) def install(): """ Install Julia packages required for yao-framework. """ ...
395
125
# TODO: Generalize this with the discordutil module, factor out oauth import logging from urllib.parse import urlencode import requests import json from flask import request, redirect, session from creds import get_creds from config import config from sessionutil import invalidate_session def twitch_login(): ss...
4,531
1,376
#!/usr/bin/python3 """transliteration of Kim Asendorf's pixel sorting script""" from copy import copy from random import random, gauss from PIL import Image from numpy import int32 from argparse import ArgumentParser # PROGRAM CONSTANTS # rgb(103, 105, 128) BLACK_VALUE = int32(-10000000) # rgb(164, 114, 128) WHITE_V...
6,173
2,083
import pandas as pd from preprocessing import preprocess from wordclouds import wordcloud, find_by_word from sentiment_analysis import calculate_sentiment, find_by_sentiment import nltk import os import tempfile from topic_modelling import lda_topic_model, show_topics, show_example_sentences_by_topic os.environ["MPLCO...
6,173
1,633
import copy from finetune.errors import FinetuneError from finetune.target_models.classifier import Classifier, ClassificationPipeline from finetune.target_models.regressor import Regressor, RegressionPipeline from finetune.base import BaseModel class MultiFieldClassificationPipeline(ClassificationPipeline): def...
4,796
1,360
from exceptions import ValueError class DumpProtocol: def dump(self, config=None, verbose=False): raise ValueError('DumpProtocol not followed')
157
41
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/) # Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org> # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Soft...
24,679
15,672
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import os from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() gh_run_number = os.environ.get("BUILD_NUMBER", None) build_number = None if ...
2,109
729
# SPDX-License-Identifier: Apache-2.0 # Copyright 2020 Nokia import pytest import logging import os from onapsdk.dmaap.dmaap import Dmaap logging.basicConfig(level=os.environ.get("LOGLEVEL", "DEBUG")) @pytest.mark.integration def test_should_get_all_topics_from_dmaap(): # given # when response = Dmaap....
437
172
# Generated by Django 2.2.8 on 2020-03-25 13:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0111_auto_20200325_1311'), ] operations = [ migrations.AddField( model_name='deployhistory', name='date', ...
390
141
import numpy as np import torch from utils.helpers import process_state, device def make_epsilon_greedy_policy(estimator, nA): """ :param estimator: model that returns q values for a given statem/action pair :param nA: number of actions in the environment :return: A function that takes in a state and ...
920
300
__name__ = 'onsets' __version__ = '1.5.1' __package__ = 'phonotactics' # imports #some import machinery checking and manipulations... #import sys #import os #from os import path #if '__file__' in dir(): # __mod_path = path.dirname(__file__) # if __mod_path not in sys.path: # sys.path.app...
2,798
891
# -*- coding: utf-8 -*- # Copyright (c) 2019, Aptitudetech and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class SimplifiedTimeReporting(Document): def onload_post_render(self):...
6,228
2,483
from collections import deque T = int(input()) for t in range(T): n = int(input()) lengths = deque(map(int, input().split())) top = max(lengths) while len(lengths) > 0: left = lengths[0] right = lengths[-1] if (right >= left) and (right <= top): top = right lengths.pop() elif (left >= right) and (lef...
442
189
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def programl_deps(): http_archive( name="labm8", sha256="e4bc669322533e7615f689e5e8a810446d0c803be2e3b21e99a4e0135709755e", strip_prefix="labm8-b98301dec615465a6567bed4ec4131753d1f8b32", urls=[ "https://github.com/ChrisCummin...
6,343
3,685
import stokepy as sp import numpy as np # instantiate class fmc = sp.FiniteMarkovChain() # create initial distribution vector phi = np.array([0, 0, 1, 0, 0]) # generate Markov chain with no boundary conditions fmc.gen_from_params(phi, p = 0.6, num_states = 5, dim = 1) # apply boundary condition: absorbing, reflecti...
1,082
365
import doctest import sys import unittest import r2dto from tests.test_acceptance import AcceptanceTests from tests.test_base_serializer import BaseSerializerTests __all__ = ["doctest", "sys", "unittest", "r2dto", "AcceptanceTests", "BaseSerializerTests"] try: import pep8 except ImportError: print("WARNING: ...
1,225
441
""" Module that defines the interface between the `manager` (i.e Django) and the `broker` (i.e. RabbitMQ). Defines three functions involved in a job's lifecycle: - `dispatch_job` - send a job to a queue - `update_job` - update the status of a job by checking it's (intermediate) result - `check_job` - for a parent job...
10,697
2,879
"""Data loading/munging utilities. This will need to leverage a lot of existing stuff (e.g. numpy.genfromtxt)... """ import logging class DataLoader(object): def __init__(self, data_files=None): pass
217
72
#!/bin/python # coding: utf-8 import argparse import time import collections import os import sys import torch import torch.nn from torch.autograd import Variable import torch.nn as nn import numpy as np from models_grad import RNN, GRU from models_grad import make_model as TRANSFORMER parser = argparse.ArgumentPars...
12,785
4,070
import FWCore.ParameterSet.Config as cms run3_nanoAOD_devel = cms.Modifier()
78
33
# IDLEX EXTENSION ## """ ## Copyright(C) 2011-2012 The Board of Trustees of the University of Illinois. ## All rights reserved. ## ## Developed by: Roger D. Serwy ## University of Illinois ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of thi...
4,892
1,533
GPIO_CON_1_BUT_1 = 10 GPIO_CON_1_BUT_2 = 9 GPIO_CON_2_BUT_1 = 11 GPIO_CON_2_BUT_2 = 14 GPIO_BUZZER = 15
104
81
#!/bin/python # -*- coding: utf-8 -*- '''基本範例格式''' import sys from ctrls.Tester import Tester from models.exampleModel import exampleModel def main(): numbers = ['1314']# 股票編號 tester = Tester(numbers, exampleModel)# 使用測試元件 tester.run()# 模擬 if __name__ == '__main__': sys.exit(main())
309
142
from tempfile import TemporaryDirectory from typing import Any, Dict, Tuple import datasets import flair import numpy as np import pytest import torch from flair.data import Corpus from numpy import typing as nptyping from embeddings.data.data_loader import HuggingFaceDataLoader from embeddings.data.dataset import Hu...
4,025
1,340
# Proszę zaimplementować funkcję, która otrzymuje na wejściu posortowaną niemalejąco tablicę A # o rozmiarze n oraz liczbę x i sprawdza, czy x występuje w A. Jeśli tak, to zwraca najmniejszy indeks, # pod którym x występuje. def binary_search(T, i, j, x): if i > j: return None c = (i + j) // 2 if ...
672
290
import re, io, os, sys from nltk import word_tokenize from argparse import ArgumentParser # Allow package level imports in module script_dir = os.path.dirname(os.path.realpath(__file__)) lib = os.path.abspath(script_dir + os.sep + "..") sys.path.append(lib) from conll_reader import space_join, text2conllu class RuleB...
4,508
2,104
""" Contributors can be viewed at: http://svn.secondlife.com/svn/linden/projects/2008/pyogp/lib/base/trunk/CONTRIBUTORS.txt $LicenseInfo:firstyear=2008&license=apachev2$ Copyright 2009, Linden Research, Inc. Licensed under the Apache License, Version 2.0. You may obtain a copy of the License at: http://www.apa...
2,878
1,036
from enum import Enum from typing import List, Optional from pydantic import BaseModel, HttpUrl class Sense(BaseModel): class Link(BaseModel): text: str url: HttpUrl class Source(BaseModel): language: str english_definitions: List[str] parts_of_speech: List[Optional[str]] ...
1,017
327
import pytest from wtforms.validators import symbol_required from wtforms.validators import ValidationError @pytest.mark.parametrize("min_v", [2, 3, 4, 5, 6]) def test_correct_symbol_required(min_v, dummy_form, dummy_field): """ It should pass for the string with correct count of required symbol. """ ...
1,018
345
# using the input() function message = input("Tell me something, and I'll repeat it!") print(message)
102
31
from src.Node import Node from src.Nodes import Block from src.SymbolTable import SymbolTable class WhileOp(Node): def __init__(self, child: Block, condition: Node): self.condition = condition self.child = child super().__init__( value=condition, children=[child, con...
1,028
307
"""Get information about this package.""" def info(system): """Get information about this package.""" import googledevices.utils.const as package print("Projectname: ", package.NAME) print("Version: ", package.VERSION) print("GitHub link: ", package.URLS.get("github")) print("PyPi link...
748
212
def check(arr): sum_log = set() _sum = 0 for i in xrange(len(arr)): if _sum in sum_log: return True _sum += 1 sum_log.add(_sum) return False arr = [1, 0, -2, 5, -4, 1, 9, -2] print(check(arr))
251
109
#! /usr/bin/env python import argparse import pandas as pd import numpy as np def check_dataframe(filename, data_frame, key_columns): if any(col not in data_frame for col in key_columns): raise ValueError('Key columns not in {}.'.format(filename)) nonzero = np.count_nonzero(data_frame['trg_error']) ...
1,588
467
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under th...
9,859
2,919
# test __init__ file
21
8
import re class NS: xs = 'http://www.w3.org/2001/XMLSchema' link = 'http://www.xbrl.org/2003/linkbase' xlink = "http://www.w3.org/1999/xlink" xbrli = "http://www.xbrl.org/2003/instance" xbrldi = "http://xbrl.org/2006/xbrldi" xbrldie = "http://xbrl.org/2005/xbrldi/errors" xbrldt = "http://xb...
3,542
1,727
try: from .helpers import config, management, xp, spam except ImportError: import helpers.config, helpers.management, helpers.xp, helpers.spam import time import discord from discord.ext import commands from discord.commands import slash_command class XPEvent(commands.Cog): def __init__(self, client): ...
2,832
879
import logging import os import subprocess import sys import yaml files_dir = "" # --- General util commands --- def execute_command( command, working_directory, environment_variables, executor, logger=logging, livestream=False ): logger_prefix = "" if executo...
2,199
733
class color: import os T = os.getenv('TERM') if ( T=='cygwin' or T=='mingw' ) : HEADER = '\033[01;35m' BLUE = '\033[01;34m' GREEN = '\033[01;32m' WARNING = '\033[01;33m' FAIL = '\033[01;31m' RED = FAIL ENDC = '\033[0m' else : HEADER = '\033[95m' BLUE = '\033[94m' GREEN = ...
578
312
# -*- coding: utf-8 -*- import re import calendar import datetime, time from datetime import timedelta import urllib.request import requests, json from http.cookiejar import CookieJar from bs4 import BeautifulSoup import numpy as np import pandas as pd from pandas import DataFrame import pandas.io.sql as pdsql from ma...
7,958
3,849
import csv import os import math import logging import traceback import requests import sys from collections import namedtuple from optparse import make_option from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from django.db i...
24,237
6,793
# Author: Kim Hammar <kimham@kth.se> KTH 2018 from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer from nltk.tokenize import TweetTokenizer from nltk.tag.perceptron import PerceptronTagger import nltk import emoji nltk.download('averaged_perceptron_tagger') nltk.download('stopwords') nltk.download...
5,387
1,747
from .utils.handler.config import ConfigHandler
47
11
from ._core import Collection, local, task @task(name="main", default=True) def start_main(c): local(f"overmind start -l {','.join(c.start.main + c.start.minimal)}", pty=True) @task(name="minimal") def start_minimal(c): local(f"overmind start -l {','.join(c.start.minimal)}", pty=True) @task(name="all") de...
475
192
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 17 23:14:28 2018 @author: Akihiro Inui """ def rolloff(input_power_spectrum: list, param: float=0.85) -> float: """ Spectral Rolloff :param input_power_spectrum: power spectrum in list :param param: threadshold for roll off :...
888
307
#!/usr/bin/env python from lib2to3.main import main import sys import os sys.exit(main("lib2to3.fixes"))
112
47
""" Afterglow Core: photometric calibration job schemas """ from typing import List as TList from marshmallow.fields import Integer, List, Nested from ..job import JobSchema, JobResultSchema from ..field_cal import FieldCalSchema, FieldCalResultSchema from ..photometry import PhotSettingsSchema from .source_extracti...
1,070
297
#import unittest def addRow(r, d, v): dmo = [] getHeightAndMore(r, 0, dmo, d) if len(dmo) <= 0: print ('no way to add row for no d-1 nodes found') return print('dmo has %d' % len(dmo)) print('dmo: %s' % ','.join([str(x.val) for x in dmo])) for n in dmo: left, right = N...
2,692
1,011
expected_output = { "interface": { "GigabitEthernet0/0/0": { "interface_is_ok": "YES", "ip_address": "10.105.44.23", "method": "other", "protocol": "up", "status": "up" }, "GigabitEthernet0/0/1": { "interface_is_ok": "YE...
4,458
1,523
from common import is_connection_ok import paramiko """ execute_ssh(host, port, username, password, cmd) """ def execute_ssh(host, username, password, cmd, port='22'): if is_connection_ok(): try: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ...
1,000
283
''' 请求头 ''' HEADERS_IPHONE = {'user-agent': ( 'Mozilla/5.0 ' '(iPhone; CPU iPhone OS 6_0 like Mac OS X) ' 'AppleWebKit/536.26 (KHTML, like Gecko) ' 'Version/6.0 Mobile/10A5376e Safari/8536.25' )} HEADERS_CHROME = {'user-agent': ( 'Mozilla/5.0 (X11; Linux x86_64) ' 'AppleWebKit/537.36 (KHTML, l...
376
199
from ped_core import editor_common import io import pprint import os import curses import curses.ascii import time import re from ped_core import keymap from ped_core import keytab from ped_core import clipboard from ped_test_util import read_str, match_attr, undo_all, window_pos, play_macro, validate_mark, validate_sc...
7,167
2,682
from rsmtpd.response.action import OK from rsmtpd.response.base_response import BaseResponse class SmtpResponse501(BaseResponse): _smtp_code = 501 _message = "Syntax error in parameters or arguments" _action = OK
227
73
import datetime import re from django.contrib.sites.models import Site from django.core import mail from django.test import TestCase from django.urls import reverse from django.utils import timezone import numpy as np import pandas as pd import pytz from qatrack.qa.tests import utils from qatrack.qatrack_core.seriali...
14,116
5,605
from django.conf.urls import patterns, url from app.blog import views as blog_views urlpatterns = [ #django url url(r'^$', blog_views.index, name='blog_index'), ]
179
62
# -*- coding: utf-8 -*- from os import environ from typing import Optional, Dict, Any, Type def get_os_envs_dict() -> Dict[str, str]: return {k: str(environ.get(k)) for k in environ if environ} def exchange_env(key: str, exchange: Optional[str]) -> Optional[str]: result = environ.get(key) if result is ...
752
244
try: s = raw_input("Enter score between 0.0 and 1.0: ") score = float(s) if score < 0 or score > 1: raise Exception except ValueError: print "You didn't even enter a number" except: print "Not a possible score." else: if score >= 0.9: print "A" elif score >= 0.8: prin...
436
158
import pyttsx3 engine = pyttsx3.init() engine.setProperty('rate', 150) voices = engine.getProperty('voices') engine.setProperty("voice", 'english_rp+f4') def talk(text): engine.say(text) engine.runAndWait() talk("My name is robot leena")
254
101
import logging def initialize(app): level = logging.DEBUG if app.config.get('DEBUG') else logging.INFO app.logger.setLevel(level)
141
44
import tempfile from pathlib import Path import pytest from dug_helpers.dug_utils import FileFetcher, get_topmed_files, get_dbgap_files from roger.Config import config def test_fetch_network_file(): filename = "README.md" with tempfile.TemporaryDirectory() as tmp_dir: fetch1 = FileFetcher( ...
1,579
489
# coding: utf-8 # truepy # Copyright (C) 2014-2015 Moses Palmér # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # Th...
6,915
1,987
# -*- coding: utf-8 -*- from elasticsearch import Elasticsearch from datetime import timedelta import datetime import os import json import logging from configparser import ConfigParser # 生成日志文件 logging.basicConfig(filename='logging_es.log', level=logging.INFO, format='%(asctime)s - %(name)s - %(l...
3,679
1,351
__version__ = """1.8.4"""
25
13
from django.contrib import admin # general admin settings admin.site.site_header = 'Danesfield Admin' admin.site.site_title = 'Danesfield Admin'
146
44
#!/usr/bin/env python # encoding: utf-8 """ expfitting.py Provide single or double exponential fits to data. """ import lmfit import numpy as np import scipy.optimize class ExpFitting: """ Parameters ---------- nexp : int 1 or 2 for single or double exponential fit initpars : dict ...
2,645
954
# pylint: disable=no-member from datetime import datetime from typing import Optional, Dict from django.db import transaction, models from django.apps import apps from django_cloud_tasks import tasks, serializers class Pipeline(models.Model): name = models.CharField(max_length=100) def start(self): r...
4,338
1,340
from datetime import datetime from uuid import UUID from ...serializer import IfoodSerializable from ...utils import auto_str from uuid import UUID @auto_str class Consumer(IfoodSerializable): financial_occurrence: str payment_type: str @staticmethod def unserialize(dict=None): if dict is No...
2,913
848
# Importing section import json import requests import argparse import logging import time import datetime from classes.time_utils import TimeUtils import utilities as u # Main if __name__ == "__main__": arg_parser = argparse.ArgumentParser() arg_parser.add_argument('-c', help='config file') arg_parser.ad...
2,599
826
from spinnman.messages.scp.abstract_messages.abstract_scp_request\ import AbstractSCPRequest from spinnman.messages.sdp.sdp_flag import SDPFlag from spinnman.messages.sdp.sdp_header import SDPHeader from spinnman.messages.scp.scp_request_header import SCPRequestHeader from spinnman.messages.scp.scp_command import S...
1,603
482
from Cocoa import * from Quartz import * from SampleCIView import SampleCIView from math import sin import objc NUM_POINTS=4 class CIBevelView (SampleCIView): currentPoint = objc.ivar(type=objc._C_INT) points = objc.ivar() angleTime = objc.ivar(type=objc._C_FLT) lineIm...
4,506
1,455
from pathlib import Path from fhir.resources.codesystem import CodeSystem from oops_fhir.utils import CodeSystemConcept __all__ = ["RequestIntent"] _resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json")) class RequestIntent: """ RequestIntent Codes indicating the degree of authority/i...
4,226
971
def main(): # input S = list(input()) # compute for i,s in enumerate(S): if s == '6': S[i] = '9' elif s == '9': S[i] = '6' # output print(''.join(reversed(S))) if __name__ == '__main__': main()
266
104
class Solution(object): def rangeBitwiseAnd(self, m, n): """ :type m: int :type n: int :rtype: int """ ## my solution # res='' # for i in xrange(len(bin(m))-2): # if m>>i & 1 == 0: # res='0'+res # elif (...
652
217
from .app import create_app # creates the app by calling the package APP = create_app()
88
25
from flask_restplus import Api API = Api( title="Book API", version='1.0', description="This Api provides endpoint for accessing books and their reviews." )
170
47
import unittest from game import Game from suit import Suit class TestGame(unittest.TestCase): def test_setup(self): g = Game('tim', 'rick', 'bob', 'james', 'ballers', 'scrubs') self.assertEqual(len(g.players), 4) self.assertEqual(g.dealer, 0) self.assertEqual(g.trump, Suit.spades...
371
136
from PyConstants import Paths from PyConstants import Codes from PyConstants import CacheTimes from PyBaseTest import BaseTest from PyRequest import PyRequest import time class Authentication(BaseTest): password = "testPassword123" invalidPassword = "incorrectincorrect" def runTests(self): ...
4,250
1,171
from __future__ import unicode_literals from hypothesis.strategies import integers from star_ratings import app_settings def scores(max_rating=app_settings.STAR_RATINGS_RANGE): return integers(min_value=0, max_value=max_rating)
235
76
'''初始化''' from .Bird import Bird from .Pipe import Pipe
55
21
import os.path import configparser from dircheck import get_yesno_input import create_jobscripts from create_dirname_config import config_dirname_cfg from create_all_dirs import create_all import socket import cgns_load_data # Script that creates the two configuration files (case and render files) necessary to run the ...
6,824
2,122
#!/usr/bin/python import sys import simplejson as json def replicate_vertex(conf,pos, i): p = conf["VertexTypes"][pos]["columns"]["T{}-P1".format(pos+1)] for x in range(2, i+1): new_key = "T{}-P{}".format(pos+1, str(x)) conf["VertexTypes"][pos]["columns"][new_key] = p return conf def replicate_edge(conf, pos, ...
1,004
457
#!/usr/bin/env python2 import copy import random from classes.Pokemons import * from classes.Battle import * def fight(connection, canal, auteur, cmds, canalobj, mogbot): user = mogbot.getUserManager().findUser(auteur) if user == False: connection.privmsg(canal, auteur + " je ne te trouve pas dans la ...
1,602
500
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
3,356
909
from diem import chain_ids from liquidity import create_liquidity_provider, init_liquidity_provider from liquidity.liquidity import FaucetLiquidityProvider, DDLiquidityProvider CUSTODY_PRIVATE_KEYS = ( '{"liquidity":"c6537e56d844fa4a15f3bf5eacd41c9123a19ef19a1026f2325a6b2dd33a13f1"}' ) def test_faucet_liquidity...
1,396
573
from .l2norm import L2Norm from .multibox_loss import MultiBoxLoss __all__ = ['L2Norm', 'MultiBoxLoss']
112
44
import pymetry pym = pymetry pym.octagon(150, "yellow", 8)
59
30
""" Remote debugging support. This addon allows you to use a remote Python debugger with PyCharm, PyDev and possibly other IDEs. As it is, without modification, it only supports PyCharm, but it may work by pointing it at a similar egg file shipped with PyDev. Before using, point the addon to your pycharm-debug-py3k.e...
5,586
1,779
import datetime from django.contrib import messages from django.contrib.auth.decorators import login_required, user_passes_test from django.http import HttpResponse from django.shortcuts import render from .book_assign import send_email_reject_book from todo.forms import SearchForm from todo.models import Task, Book,...
2,247
669
import matplotlib.pyplot as plt # number of threads used to compute product of 2 matrices of dim. 1024 data_x = [1, 2, 3, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096] # execution time in seconds data_y = [3.300059, 1.664494, 2.294884, 3.200235, 2.915945, 3.082389, 3.023162, 3.012096, ...
610
336