content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
#texteditor.py
#Description: uses csv-format file 'dictionary' to make a series of replacements in 'oldfile' and create 'newfile'
#Execute as "python texteditor.py oldfile dictionary"
#Creates 'newfile'
#see also README.md
import os
#tells python to use the module 'os'
import sys
#tells python to use the module 'sys'... | [
2,
5239,
35352,
13,
9078,
198,
2,
11828,
25,
3544,
269,
21370,
12,
18982,
2393,
705,
67,
14188,
6,
284,
787,
257,
2168,
286,
36205,
287,
705,
727,
7753,
6,
290,
2251,
705,
3605,
7753,
6,
198,
2,
23002,
1133,
355,
366,
29412,
2420,... | 3.198745 | 956 |
# Import all external libraries
import json
import datetime
import time
import os
import io
import errno
from flask import Flask, render_template, send_file, request, session, redirect, render_template_string
from flask_socketio import SocketIO, emit, send
from threading import Thread, Lock
import resources
import sys... | [
2,
17267,
477,
7097,
12782,
198,
11748,
33918,
220,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
11454,
3919,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
3758,
62,
7753,
11,
2581... | 3.132834 | 2,138 |
# -*- coding: utf-8 -*-
"""CountsDistribution class."""
import json
import logging
from collections.abc import Mapping, MappingView
from types import GeneratorType
import numpy
import ndd.fnsb
from ndd.exceptions import NddError
logger = logging.getLogger(__name__)
def unique(nk, sort=True):
"""Return nk, zk""... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
12332,
82,
20344,
3890,
1398,
526,
15931,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
17268,
13,
39305,
1330,
337,
5912,
11,
337,
5912,
7680,
198,
6738,
3858,
... | 2.106549 | 1,023 |
import aiohttp
import asyncio
import base64
import os
from events import EventIn, EventOut, EventUpdate
from fastapi.logger import logger
from db import events, database
STRIPE_CHARGES_URL = os.getenv("STRIPE_CHARGES_URL")
STRIPE_API_KEY = os.getenv("STRIPE_API_KEY")
| [
11748,
257,
952,
4023,
198,
11748,
30351,
952,
198,
11748,
2779,
2414,
198,
11748,
28686,
198,
6738,
2995,
1330,
8558,
818,
11,
8558,
7975,
11,
8558,
10260,
198,
6738,
3049,
15042,
13,
6404,
1362,
1330,
49706,
198,
6738,
20613,
1330,
29... | 2.956044 | 91 |
# coding: utf-8
from fr.hayj.util.number import *;
from fr.hayj.util.duration import *;
import unittest
import re
# The level allow the unit test execution to choose only the top level test
unittestLevel = 1
if unittestLevel <= 1:
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
1216,
13,
71,
323,
73,
13,
22602,
13,
17618,
1330,
1635,
26,
198,
6738,
1216,
13,
71,
323,
73,
13,
22602,
13,
32257,
1330,
1635,
26,
198,
198,
11748,
555,
715,
395,
198,
11748,
302... | 2.659574 | 94 |
import os
from flask import Flask, send_from_directory, request, jsonify
# Path settings
SERVER_PATH = os.path.abspath(os.path.dirname(__file__))
FTP_PATH = os.path.abspath(os.path.join(SERVER_PATH, 'ftp/'))
# Flask app settings
app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
if __name__ == "__main__":... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
3758,
62,
6738,
62,
34945,
11,
2581,
11,
33918,
1958,
198,
198,
2,
10644,
6460,
198,
35009,
5959,
62,
34219,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
367... | 2.395349 | 172 |
# This file is empty | [
2,
770,
2393,
318,
6565
] | 4 | 5 |
"""Utilities for calculating directions and distances given coords."""
import math
EARTH_RADIUS = 6.3710088e6
def get_distance(fix1, fix2):
"""Calculates great-circle distance between two positions in meters."""
lat1 = math.radians(fix1.latitude)
lon1 = math.radians(fix1.longitude)
lat2 = math.radia... | [
37811,
18274,
2410,
329,
26019,
11678,
290,
18868,
1813,
763,
3669,
526,
15931,
198,
198,
11748,
10688,
198,
198,
17133,
4221,
62,
49,
2885,
40,
2937,
796,
718,
13,
2718,
3064,
3459,
68,
21,
628,
198,
4299,
651,
62,
30246,
7,
13049,
... | 2.248544 | 515 |
from iot_api import socketio | [
6738,
1312,
313,
62,
15042,
1330,
17802,
952
] | 3.5 | 8 |
from contextlib import contextmanager
import pickle
import numpy
import pandas
from ..base import Connection
| [
6738,
4732,
8019,
1330,
4732,
37153,
198,
11748,
2298,
293,
198,
198,
11748,
299,
32152,
198,
11748,
19798,
292,
198,
198,
6738,
11485,
8692,
1330,
26923,
628
] | 4.148148 | 27 |
from alphaorm.AlphaORM import AlphaORM,AlphaRecord
AlphaORM.setup('mysql', {
'host' : 'localhost',
'user' : 'root',
'password' : '',
'database' : 'alphaorm'
})
m = AlphaORM.create('python')
m.name = 'Alpha'
m.age = 10
AlphaORM.store(m) | [
6738,
17130,
579,
13,
38077,
1581,
44,
1330,
12995,
1581,
44,
11,
38077,
23739,
198,
198,
38077,
1581,
44,
13,
40406,
10786,
28744,
13976,
3256,
1391,
198,
197,
6,
4774,
6,
1058,
705,
36750,
3256,
198,
197,
6,
7220,
6,
1058,
705,
15... | 2.41 | 100 |
"""Data schema for a player's state."""
import collections
PlayerState = collections.namedtuple(
"PlayerState", [
# Dictionary of Gems held by player.
"gems",
# List of purchased DevelopmentCards.
"purchased_cards",
# List of reserved (non-hidden) DevelopmentCards.
"unhidden_reserved_cards... | [
37811,
6601,
32815,
329,
257,
2137,
338,
1181,
526,
15931,
198,
198,
11748,
17268,
198,
198,
14140,
9012,
796,
17268,
13,
13190,
83,
29291,
7,
198,
220,
366,
14140,
9012,
1600,
685,
198,
220,
220,
220,
1303,
28261,
286,
30196,
2714,
4... | 3.005747 | 174 |
from configparser import ConfigParser, NoOptionError
from typing import Dict # pylint: disable=unused-import
import os
from sheepdoge.exception import (
SheepdogeConfigurationAlreadyInitializedException,
SheepdogeConfigurationNotInitializedException,
)
DEFAULTS = {
"kennel_playbook_path": "kennel.yml",
... | [
6738,
4566,
48610,
1330,
17056,
46677,
11,
1400,
19722,
12331,
198,
6738,
19720,
1330,
360,
713,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
198,
11748,
28686,
198,
198,
6738,
15900,
4598,
469,
13,
1069,
4516,
1330,
... | 2.753012 | 166 |
from argparse import ArgumentParser
from USTCHelper import config
import json, base64
import os
| [
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
1294,
51,
3398,
417,
525,
1330,
4566,
198,
11748,
33918,
11,
2779,
2414,
198,
11748,
28686,
628
] | 3.88 | 25 |
from .abacus import Abacus
from .draw_pad import DrawPad
from .ledger import Ledger
__all__ = ('Abacus', 'DrawPad', 'Ledger')
| [
6738,
764,
397,
48628,
1330,
2275,
48628,
198,
6738,
764,
19334,
62,
15636,
1330,
15315,
26114,
198,
6738,
764,
992,
1362,
1330,
22964,
1362,
198,
198,
834,
439,
834,
796,
19203,
4826,
48628,
3256,
705,
25302,
26114,
3256,
705,
42416,
1... | 2.953488 | 43 |
import os
import sys
import argparse
from cuttsum.readers import gold_reader
from cuttsum.summarizers import RankSummarizer
if __name__ == '__main__':
main()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
6738,
2005,
912,
388,
13,
961,
364,
1330,
3869,
62,
46862,
198,
6738,
2005,
912,
388,
13,
16345,
3876,
11341,
1330,
10916,
13065,
3876,
7509,
198,
198,
361,
11593,
3672,
834... | 3.018519 | 54 |
"""
This file is property of the Ingram Micro Cloud Blue.
Copyright (c) 2019 Ingram Micro. All Rights Reserved.
"""
import json
from requests import api
from connect.logger import logger
from urllib.parse import urlencode, quote_plus
| [
37811,
198,
1212,
2393,
318,
3119,
286,
262,
44211,
4527,
10130,
4518,
13,
198,
15269,
357,
66,
8,
13130,
44211,
4527,
13,
1439,
6923,
33876,
13,
198,
37811,
198,
11748,
33918,
198,
6738,
7007,
1330,
40391,
198,
6738,
2018,
13,
6404,
... | 3.916667 | 60 |
import argparse
import csv
import re
# read arg (the num of shards, also the num of distributed nodes) from command line
parse_args()
node_tot = ARGS.node_tot
# read clustering result of the graph, and bind them to distributed nodes
# (ensure the total vertex to each node is as equal as possible)
## first, read ... | [
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
302,
628,
198,
2,
1100,
1822,
357,
1169,
997,
286,
39991,
11,
635,
262,
997,
286,
9387,
13760,
8,
422,
3141,
1627,
198,
198,
29572,
62,
22046,
3419,
198,
17440,
62,
83,
313,
79... | 2.586788 | 1,423 |
"""Ampio Systems Platform."""
import asyncio
import json
import logging
from typing import Any, Dict, Optional
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_DEVICE,
CONF_DEVICE_CLASS,
CONF_FRIENDLY_NAME,
CONF_IC... | [
37811,
32,
3149,
952,
11998,
19193,
526,
15931,
198,
11748,
30351,
952,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
32233,
198,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
56... | 2.058353 | 1,251 |
#!/usr/bin/env python
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.com>
#
# This file is part of Ansible,
#
# Ansible 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
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
357,
66,
8,
2321,
11,
16556,
569,
10094,
5826,
7718,
11650,
78,
1279,
3876,
1073,
31,
363,
1015,
68,
13,
785,
29,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
11... | 2.634927 | 2,531 |
l=[[1,2,3],[2,2,3],[3,3,3]]
print(l)
a=[2,3]
b=[4,5]
print(b) | [
75,
28,
30109,
16,
11,
17,
11,
18,
38430,
17,
11,
17,
11,
18,
38430,
18,
11,
18,
11,
18,
11907,
198,
4798,
7,
75,
8,
198,
64,
41888,
17,
11,
18,
60,
198,
65,
41888,
19,
11,
20,
60,
198,
4798,
7,
65,
8
] | 1.355556 | 45 |
"""
Representation of a recursive automaton
"""
from typing import AbstractSet
from pyformlang.finite_automaton.finite_automaton import to_symbol
from pyformlang.finite_automaton.symbol import Symbol
from pyformlang.regular_expression import Regex
from pyformlang.cfg import CFG, Epsilon
from pyformlang.rsa.box impor... | [
37811,
198,
40171,
341,
286,
257,
45115,
3557,
13951,
198,
37811,
198,
198,
6738,
19720,
1330,
27741,
7248,
198,
198,
6738,
12972,
687,
17204,
13,
69,
9504,
62,
2306,
296,
13951,
13,
69,
9504,
62,
2306,
296,
13951,
1330,
284,
62,
1837... | 2.660848 | 401 |
from bisect import bisect
import ColladaMaterial
# Named array of points.
#TODO: passing in the doc is like begging for trouble, pass in the needed elements instead.
| [
6738,
47457,
478,
1330,
47457,
478,
198,
11748,
7778,
4763,
17518,
198,
198,
2,
34441,
7177,
286,
2173,
13,
628,
198,
2,
51,
3727,
46,
25,
6427,
287,
262,
2205,
318,
588,
26732,
329,
5876,
11,
1208,
287,
262,
2622,
4847,
2427,
13,
... | 3.863636 | 44 |
import doctest
import unittest
from zope.site.folder import Folder
from zope.site.testing import siteSetUp, siteTearDown, checker
from zope.site.tests.test_site import TestSiteManagerContainer
def test_suite():
flags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE
return unittest.TestSuite((
... | [
198,
198,
11748,
10412,
395,
198,
11748,
555,
715,
395,
198,
198,
6738,
1976,
3008,
13,
15654,
13,
43551,
1330,
48107,
198,
6738,
1976,
3008,
13,
15654,
13,
33407,
1330,
2524,
7248,
4933,
11,
2524,
51,
451,
8048,
11,
2198,
263,
198,
... | 2.177049 | 305 |
# -*- coding: utf-8 -*-
from collections import deque, namedtuple
from functools import lru_cache
import funcy as fn
from lenses import lens, bind
import stl
class _Top(AST):
__slots__ = ()
class _Bot(AST):
__slots__ = ()
TOP = _Top()
BOT = _Bot()
def type_pred(*args):
ast_types =... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
17268,
1330,
390,
4188,
11,
3706,
83,
29291,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
198,
11748,
1257,
948,
355,
24714,
198,
6738,
18405,
1330... | 2.425414 | 181 |
# coding: utf-8
from __future__ import unicode_literals
import logging
from spacy.kb import KnowledgeBase
from train_descriptions import EntityEncoder
import wiki_io as io
logger = logging.getLogger(__name__)
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
18931,
198,
198,
6738,
599,
1590,
13,
32812,
1330,
20414,
14881,
198,
198,
6738,
4512,
62,
20147,
1968,
507,
1330,
20885... | 3.142857 | 70 |
from collections import deque, defaultdict
GRAY, BLACK = 0, 1
if __name__ == "__main__":
g = Graph(3)
g.addEdge(1, 2)
g.addEdge(1, 3)
print(g.topological())
| [
6738,
17268,
1330,
390,
4188,
11,
4277,
11600,
198,
198,
38,
30631,
11,
31963,
796,
657,
11,
352,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
308,
796,
29681,
7,
18,
8,
198,
220,
220... | 2.253165 | 79 |
import threaded_printer
| [
198,
11748,
40945,
62,
1050,
3849,
198
] | 3.571429 | 7 |
# -*- coding: utf-8 -*-
import os
from flask import Flask, request, abort, jsonify
import requests
SEND_API = 'https://graph.facebook.com/v2.6/me/messages'
WEBHOOK_VERIFY_TOKEN = os.environ['WEBHOOK_VERIFY_TOKEN']
PAGE_ACCESS_TOKEN = os.environ['PAGE_ACCESS_TOKEN']
APP_SECRET = os.environ['APP_SECRET']
app = Flask(__... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
15614,
11,
33918,
1958,
198,
11748,
7007,
198,
198,
50,
10619,
62,
17614,
796,
705,
5450,
1378,
34960,
13,
190... | 2.348101 | 158 |
"""Config flow for Midea Dehumidifier (Local) integration."""
from __future__ import annotations
import ipaddress
import logging
from typing import Any, Final
from homeassistant import data_entry_flow
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import (
CONF_API_VERSION,
CONF_... | [
37811,
16934,
5202,
329,
337,
485,
64,
1024,
17047,
312,
7483,
357,
14565,
8,
11812,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
20966,
21975,
198,
11748,
18931,
198,
6738,
19720,
1330,
4377,
11,
8125,
198,
1... | 2.380531 | 678 |
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
#######################################################################################################################
# DESCRIPTION:
#######################################################################################################################
# Solver for N-Que... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
29113,
29113,
29113,
14468,
4242,
21017,
198,
2,
22196,
40165,
25,
198,
29113,
29113,
29113,
14468,
4242,
21017,
198,
... | 5.329466 | 431 |
"""
Django settings for codango project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... | [
37811,
198,
35,
73,
14208,
6460,
329,
14873,
14208,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
352,
13,
23,
13,
18,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
54... | 2.48987 | 1,925 |
#
# PySNMP MIB module DGS1100-24P-MGMT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DGS1100-24P-MGMT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:30:19 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
360,
14313,
42060,
12,
1731,
47,
12,
20474,
13752,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
1... | 2.618159 | 804 |
from .metrics import _get_score_metric | [
6738,
764,
4164,
10466,
1330,
4808,
1136,
62,
26675,
62,
4164,
1173
] | 3.166667 | 12 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools,os
with open("README.md", "r") as fh:
long_description = fh.read()
thelibFolder = os.path.dirname(os.path.realpath(__file__))
requirementPath = thelibFolder + '/requirements.txt'
install_requires = [] # Examples: ["gunicorn", "docutils>=0.3", "lxml==0... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
900,
37623,
10141,
11,
418,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
... | 2.581818 | 440 |
import math
import sqlite3
import re
DATABASE_PATH = "line1.db"
| [
11748,
10688,
198,
11748,
44161,
578,
18,
198,
11748,
302,
198,
198,
35,
1404,
6242,
11159,
62,
34219,
796,
366,
1370,
16,
13,
9945,
1,
628
] | 2.538462 | 26 |
from logging import Logger
import paho.mqtt.client as mqtt
from ircodec.command import CommandSet
import os
from exceptions import CommandNotFound, \
CommandFileAccess
| [
6738,
18931,
1330,
5972,
1362,
198,
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
6738,
220,
1980,
375,
721,
13,
21812,
1330,
9455,
7248,
198,
198,
11748,
28686,
198,
198,
6738,
13269,
1330,
9455,
3673,
21077,... | 3.365385 | 52 |
inventory_var = "from_inventory"
hosts = ["host1"]
| [
24807,
62,
7785,
796,
366,
6738,
62,
24807,
1,
198,
198,
4774,
82,
796,
14631,
4774,
16,
8973,
198
] | 2.736842 | 19 |
import os
import datetime
from fitparse import *
import pandas as pd
import numpy as np
from tqdm import tqdm
from datetime import datetime
import re
# import matplotlib.pyplot as plt (not needed I guess)
directory = 'fitfiles' # may want to make this more flexible--ie: not just in the directory of the code...works ... | [
11748,
28686,
198,
11748,
4818,
8079,
198,
6738,
4197,
29572,
1330,
1635,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
4818,
8079,
1330,
4818,
8079... | 2.346556 | 1,815 |
from behave import fixture
| [
6738,
17438,
1330,
29220,
628,
628,
628,
628,
628
] | 4 | 9 |
#!/usr/bin/env python
r"""
Panflute filter supporting \textquote and \foreigntextquote in LaTeX
Issues:
- Nested parens with pandoc-citeproc
Usage:
- Use Pandoc markdown bracketed Spans:
- [Ganz Gallien ist von den Rmern besetzt]{.textquote cite="[vgl. @Goscinny_Asterix_1967, 1\psqq]"}
- [Toute la Gaul... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
81,
37811,
198,
15730,
2704,
1133,
8106,
6493,
3467,
5239,
22708,
290,
3467,
754,
16891,
2302,
22708,
287,
4689,
49568,
198,
198,
27738,
947,
25,
220,
198,
220,
220,
220,
532,
399,
728... | 2.455882 | 340 |
"""
Adds version number sequence id of a GFF file.
"""
import sys
ACC=sys.argv[1]
VER=sys.argv[2]
for line in sys.stdin:
line = line.strip()
elems = line.split()
if elems and elems[0] == ACC:
elems[0] = f'{elems[0]}.{VER}'
if line.startswith("#"):
print (line)
else:
print("\... | [
37811,
198,
46245,
2196,
1271,
8379,
4686,
286,
257,
402,
5777,
2393,
13,
198,
37811,
198,
11748,
25064,
198,
26861,
28,
17597,
13,
853,
85,
58,
16,
60,
198,
5959,
28,
17597,
13,
853,
85,
58,
17,
60,
198,
1640,
1627,
287,
25064,
1... | 2.080745 | 161 |
from .return_class import AbstractApiClass
from .refresh_schedule import RefreshSchedule
| [
6738,
764,
7783,
62,
4871,
1330,
27741,
32,
14415,
9487,
198,
6738,
764,
5420,
3447,
62,
15952,
5950,
1330,
22539,
27054,
5950,
628
] | 3.913043 | 23 |
import logging
import platform
import os
ROOT_DIR = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
DEFAULT_DEPS = os.path.join(ROOT_DIR, 'build', 'deps')
DEFAULT_OUT = os.path.join(ROOT_DIR, 'out')
logger = logging.getLogger(__name__)
# def disable_werror(env, warns):
# for w in warns:
# prepe... | [
11748,
18931,
198,
11748,
3859,
198,
11748,
28686,
198,
198,
13252,
2394,
62,
34720,
796,
28686,
13,
6978,
13,
5305,
6978,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
22305,
198,
7206,
38... | 2.335404 | 161 |
# -*- coding: utf-8 -*-
"""
table of content directive.
"""
import attr
from .base import Directive
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
11487,
286,
2695,
22644,
13,
198,
37811,
198,
198,
11748,
708,
81,
198,
6738,
764,
8692,
1330,
34736,
628
] | 2.861111 | 36 |
from flask import *
import databaseModel
from functools import wraps
import time
bp = Blueprint("StaffPage", __name__, url_prefix='/StaffPage')
| [
198,
6738,
42903,
1330,
1635,
198,
198,
11748,
6831,
17633,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
11748,
640,
198,
198,
46583,
796,
39932,
7203,
31449,
9876,
1600,
11593,
3672,
834,
11,
19016,
62,
40290,
11639,
14,
31449,
9876,
... | 3.422222 | 45 |
"""
Given the head to a singly linked list, where each node also has a random pointer
that points to anywhere in the linked list, deep clone the list.
"""
from typing import Tuple
def deep_clone_ll(ll_head: Node) -> Tuple[Node, Node]:
"""
Time Complexity: O(n)
Space Complexity: O(1)
"""
runner = ... | [
37811,
198,
15056,
262,
1182,
284,
257,
1702,
306,
6692,
1351,
11,
810,
1123,
10139,
635,
468,
257,
4738,
17562,
198,
5562,
2173,
284,
6609,
287,
262,
6692,
1351,
11,
2769,
17271,
262,
1351,
13,
198,
37811,
198,
6738,
19720,
1330,
309... | 2.462644 | 696 |
import tkinter as tk
from tkinter import ttk
raw_data_label_y_location = 20
raw_data_entry_location = raw_data_label_y_location + 20
encode_button_location = raw_data_entry_location + 20
decode_button_location = encode_button_location + 20
base64_data_label_y_location = decode_button_location + 20
base64_data_entry_y_... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
198,
198,
1831,
62,
7890,
62,
18242,
62,
88,
62,
24886,
796,
1160,
198,
1831,
62,
7890,
62,
13000,
62,
24886,
796,
8246,
62,
7890,
62,
18242,
62,
88,
... | 2.951613 | 124 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | [
2,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198... | 4.066667 | 195 |
import os
import sys
import json
from pathlib import Path
import pandas as pd
import random
import tensorflow as tf
import io
import argparse
from PIL import Image
from collections import namedtuple
from object_detection.utils import dataset_util, label_map_util
import logging
logging.basicConfig(strea... | [
11748,
28686,
201,
198,
11748,
25064,
201,
198,
11748,
33918,
201,
198,
6738,
3108,
8019,
1330,
10644,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
4738,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
33... | 2.076749 | 1,329 |
"""
Interface for interesting actions.
"""
from dataclasses import dataclass
import logging
from typing import Union, List, Optional, Iterable
from .call_hooks.win_api import constants as wc
logger = logging.getLogger(__name__)
| [
37811,
198,
39317,
329,
3499,
4028,
13,
198,
37811,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
18931,
198,
6738,
19720,
1330,
4479,
11,
7343,
11,
32233,
11,
40806,
540,
198,
6738,
764,
13345,
62,
25480,
82,
... | 3.302632 | 76 |
from __future__ import absolute_import, division, print_function
import sys
import tensorflow as tf
import tensorlayer as tl
import numpy as np
from tensorflow import convert_to_tensor as to_T
sess = tf.Session()
tl.layers.initialize_global_variables(sess)
# convnet built for shapes dataset
# following convnet are ... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
25064,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
29289,
355,
256,
75,
198,
11748,
299,
32152,
355,
45941,
198,
6738,... | 3.458333 | 120 |
"""
SUMMARY
Reinforcement learning via q-learning on the provided data, using previous data if requested
"""
import argparse
import json
import random
import sys
import matplotlib.pyplot as plt
import numpy as np
import auxiliary as aux
from vehicle import Vehicle
# Sets seed for reproducibility
random.seed(0)
... | [
37811,
198,
50,
5883,
44,
13153,
198,
198,
3041,
259,
13442,
4673,
2884,
10662,
12,
40684,
319,
262,
2810,
1366,
11,
1262,
2180,
1366,
611,
9167,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
4738,
198,
11748,... | 2.950228 | 2,632 |
from itertools import permutations
for i, p in enumerate(permutations([x for x in '0123456789'])):
if i == 10**6 - 1:
print ''.join(p)
break
| [
6738,
340,
861,
10141,
1330,
9943,
32855,
198,
198,
1640,
1312,
11,
279,
287,
27056,
378,
7,
16321,
32855,
26933,
87,
329,
2124,
287,
705,
486,
1954,
2231,
3134,
4531,
6,
12962,
2599,
198,
220,
220,
220,
611,
1312,
6624,
838,
1174,
... | 2.28169 | 71 |
# ---------------------------------------------------------
"""
This file is a part of the "SARK110 Antenna Vector Impedance Analyzer" software
MIT License
@author Copyright (c) 2020 Melchor Varela - EA4FRB
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and as... | [
2,
20368,
22369,
12,
198,
37811,
198,
220,
770,
2393,
318,
257,
636,
286,
262,
366,
50,
14175,
11442,
3738,
13713,
20650,
1846,
9124,
590,
16213,
9107,
1,
3788,
628,
220,
17168,
13789,
628,
220,
2488,
9800,
15069,
357,
66,
8,
12131,
... | 2.044682 | 4,118 |
#!/usr/bin/python
import sqlite3
path = '/Users/Utkarsh/PycharmProjects/SCILLA/Experiments/circuits.db'
def select_all_tasks(conn):
"""
Query all rows in the tasks table
:param conn: the Connection object
:return:
"""
cur = conn.cursor()
cur.execute("SELECT * FROM tasks")
rows = cur.... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
44161,
578,
18,
198,
198,
6978,
796,
31051,
14490,
14,
18274,
74,
5406,
14,
20519,
354,
1670,
16775,
82,
14,
6173,
8267,
32,
14,
20468,
6800,
14,
21170,
15379,
13,
9945,
6,
198,... | 2.363543 | 971 |
#
# @lc app=leetcode id=377 lang=python3
#
# [377] Combination Sum IV
#
# @lc code=start
from collections import defaultdict
# @lc code=end
| [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
26514,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
26514,
60,
14336,
1883,
5060,
8363,
198,
2,
198,
198,
2,
2488,
44601,
2438,
28,
9688,
198,
6738,
17268,
1330,
4277,
11600... | 2.666667 | 54 |
import argparse
import numpy as np
from paddle import fluid
if __name__ == "__main__":
main() | [
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
39517,
1330,
11711,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 3.060606 | 33 |
# Generated by Django 3.2.5 on 2021-08-23 04:17
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2919,
12,
1954,
8702,
25,
1558,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import paho.mqtt.client as paho
import time
import Queue as queue
import json
import real_time_manipulator_math_utils
import pprint
pp = pprint.PrettyPrinter(indent=4)
# import rbdl
# import manip motion
broker = "test.mosquitto.org"
topic = "fyp/sensors"
qos = 0
client = paho.Client("client_001")
client.on... | [
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
279,
17108,
220,
198,
11748,
640,
198,
11748,
4670,
518,
355,
16834,
198,
11748,
33918,
198,
11748,
1103,
62,
2435,
62,
805,
541,
8927,
62,
11018,
62,
26791,
198,
11748,
279,
4798,
... | 2.094896 | 1,391 |
import os
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core import serializers
from django.http import HttpResponse, JsonResponse, Http404
from django.shortcuts import render, get_object_or_404
from django.urls import reverse, reverse_lazy
from django.utils.dec... | [
11748,
28686,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
6738,
42625,
14208,
13,
7295,
1330,
11389,
11341,
198,
6738,
42625,
... | 3.514706 | 136 |
"""
The MIT License (MIT)
Copyright (c) 2013 Niko Skrypnik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | [
37811,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
2211,
11271,
78,
3661,
563,
79,
17187,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
378... | 3.365915 | 399 |
#!/usr/bin/python
#################################################################################
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Dmitry Sovetov
#
# https://github.com/dmsovetov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documen... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
29113,
29113,
14468,
2,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
45181,
311,
659,
83,
709,
198,
2,
198,
2,
3740,
1378,
12567,
13,
... | 2.772288 | 1,862 |
from core.tools.tool import Tool
from core.editor import Editor
| [
6738,
4755,
13,
31391,
13,
25981,
1330,
16984,
198,
6738,
4755,
13,
35352,
1330,
12058,
628
] | 4.0625 | 16 |
# Copyright (c) 2017 FlashX, LLC
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | [
2,
15069,
357,
66,
8,
2177,
9973,
55,
11,
11419,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340... | 3.546135 | 401 |
import logging
from pynder import errors
from random import randint
from PyQt5 import QtCore
| [
11748,
18931,
198,
6738,
12972,
681,
1330,
8563,
198,
6738,
4738,
1330,
43720,
600,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
628
] | 3.916667 | 24 |
import mindspore as ms
import mindspore.nn as nn
import mindspore.ops.operations as operator
import os
from lr_generator import get_lr
from CrossEntropy import CrossEntropy
import argparse
from inception_A import inception_A
from inception_B import inception_B
import numpy as np
from inception_C import inception_C
from... | [
11748,
2000,
2777,
382,
355,
13845,
198,
11748,
2000,
2777,
382,
13,
20471,
355,
299,
77,
198,
11748,
2000,
2777,
382,
13,
2840,
13,
3575,
602,
355,
10088,
198,
11748,
28686,
198,
6738,
300,
81,
62,
8612,
1352,
1330,
651,
62,
14050,
... | 2.573765 | 2,752 |
import datetime
from flask_bcrypt import *
from flask import current_app
from flask_sqlalchemy import SQLAlchemy
from flask_security import UserMixin, RoleMixin
db = SQLAlchemy()
roles_users = db.Table('roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
db.Column('role_id', db.Inte... | [
11748,
4818,
8079,
198,
198,
6738,
42903,
62,
15630,
6012,
1330,
1635,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
12961,
1330,
11787,
35608,
259,
11,
... | 2.896 | 125 |
from setuptools import setup, find_packages
from setuptools.command.install import install as _install
from setuptools.command.develop import develop as _develop
import os
long_description = ""
try:
from pypandoc import convert
long_description = convert("README.md", 'rst')
except ImportError:
long_des... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
900,
37623,
10141,
13,
21812,
13,
17350,
1330,
2721,
355,
4808,
17350,
198,
6738,
900,
37623,
10141,
13,
21812,
13,
16244,
1330,
1205,
355,
4808,
16244,
198,
11748,
28... | 2.37355 | 431 |
#!/usr/bin/env vpython
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
from google.protobuf import json_format as jsonpb
ROOT = os.path.dirname(os.path.dirname(__file__))
sys.path.a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
410,
29412,
198,
2,
15069,
13130,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,... | 2.871508 | 179 |
import argparse
import signal
import sys
import time
from concurrent.futures import ThreadPoolExecutor
from os import mkdir
from os.path import isdir
from urllib.parse import urlparse
import requests
from bs4 import BeautifulSoup
HEADERS = {
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0... | [
11748,
1822,
29572,
201,
198,
11748,
6737,
201,
198,
11748,
25064,
201,
198,
11748,
640,
201,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
201,
198,
6738,
28686,
1330,
33480,
15908,
201,
198,
6738,
28686,
13,
69... | 2.266833 | 802 |
from flask import jsonify
# redash __init__.py
# setup_authentication(app)
# login_manager.init_app(app)
from flask_login import login_required
from redash.handlers.api import api
from redash.handlers.base import routes
from redash.monitor import get_status
from redash.permissions import require_super_admin
# Handl... | [
6738,
42903,
1330,
33918,
1958,
198,
198,
2,
2266,
1077,
11593,
15003,
834,
13,
9078,
198,
2,
9058,
62,
41299,
3299,
7,
1324,
8,
198,
2,
17594,
62,
37153,
13,
15003,
62,
1324,
7,
1324,
8,
198,
6738,
42903,
62,
38235,
1330,
17594,
... | 2.923333 | 300 |
"""Main executable."""
import argparse
import asyncio
from tenff.game import GameSettings, run_game
from tenff.terminal import TerminalInputHandler
from tenff.util import CORPORA_PATH, get_corpus_path, parse_corpus
DEFAULT_TIME = 60
PROLOG = (
"A certain typing contest site spin-off in CLI, without all the "
... | [
37811,
13383,
28883,
526,
15931,
198,
11748,
1822,
29572,
198,
11748,
30351,
952,
198,
198,
6738,
3478,
487,
13,
6057,
1330,
3776,
26232,
11,
1057,
62,
6057,
198,
6738,
3478,
487,
13,
23705,
282,
1330,
24523,
20560,
25060,
198,
6738,
34... | 2.21582 | 1,024 |
"""76. Minimum Window Substring
https://leetcode.com/problems/minimum-window-substring/
Given a string S and a string T, find the minimum window in S which will
contain all the characters in T in complexity O(n).
Example:
Input: S = "ADOBECODEBANC", T = "ABC"
Output: "BANC"
Note:
If there is no such window in S that... | [
37811,
4304,
13,
26265,
26580,
3834,
8841,
198,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
39504,
12,
17497,
12,
7266,
8841,
14,
198,
198,
15056,
257,
4731,
311,
290,
257,
4731,
309,
11,
1064,
262,
5288,
4324,
287,
31... | 3.443662 | 142 |
from django.urls import path
from . import views
app_name = 'inventory'
urlpatterns = [
path('assettypes/',
views.AssetTypesIndexView.as_view(), name='index_assettypes'),
path('assettypes/create/',
views.AssetTypeCreateView.as_view(), name='create_assettype'),
path('assettypes/update/<in... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
24807,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
562,
316,
19199,
14,
3256,
198,
220,
220,
... | 2.463095 | 1,680 |
from distutils.core import setup
setup(name='a',
version='0.1.0',
packages=['a', 'a.security'],
install_requires=['WebOb>=1.6.1'],
author = "albert.zhang",
author_email = "longbao.zhang@gmail.com",
description = "This is a very light web framework",
license = "Apache License 2... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
3672,
11639,
64,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
13,
15,
3256,
198,
220,
220,
220,
220,
220,
10392,
28,
17816,
64,
3256,
705,
64,
13,
12961,... | 2.319149 | 141 |
print('====================================================================================================')
print('== 27. .')
print('====================================================================================================\n')
import numpy as np
x = np.array([0, 1])
w = np.array([0.5, 0.5])
print(np.su... | [
4798,
10786,
23926,
10052,
1421,
11537,
198,
4798,
10786,
855,
220,
2681,
13,
220,
220,
220,
764,
11537,
198,
4798,
10786,
23926,
10052,
1421,
59,
77,
11537,
198,
11748,
299,
32152,
355,
45941,
198,
87,
796,
45941,
13,
18747,
26933,
15,... | 3.84875 | 800 |
#author SANKALP SAXENA
import numpy
size = input().split(" ")
n = int(size[0])
l = []
for i in range(0, n):
a = input().split(" ")
l.append(a)
arr = numpy.array(l, int)
trans = arr.transpose()
print(trans)
print(arr.flatten())
| [
2,
9800,
311,
15154,
1847,
47,
14719,
55,
45510,
220,
220,
198,
198,
11748,
299,
32152,
198,
198,
7857,
796,
5128,
22446,
35312,
7203,
366,
8,
198,
77,
796,
493,
7,
7857,
58,
15,
12962,
198,
75,
796,
17635,
198,
1640,
1312,
287,
2... | 2.27619 | 105 |
from flask import Flask, app, jsonify, request, redirect, make_response
from leer_modelo import predecir
ALLOWED = ['png','jpg', 'jpeg', 'gif']
nombres_parametros = {
"imagen":"file1"
}
html = """
<!doctype html>
<form method="POST" enctype="multipart/form-data">
<label for="fname">Elija su imagen a evalua... | [
6738,
42903,
1330,
46947,
11,
598,
11,
33918,
1958,
11,
2581,
11,
18941,
11,
787,
62,
26209,
198,
6738,
443,
263,
62,
19849,
78,
1330,
14060,
343,
198,
198,
7036,
3913,
1961,
796,
37250,
11134,
41707,
9479,
3256,
705,
73,
22071,
3256,... | 2.413534 | 266 |
from interface import implements, Interface
from keras.models import load_model
| [
6738,
7071,
1330,
23986,
11,
26491,
198,
6738,
41927,
292,
13,
27530,
1330,
3440,
62,
19849,
628,
628
] | 4.611111 | 18 |
# https://s3.amazonaws.com/metcs777/flights.csv.bz2
# s3n://metcs777/flights.csv.bz2
# lines = sc.textFile("file:///home/kia/Data/Collected-Datasets/flight-delays/flight-delays/flights.csv")
lines = sc.textFile("s3://metcs777/flights.csv.bz2")
# Removing the Header Line from CSV file
linesHeader = lines.first()
he... | [
198,
2,
3740,
1378,
82,
18,
13,
33103,
8356,
13,
785,
14,
4164,
6359,
29331,
14,
2704,
2337,
13,
40664,
13,
65,
89,
17,
198,
2,
264,
18,
77,
1378,
4164,
6359,
29331,
14,
2704,
2337,
13,
40664,
13,
65,
89,
17,
198,
2,
3951,
796... | 2.877089 | 1,017 |
from setuptools import setup, find_packages
import sys, os
version = '0.0'
setup(name='rima',
version=version,
description="Minimalist Python REST API Framework",
long_description="""\
Minimalist Python REST API Framework
""",
classifiers=[
"Development Status :: 1 - Planning",... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
25064,
11,
28686,
198,
198,
9641,
796,
705,
15,
13,
15,
6,
198,
198,
40406,
7,
3672,
11639,
3036,
64,
3256,
198,
220,
220,
220,
220,
220,
2196,
28,
9641,
11,
19... | 2.419872 | 624 |
import csv
import io
import json
from pathlib import Path
from typing import Any, Iterable, List, Mapping, MutableMapping, Set, Tuple
import click
from sqlalchemy import and_
from sqlalchemy.orm import aliased, joinedload, with_polymorphic
from aspen.config.config import Config
from aspen.database.connection import (... | [
11748,
269,
21370,
198,
11748,
33245,
198,
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
40806,
540,
11,
7343,
11,
337,
5912,
11,
13859,
540,
44,
5912,
11,
5345,
11,
309,
29291,
198,
198,
11748,
3... | 2.37037 | 486 |
import cupy as cp
import numpy as np
| [
11748,
6508,
88,
355,
31396,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198
] | 2.388889 | 18 |
import numpy as np
from yaglm.linalg_utils import euclid_norm
def soft_thresh(vec, thresh_vals):
"""
The soft thresholding operator.
Parameters
----------
vec: array-like
The values to threshold
thresh_vals: float, array-like
The thresholding values
Output
-------
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
331,
363,
75,
76,
13,
75,
1292,
70,
62,
26791,
1330,
304,
36616,
312,
62,
27237,
628,
198,
4299,
2705,
62,
400,
3447,
7,
35138,
11,
294,
3447,
62,
12786,
2599,
198,
220,
220,
220,
37227,
1... | 2.319369 | 1,838 |
n, i, m, g, gg = 0, 0, 0, 0, 0
n = int(input())
if n > 1983:
while n > 1983:
n -= 60
m = n - 1923
else:
while n < 1983:
n += 60
m = n - 1983
g = (m // 12) + 1
gg = m % 12
result = ''
if g == 1:
result = ''
elif g == 2:
result = ''
elif g == 3:
result = ''
elif g ... | [
77,
11,
1312,
11,
285,
11,
308,
11,
308,
70,
796,
657,
11,
657,
11,
657,
11,
657,
11,
657,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
198,
361,
299,
1875,
13540,
25,
198,
220,
220,
220,
981,
299,
1875,
13540,
25,
198,
220,
... | 1.963054 | 406 |
#workflow
import sys
##python libraries
import argparse
import logging
import logging.config
##
## Internal libraries
from service.configuration import Configuration
from service.job import Job
from model.object import Object
from model.connection import ConnectionSettings
from model.workflow import *
if __name__ ==... | [
2,
1818,
11125,
198,
11748,
25064,
198,
2235,
29412,
12782,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
2235,
198,
2235,
18628,
12782,
198,
6738,
2139,
13,
11250,
3924,
1330,
28373,
198,
6738,
2139,
13,
... | 4.057471 | 87 |
# Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved
#
# 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 ap... | [
2,
15069,
357,
66,
8,
2864,
10130,
1958,
19193,
12052,
13,
1439,
2489,
10395,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
1... | 2.678383 | 569 |
import subprocess
import numpy
import os
import laspy
from osgeo import gdal
from plyfile import PlyData, PlyElement
import matplotlib.pyplot as plt
#from rpy2.robjects import r, pandas2ri, numpy2ri
from terrautils.formats import create_geotiff
from terrautils.spatial import scanalyzer_to_mac
def ply_to_array(inp, m... | [
11748,
850,
14681,
198,
11748,
299,
32152,
198,
11748,
28686,
198,
11748,
300,
5126,
88,
198,
6738,
28686,
469,
78,
1330,
308,
31748,
198,
6738,
35960,
7753,
1330,
36526,
6601,
11,
36526,
20180,
198,
11748,
2603,
29487,
8019,
13,
9078,
... | 2.012648 | 5,060 |
import random
from psycopg2 import connect
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
def random_database():
"""
Creates a random database in the testing Postgres instance and returns the
name of the database.
"""
# Setup connection with default credentials for testing.
with c... | [
11748,
4738,
198,
198,
6738,
17331,
22163,
70,
17,
1330,
2018,
198,
6738,
17331,
22163,
70,
17,
13,
2302,
5736,
1330,
3180,
3535,
6234,
62,
2538,
18697,
62,
39371,
4503,
2662,
36393,
628,
198,
4299,
4738,
62,
48806,
33529,
198,
220,
2... | 2.093633 | 534 |
#!/usr/bin/env python
# encoding: utf-8
"""
models.py
Created by mmiyaji on 2016-07-11.
Copyright (c) 2016 ruhenheim.org. All rights reserved.
"""
from __future__ import unicode_literals
import datetime, time, uuid
from django.db import models
from django.contrib.auth import models as auth_models
class Server(mode... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
27530,
13,
9078,
198,
198,
41972,
416,
8085,
7745,
26436,
319,
1584,
12,
2998,
12,
1157,
13,
198,
15269,
357,
66,
8,
1584,
220,
742... | 2.645191 | 2,142 |
import matplotlib.pyplot as p
from scipy import eye
import time
for x in xrange(3, 7):
p.imshow(eye(x))
p.show(block=False)
time.sleep(3)
print x
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
279,
198,
6738,
629,
541,
88,
1330,
4151,
198,
11748,
640,
198,
1640,
2124,
287,
2124,
9521,
7,
18,
11,
767,
2599,
198,
220,
220,
220,
279,
13,
320,
12860,
7,
25379,
7,
87,
4008,
198... | 2.25 | 72 |
#!/usr/bin/env python
from twython import Twython
import random
APP_KEY = 'APP KEY' # Customer Key here
APP_SECRET = 'APP SECRET' # Customer secret here
OAUTH_TOKEN = 'OAUTH TOKEN' # Access Token here
OAUTH_TOKEN_SECRET = 'OAUTH TOKEN SECRET' # Access Token Secret here
jobsnumber = random.randint(50, 100)
twitt... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
665,
7535,
1330,
1815,
7535,
198,
11748,
4738,
198,
198,
24805,
62,
20373,
796,
705,
24805,
35374,
6,
220,
1303,
22092,
7383,
994,
198,
24805,
62,
23683,
26087,
796,
705,
24... | 3.021622 | 185 |
import arrow
import attr
from attr import attrs, attrib
| [
11748,
15452,
198,
11748,
708,
81,
198,
198,
6738,
708,
81,
1330,
708,
3808,
11,
708,
822,
628,
628,
628
] | 3.1 | 20 |
import numpy as np
import base64
import pickle
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2779,
2414,
198,
11748,
2298,
293,
628,
198
] | 3.266667 | 15 |
import os
import click
from git import Repo
from absl import logging
from datetime import datetime
from collections import namedtuple
from typing import Tuple, Optional
from . import wandb_utils
logging.set_verbosity(logging.INFO)
ExperimentConfig = namedtuple(
"ExperimentConfig", (
"project_name",
... | [
11748,
28686,
198,
11748,
3904,
198,
6738,
17606,
1330,
1432,
78,
198,
6738,
2352,
75,
1330,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
19720,
1330,
309,
29291,
11,
32233,
198,
19... | 2.477333 | 375 |
''''''
import numpy as np
import pandas as pd
import datetime
#+
price = 2 + np.random.randn(21) + np.linspace(0,2,21)
#
date = [datetime.date(2020,12,x) for x in range(2,23)]
MDD_df = pd.DataFrame({'date':date,'price':price})
#1
MDD_df['return+1'] = MDD_df['price']/MDD_df['price'].shift(1)
MDD_df['cum_return'] = MDD_... | [
39115,
7061,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
198,
198,
2,
10,
198,
20888,
796,
362,
1343,
45941,
13,
25120,
13,
25192,
77,
7,
2481,
8,
1343,
45941,
13,
21602,
10223,
... | 2.004193 | 477 |
#!MF_PYTHONBIN
# Copyright (C) 2007 - 2009 The MITRE Corporation. See the toplevel
# file LICENSE for license terms.
import os, sys, glob, shutil
MAT_PKG_PYLIB = "MF_MAT_PKG_PYLIB"
sys.path.insert(0, MAT_PKG_PYLIB)
MAT_PKG_HOME = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import MAT
if len(sys.a... | [
2,
0,
49800,
62,
47,
56,
4221,
1340,
33,
1268,
198,
198,
2,
15069,
357,
34,
8,
4343,
532,
3717,
383,
17168,
2200,
10501,
13,
4091,
262,
284,
1154,
626,
198,
2,
2393,
38559,
24290,
329,
5964,
2846,
13,
628,
198,
11748,
28686,
11,
... | 1.991314 | 921 |
from abc import ABC, abstractmethod
if __name__ == '__main__':
mathOperators = MathOperation(Sum())
print(mathOperators.instance)
print(mathOperators.calculate(1, 2))
mathOperators.instance = Rest()
print(mathOperators.instance)
print(mathOperators.calculate(1, 2))
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
10688,
18843,
2024,
796,
16320,
32180,
7,
13065,
28955,
198,
220,
220,
220,
3601,
7,
11018,... | 2.740741 | 108 |
from Kiraro import bot
from discord.ext import commands
from discord.errors import *
from discord.utils import get
from Kiraro.Kiraro_Voice import idk, queue
import discord
import gtts
queue_list = {}
| [
6738,
7385,
12022,
1330,
10214,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36446,
13,
48277,
1330,
1635,
198,
6738,
36446,
13,
26791,
1330,
651,
198,
6738,
7385,
12022,
13,
42,
343,
12022,
62,
35708,
1330,
4686,
74,
11,
16834,
... | 3.54386 | 57 |