content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright 2015 Sean Vig
#
# 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, sof... | [
2,
15069,
1853,
11465,
569,
328,
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,
2,
921,
743,
... | 2.984334 | 383 |
import logging
from enum import Enum
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from sqlalchemy import Column, Integer, String, ForeignKey, Boolean, \
Enum as EnumType
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from frangiclave.compendium.base imp... | [
11748,
18931,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
4377,
11,
360,
713,
11,
7343,
11,
32233,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
10903,
11,
8708,
9218,
11,
41... | 3.341912 | 272 |
from __future__ import print_function
from django.db import transaction
from django.core.management.base import BaseCommand
from opencivicdata.divisions import Division as FileDivision
from ...models import Division
def to_db(fd):
""" convert a FileDivision to a Division """
args, _ = Division.subtypes_from... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
198,
6738,
1280,
66,
16482,
7890,
13,
7146,
3279,
1330,
... | 2.914474 | 152 |
igrok1 = 0
igrok2 = 0
win = 0
draw = 0
lose = 0
list_choises = ['Камень', 'Ножницы', 'Бумага']
print("(Камень - 1, Ножницы - 2, Бумага - 3) Игрок 1, введите ваш номер:")
igrok1 = int(input())
print("(Камень - 1, Ножницы - 2, Бумага - 3) Игрок 2, введите ваш номер:")
igrok2 = int(input())
# print("Игрок 1 выбрал номе... | [
328,
305,
74,
16,
796,
657,
198,
328,
305,
74,
17,
796,
657,
198,
5404,
796,
657,
198,
19334,
796,
657,
198,
75,
577,
796,
657,
198,
4868,
62,
6679,
2696,
796,
37250,
140,
248,
16142,
43108,
16843,
22177,
45367,
3256,
705,
140,
25... | 1.272506 | 411 |
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | [
2,
198,
2,
5231,
519,
877,
515,
416,
16283,
2135,
3082,
5329,
357,
15,
13,
1065,
13,
15,
8,
198,
2,
198,
2,
8410,
5626,
48483,
4725,
48481,
7013,
15986,
311,
11335,
14603,
7013,
35876,
25003,
7013,
15986,
8410,
2751,
198,
2,
198,
... | 2.45461 | 12,723 |
'''
Methods to be used during the streaming process.
'''
from datetime import datetime
INDEX = 17
SEGTYPE = 'ids event segments'
def create_dstream(ssc, zk_quorum, group_id, topics):
'''
Create an input stream that pulls ids event messages from Kafka.
:param ssc : :class:`pyspark.streamin... | [
7061,
6,
198,
220,
220,
220,
25458,
284,
307,
973,
1141,
262,
11305,
1429,
13,
198,
7061,
6,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
12115,
6369,
220,
220,
796,
1596,
198,
5188,
38,
25216,
796,
705,
2340,
1785,
17894... | 2.481892 | 1,353 |
#!/usr/bin/env python
#
# Copyright (c) 2012 SEOmoz
#
# 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, merg... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
66,
8,
2321,
30850,
5908,
89,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428,
37... | 2.371716 | 3,882 |
import os
import re
import argparse
import numpy as np
import matplotlib
matplotlib.use('Agg')
from matplotlib import rcParams
from matplotlib.colors import ListedColormap
import matplotlib.pyplot as pl
import seaborn as sns
import scanpy as sc
import pandas as pd
from scipy import sparse
import logging
import sys
... | [
11748,
28686,
198,
11748,
302,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
198,
6738,
2603,
29487,
8019,
1330,
48321,
10044,
4105,
... | 2.642784 | 1,940 |
#! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
Created on 23/09/2020 20:22
@Author: XinZhi Yao
"""
import logging
import threading
from logging import CRITICAL # NOQA
from logging import DEBUG # NOQA
from logging import ERROR # NOQA
from logging import FATAL # NOQA
from logging import INFO # N... | [
2,
0,
514,
81,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
2242,
14,
2931,
14,
42334,
1160,
25,
1828,
220,
201,
198,
31,
13838,
25,
2542... | 2.490099 | 606 |
from rest_framework import viewsets
from rest_framework import filters
from django_filters.rest_framework import DjangoFilterBackend
from .models import Voditeli, People, Dispetchery, Order
from .serializers import VoditeliSerializer, PeopleSerializer, DispetcherySerialzier, OrderSerializer
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
1330,
16628,
220,
198,
6738,
42625,
14208,
62,
10379,
1010,
13,
2118,
62,
30604,
1330,
37770,
22417,
7282,
437,
198,
198,
6738,
764,
27530,
1330,
569,
375,
270,
43733,... | 3.794872 | 78 |
import unittest
import json
from django.shortcuts import reverse
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework import status
from ..serializer import (CustomerSerializer, AgentSerializer,
PropertyOwnerSerializer, SupplierSerializer, DeveloperSerializer,
GovernmentSeri... | [
11748,
555,
715,
395,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
9575,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2149,
75,
1153,
198,
6738,... | 2.783069 | 756 |
import re
from typing import Union
| [
11748,
302,
198,
6738,
19720,
1330,
4479,
628,
628
] | 4.222222 | 9 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.sitemaps import CMSSitemap
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.staticfile... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
269,
907,
13,
82,
9186,
1686,
1330,
16477,
5432,
9... | 2.463415 | 615 |
import factom_core.blocks as blocks
from factom_core.blockchains import Blockchain
from factom_core.blockchains.mainnet.constants import MAINNET_NETWORK_ID
from factom_core.blockchains.mainnet.genesis import genesis_factoid_block_bytes
| [
11748,
1109,
296,
62,
7295,
13,
27372,
355,
7021,
198,
6738,
1109,
296,
62,
7295,
13,
9967,
38861,
1330,
29724,
198,
6738,
1109,
296,
62,
7295,
13,
9967,
38861,
13,
12417,
3262,
13,
9979,
1187,
1330,
8779,
1268,
12884,
62,
12884,
3324... | 3.434783 | 69 |
import json
from spacy.matcher import Matcher
from spacy.lang.es import Spanish
with open("exercises/es/adidas.json", encoding="utf8") as f:
TEXTS = json.loads(f.read())
nlp = Spanish()
matcher = Matcher(nlp.vocab)
# Dos tokens que en minúsculas encuentran "adidas" y "zx"
pattern1 = [{"LOWER": "adidas"}, {"LOWER... | [
11748,
33918,
198,
6738,
599,
1590,
13,
6759,
2044,
1330,
6550,
2044,
198,
6738,
599,
1590,
13,
17204,
13,
274,
1330,
7897,
198,
198,
4480,
1280,
7203,
1069,
2798,
2696,
14,
274,
14,
324,
24496,
13,
17752,
1600,
21004,
2625,
40477,
23... | 2.566265 | 249 |
# Allow
# from nxturtle import NXTurtle
# instead of
# from nxturtle.nxturtle import NXTurtle
from nxturtle import NXTurtle
| [
2,
22507,
201,
198,
2,
220,
220,
220,
220,
422,
299,
742,
17964,
1330,
43308,
17964,
201,
198,
2,
2427,
286,
201,
198,
2,
220,
220,
220,
220,
422,
299,
742,
17964,
13,
77,
742,
17964,
1330,
43308,
17964,
201,
198,
6738,
299,
742,
... | 2.74 | 50 |
import pytest
import requests
import os
from greent.services.ontology import GenericOntology
from greent.servicecontext import ServiceContext
@pytest.fixture(scope='module')
| [
11748,
12972,
9288,
198,
11748,
7007,
198,
11748,
28686,
198,
6738,
10536,
298,
13,
30416,
13,
756,
1435,
1330,
42044,
45984,
1435,
198,
6738,
10536,
298,
13,
15271,
22866,
1330,
4809,
21947,
198,
198,
31,
9078,
9288,
13,
69,
9602,
7,
... | 3.804348 | 46 |
import logging
import re
from io import BytesIO
import cloudpickle
import grpc
import pandas as pd
from ai_inspector import ModelInspector
from ai_inspector.io_utils import decompress
from eli5.lime import TextExplainer
from zstandard import ZstdDecompressor
from generated.ml_worker_pb2 import RunTestRequest, TestRes... | [
11748,
18931,
198,
11748,
302,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
198,
11748,
6279,
27729,
293,
198,
11748,
1036,
14751,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
257,
72,
62,
1040,
806,
273,
1330,
9104,
818,
4443,
... | 3.5 | 268 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.891892 | 37 |
import re
import datetime
import subprocess
optimal_solvers = [
'CBS',
'ICBS',
]
suboptimal_solvers = [
'PIBT',
'winPIBT',
'PushAndSwap',
'HCA',
'WHCA',
'RevisitPP',
'ECBS',
'PIBT_COMPLETE',
]
suboptimal_solvers_option = [
'', # PIBT
'', # winPIBT
'-c', # Pu... | [
11748,
302,
198,
11748,
4818,
8079,
198,
11748,
850,
14681,
198,
198,
8738,
4402,
62,
34453,
690,
796,
685,
198,
220,
220,
220,
705,
22923,
3256,
198,
220,
220,
220,
705,
2149,
4462,
3256,
198,
60,
198,
198,
7266,
8738,
4402,
62,
34... | 2.043757 | 937 |
"""
nets.py
Minor Programmeren, Programmeertheorie, Chips & Circuits
Misbaksels: Lisa Eindhoven, Sebastiaan van der Laan & Mik Schutte
This file holds nets with all data and functions essential to a good net.
"""
class Nets():
""" Class containing nets object used to fill a grid and
provide information on... | [
37811,
198,
45938,
13,
9078,
198,
198,
39825,
6118,
76,
14226,
11,
35232,
861,
258,
19257,
11,
45864,
1222,
7672,
15379,
198,
31281,
65,
461,
14002,
25,
15378,
412,
521,
8873,
574,
11,
22787,
544,
272,
5719,
4587,
4689,
272,
1222,
177... | 2.571429 | 448 |
import re
from typing import Any, Dict, List, Tuple
from pandas import DataFrame, Int64Dtype, merge, isna
from lib.cast import safe_int_cast
from lib.pipeline import DataPipeline, DefaultPipeline, PipelineChain
from lib.time import datetime_isoformat
from lib.utils import ROOT
| [
11748,
302,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
309,
29291,
198,
6738,
19798,
292,
1330,
6060,
19778,
11,
2558,
2414,
35,
4906,
11,
20121,
11,
2125,
64,
198,
6738,
9195,
13,
2701,
1330,
3338,
62,
600,
62,
2701,... | 3.361446 | 83 |
import logging
try:
from Queue import Empty
except:
from queue import Empty
from redis import StrictRedis
# import time
from time import time, sleep
from threading import Thread
# @modified 20190522 - Task #3034: Reduce multiprocessing Manager list usage
# Use Redis sets in place of Manager().list to reduce mem... | [
11748,
18931,
198,
28311,
25,
198,
220,
220,
220,
422,
4670,
518,
1330,
33523,
198,
16341,
25,
198,
220,
220,
220,
422,
16834,
1330,
33523,
198,
6738,
2266,
271,
1330,
520,
2012,
7738,
271,
198,
2,
1330,
640,
198,
6738,
640,
1330,
6... | 2.771639 | 1,086 |
import os
import shutil
# with open('file2.txt', 'a') as f:
# f.write('hello python')
# with open('file2.txt', 'w') as f:
# f.write('hello python 2')
# with open('file3.txt', 'x') as f:
# f.write('hello python 2')
# with open('file3.txt', 'r') as f:
# text = f.read()
# with open('file3.txt', 'w') as f:
# ... | [
11748,
28686,
198,
11748,
4423,
346,
198,
2,
351,
1280,
10786,
7753,
17,
13,
14116,
3256,
705,
64,
11537,
355,
277,
25,
198,
2,
220,
220,
277,
13,
13564,
10786,
31373,
21015,
11537,
628,
198,
2,
351,
1280,
10786,
7753,
17,
13,
14116... | 2.15304 | 477 |
from django import test
from django.core.exceptions import ValidationError
from dynamic_manipulation.models import ManipulationLog
from dynamic_rules.models import Rule
from dynamic_manipulation.tests.test_app.models import Sample
| [
6738,
42625,
14208,
1330,
1332,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
8925,
62,
805,
541,
1741,
13,
27530,
1330,
35045,
1741,
11187,
198,
6738,
8925,
62,
38785,
13,
27530,
1330,
14330,
... | 4 | 58 |
# -*- coding: UTF-8 -*-
'''
Created on 2018年10月14日
@author: zhguixin
'''
from rest_framework import serializers
from blog.models import Blog, Catagory, Tag
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
41972,
319,
2864,
33176,
112,
940,
17312,
230,
1415,
33768,
98,
198,
198,
31,
9800,
25,
1976,
71,
5162,
844,
259,
198,
7061,
6,
198,
6738,
1334,
62,
30604,
... | 2.532258 | 62 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from pathlib import Path
import re
import sys
import codecs
doccls = re.compile(r"\s*\\documentclass")
docbeg = re.compile(r"\s*\\begin\s*\{\s*document\s*\}")
title = re.compile(r"\s*\\(icml)?title\s*\{(?P<title>[^%}]*)")
aux = re.compile(r"(re... | [
2,
220,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
40481,
82,
198,
198,
15390,
565,
82,
796,
302,
13,
5589,... | 2.207756 | 361 |
#!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
with open('README.md') as readme_file:
readme = readme_file.read()
with open(path.join(here, 'requirements.txt')) as f:
requirements = f.read().split()
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
464,
9058,
4226,
526,
15931,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
28686,
1330,
3108,
628,
198,
1456,
796,
3108,
13,
397,
2777,
776... | 2.619369 | 444 |
from contrib.views import char_count
from django.contrib import admin
from django.urls import include, path, re_path
from django.views.generic import TemplateView
from rest_framework import routers
from contrib.views import ResourcesViewSet
router = routers.DefaultRouter()
router.register(r'resources', ResourcesViewS... | [
6738,
542,
822,
13,
33571,
1330,
1149,
62,
9127,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
11,
302,
62,
6978,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,... | 3.022099 | 181 |
# coding:utf-8
import random
import sys
import numpy as np
import time
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
from keras.utils import plot_model
from collections import deque
from keras import backend as K
import tensorflow as tf
from scipy import stats
impo... | [
2,
19617,
25,
40477,
12,
23,
198,
11748,
4738,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
360,
1072,
198,
673... | 2.115528 | 1,610 |
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
| [
6738,
3491,
565,
5819,
13,
565,
13654,
316,
929,
1330,
38279,
40786,
198,
6738,
3491,
565,
5819,
13,
6404,
1362,
1330,
2604,
198
] | 3.695652 | 23 |
'''import random
nome = random.choice(Luiza, Noah, Zelia, Paulo)
print(f'O aluno escolhido foi o: {nome})'''
from radom import choice
n1 = input('Primeiro aluno: ')
n2 = input('Segndo aluno: ')
n3 = input('Terceiro aluno: ')
n4 = input('Quarto aluno: ')
lista = [n1,n2,n3,n4]
print(f'O aluno escolhido foi {ch... | [
7061,
6,
11748,
4738,
201,
198,
77,
462,
796,
4738,
13,
25541,
7,
25596,
23638,
11,
18394,
11,
1168,
25418,
11,
34410,
8,
201,
198,
4798,
7,
69,
6,
46,
435,
36909,
3671,
349,
71,
17305,
11511,
72,
267,
25,
1391,
77,
462,
30072,
... | 2.168831 | 154 |
from JumpScale import j
j.application.start("osistest")
import JumpScale.grid.osis
# cl=j.core.osis.getOsisModelClass("test_complextype","project")
import time
client = j.core.osis.getClientByInstance('main')
json=client.getOsisSpecModel("system")
from generators.MongoEngineGenerator import *
gen=MongoEngineGene... | [
6738,
15903,
29990,
1330,
474,
198,
198,
73,
13,
31438,
13,
9688,
7203,
418,
396,
395,
4943,
198,
11748,
15903,
29990,
13,
25928,
13,
5958,
198,
198,
2,
537,
28,
73,
13,
7295,
13,
5958,
13,
1136,
46,
13429,
17633,
9487,
7203,
9288,
... | 2.947522 | 343 |
from zimwiki import *
links_pages = [r"C:\Users\robf\Documents\Working\Notebooks\DatabaseDocumentation\Data_Manager_3_DEV\Forms.txt",
r"C:\Users\robf\Documents\Working\Notebooks\DatabaseDocumentation\Data_Manager_3_DEV\Modules.txt",
r"C:\Users\robf\Documents\Working\Notebooks\DatabaseDocu... | [
6738,
1976,
320,
15466,
1330,
1635,
198,
198,
28751,
62,
31126,
796,
685,
81,
1,
34,
7479,
14490,
59,
305,
19881,
59,
38354,
59,
28516,
59,
6425,
12106,
59,
38105,
24941,
341,
59,
6601,
62,
13511,
62,
18,
62,
39345,
59,
8479,
82,
... | 2.446309 | 298 |
from sys import argv
from graph import makeGraph
limit, interval, exponent, y_intercept = float(argv[1]), float(argv[2]), float(argv[3]), float(argv[4])
y_coordinates, areas, j = [], [], 0
while True:
y_coordinates.append(j ** exponent + y_intercept)
if(j >= limit):
break
j += interval
for i in r... | [
6738,
25064,
1330,
1822,
85,
198,
6738,
4823,
1330,
787,
37065,
198,
198,
32374,
11,
16654,
11,
28622,
11,
331,
62,
3849,
984,
796,
12178,
7,
853,
85,
58,
16,
46570,
12178,
7,
853,
85,
58,
17,
46570,
12178,
7,
853,
85,
58,
18,
4... | 2.448413 | 252 |
import sys
import requests
import json
import express_cli
import globals
| [
11748,
25064,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
4911,
62,
44506,
198,
11748,
15095,
874,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
628
] | 3.035714 | 28 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | [
2,
28373,
2393,
329,
262,
45368,
28413,
10314,
27098,
13,
198,
2,
198,
2,
770,
2393,
691,
4909,
257,
6356,
286,
262,
749,
2219,
3689,
13,
1114,
257,
1336,
198,
2,
1351,
766,
262,
10314,
25,
198,
2,
3740,
1378,
2503,
13,
82,
746,
... | 3.129834 | 1,086 |
import pytest
from django.contrib.auth.models import User
from rest_framework.test import APIClient
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
201,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2149,
75,
1153,
201,
198,
201,
198,
201,
198,
31,
9078,
9288,
13,
69,
9602,
2... | 2.441176 | 68 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import platform
import six
import shlex
import subprocess
if six.PY2:
int = long
else:
int = int
IS_WIN = IS_LINUX = IS_OTHER_ARCH = False
arch = platform.system()
if arch == 'Windows':
IS_WIN = True
elif arch == 'Linux':
IS_LINUX = T... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
3859,
198,
11748,
2237,
198,
11748,
427,
2588,
198,
11748,
850,
14681,
198,
198,
361,
2... | 2.507042 | 142 |
import argparse
import logging
import os
import pandas as pd
import sys
import minst.logger
logger = logging.getLogger("collect_data")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"index_file",
metavar="index_file", type=str,
... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
25064,
198,
198,
11748,
949,
301,
13,
6404,
1362,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
33327,
62,
7890... | 2.541353 | 266 |
# -*- coding: utf-8 -*-
"""
Used to publish a list of companies to either build the timeline or start the searching the filings to classify.
"""
import argparse
import sys
import logging
import elasticsearch
from elasticsearch_dsl import Search
import pulsar
import json
import os
import socket
__author__ = "Phat Loc"... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
38052,
284,
7715,
257,
1351,
286,
2706,
284,
2035,
1382,
262,
15264,
393,
923,
262,
10342,
262,
28058,
284,
36509,
13,
198,
37811,
198,
198,
11748,
1822,
295... | 2.101399 | 2,288 |
# Author: Martin McBride
# Created: 2021-05-09
# Copyright (C) 2021, Martin McBride
# License: MIT
# Create a mandelbrot image using the Image factory function effect_mandelbrot.
# Save the image to file.
from PIL import Image
image = Image.effect_mandelbrot((520, 440), (-2, -1.1, 0.6, 1.1), 256)
image.save("mandel... | [
2,
6434,
25,
220,
5780,
1982,
47148,
198,
2,
15622,
25,
33448,
12,
2713,
12,
2931,
198,
2,
15069,
357,
34,
8,
33448,
11,
5780,
1982,
47148,
198,
2,
13789,
25,
17168,
198,
198,
2,
13610,
257,
6855,
417,
7957,
83,
2939,
1262,
262,
... | 2.844828 | 116 |
import random
from qutebrowser.config.configfiles import ConfigAPI
from qutebrowser.config.config import ConfigContainer
config = config
c = c
c.content.cookies.accept = 'no-3rdparty'
c.content.geolocation = 'ask'
c.content.headers.do_not_track = True
c.content.headers.referer = 'never'
c.content.headers.user_agent =... | [
11748,
4738,
198,
6738,
10662,
1133,
40259,
13,
11250,
13,
11250,
16624,
1330,
17056,
17614,
198,
6738,
10662,
1133,
40259,
13,
11250,
13,
11250,
1330,
17056,
29869,
198,
11250,
796,
4566,
198,
66,
796,
269,
628,
198,
66,
13,
11299,
13,... | 2.977929 | 589 |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
#import matplotlib.pyplot as plt
import emachine as EM
import itertools
np.random.seed(0)
#=========================================================================================
# data
s0 = np.loadtxt('../MNIST_data/mnist_test.csv',delimiter=',')
seq = s0[:,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
299,
32152,
355,
45941,
198,
2,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
795,
20480,
355,
17228,
198,
117... | 2.540943 | 1,612 |
import logging
from pathlib import Path
from dataclasses import dataclass
import pygame as pg
import chess.settings as s
from chess.utils.coords import Coords
from chess.utils.typewriter import Typewriter, TypewriterConfig
logger = logging.getLogger(Path(__file__).stem)
@dataclass
@dataclass
| [
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
11748,
12972,
6057,
355,
23241,
198,
198,
11748,
19780,
13,
33692,
355,
264,
198,
6738,
19780,
13,
26791,
13,
1073,
3669,
1... | 3.236559 | 93 |
import urllib.request
def parse_device_type(device_type):
"""
**Parse the the deviceType string**
Parses only the deviceType portion of the device type string
:param device_type: Full device type string
:return: Parsed device type
:rtype: str
"""
return device_t... | [
11748,
2956,
297,
571,
13,
25927,
628,
198,
4299,
21136,
62,
25202,
62,
4906,
7,
25202,
62,
4906,
2599,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
12429,
10044,
325,
262,
262,
3335,
6030,
4731,
1174,
628,
220... | 2.651961 | 816 |
# pylint: disable=no-member
import click
from datetime import datetime
from sqlalchemy import and_, text, Table
from sqlalchemy.sql import select
from getpass import getuser
from finance_manager.database import DB
from finance_manager.database.spec import f_set, finance, finance_instance, Base
from finance_manager.data... | [
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
19522,
198,
11748,
3904,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
44161,
282,
26599,
1330,
290,
62,
11,
2420,
11,
8655,
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
2922,
198,
... | 2.101351 | 2,072 |
from fastapi import APIRouter, Depends
from app.core.facade import WalletService
from app.core.http.exception import ApiException
from app.core.user.dto import UserRegisterRequest
from app.infra.fastapi.injectables import get_service
from app.infra.http.response import ResponseObject
user_api = APIRouter(tags=["user"... | [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
2129,
2412,
198,
198,
6738,
598,
13,
7295,
13,
38942,
671,
1330,
37249,
16177,
198,
6738,
598,
13,
7295,
13,
4023,
13,
1069,
4516,
1330,
5949,
72,
16922,
198,
6738,
598,
13,
7295,
13,
... | 3.211009 | 109 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.landing_page, name="landing_page"),
path('home/', views.main_page, name="main_page"),
path('usuario/', views.user_page, name="user_page"),
path('usuario/data/<str:mode>/', views.get_all_user_stats, name="all_user_stats"),
... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
1044,
278,
62,
7700,
11,
1438,
2625,
1044,
278,
62,
7700,
12340,
198,
22... | 2.615108 | 278 |
# -*- coding: utf-8 -*-
import logging
from time import time
from flare import html5, utils
from flare.forms import boneSelector, moduleWidgetSelector, displayDelegateSelector
from flare.network import NetworkService
from flare.config import conf
from flare.i18n import translate
from flare.forms.formatString import f... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
18931,
198,
198,
6738,
640,
1330,
640,
198,
198,
6738,
30239,
1330,
27711,
20,
11,
3384,
4487,
198,
6738,
30239,
13,
23914,
1330,
9970,
17563,
273,
11,
8265,
3830... | 3.046263 | 562 |
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | [
2,
15069,
1584,
383,
25824,
21183,
2059,
27684,
23123,
18643,
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,
13... | 3.956098 | 205 |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
import io
import os
import re
from setuptools import setup, find_packages
# This method was adapted from code in
# https://github.com/alb... | [
2,
15069,
357,
66,
8,
12131,
15127,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
770,
670,
318,
11971,
739,
262,
15127,
8090,
6127,
13789,
532,
8504,
12,
36313,
13,
6462,
198,
2,
2420,
460,
307,
1043,
287,
38559,
24290,
13,
9132,
198,
... | 3.047619 | 231 |
import argparse
import logging
import os
import socket
import sys
import numpy as np
import psutil
import setproctitle
import torch
# add the FedML root directory to the python path
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "../../../")))
from fedml_api.distributed.decentralized_framework.algorithm_... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
26692,
22602,
198,
11748,
900,
1676,
310,
2578,
198,
11748,
28034,
198,
2,
751,
262,
1016... | 2.531963 | 876 |
import os
import unittest
from unittest.mock import MagicMock, patch
from conjur.constants import DEFAULT_NETRC_FILE
from conjur.controller.logout_controller import LogoutController
from conjur.logic.credential_provider.credential_store_factory import CredentialStoreFactory
from conjur.data_object import ConjurrcData
... | [
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
11,
8529,
198,
198,
6738,
11644,
333,
13,
9979,
1187,
1330,
5550,
38865,
62,
12884,
7397,
62,
25664,
198,
6738,
11644,
333,
13,
365... | 3.265152 | 132 |
# Copyright (c) 2015-2020 by Rocky Bernstein
# Copyright (c) 2005 by Dan Pascu <dan@windowmaker.org>
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
# Copyright (c) 1999 John Aycock
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | [
2,
220,
15069,
357,
66,
8,
1853,
12,
42334,
416,
24534,
37584,
198,
2,
220,
15069,
357,
66,
8,
5075,
416,
6035,
350,
3372,
84,
1279,
25604,
31,
17497,
10297,
13,
2398,
29,
198,
2,
220,
15069,
357,
66,
8,
4751,
12,
16942,
416,
28... | 2.677195 | 4,021 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class MincStuffs(AutotoolsPackage, PythonPackage):
"""Various scripts for working wit... | [
2,
15069,
2211,
12,
1238,
2481,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.574803 | 381 |
from ClointFusion.ClointFusion import background
from ClointFusion.ClointFusion import timeit
from ClointFusion.ClointFusion import get_image_from_base64
from ClointFusion.ClointFusion import batch_file_path
from ClointFusion.ClointFusion import output_folder_path
from ClointFusion.ClointFusion import config_folder_pat... | [
6738,
1012,
1563,
37,
4241,
13,
2601,
1563,
37,
4241,
1330,
4469,
198,
6738,
1012,
1563,
37,
4241,
13,
2601,
1563,
37,
4241,
1330,
640,
270,
198,
6738,
1012,
1563,
37,
4241,
13,
2601,
1563,
37,
4241,
1330,
651,
62,
9060,
62,
6738,
... | 3.128798 | 2,205 |
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callback: apimon_profiler
type: aggregate
short_description: adds time s... | [
2,
22961,
3611,
5094,
13789,
410,
18,
13,
15,
10,
198,
2,
357,
3826,
27975,
45761,
393,
3740,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
70,
489,
12,
18,
13,
15,
13,
14116,
8,
198,
198,
2,
6889,
19617,
517,
21015,
18,
... | 2.352229 | 1,570 |
graph = {
'1': ['2', '3', '4'],
'2': ['5', '6'],
'5': ['9', '10'],
'4': ['7', '8', '11'],
'7': ['11', '12']
}
print bfs(graph, '1', '11')
# print bfs(graph, '1', '11')
# print bfs(graph, '1', '11')
# print bfs(graph, '1', '11')
# print bfs(graph, '1', '11')
| [
34960,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
16,
10354,
37250,
17,
3256,
705,
18,
3256,
705,
19,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
17,
10354,
37250,
20,
3256,
705,
21,
6,
4357,
198,
220,
220... | 1.754386 | 171 |
import numpy
import pandas
# How to make it work monthly?
# gen_payments need to be monthly instead of annual
# numpy.py in value() needs to use maturity/12
# does bootstrap need to be reworked?
# need to use the a2m to get a monthly yield
# what if we just create the bond with a "monthly" yield instead of annual?
# ... | [
11748,
299,
32152,
198,
11748,
19798,
292,
198,
198,
2,
1374,
284,
787,
340,
670,
9651,
30,
198,
2,
2429,
62,
15577,
902,
761,
284,
307,
9651,
2427,
286,
5079,
198,
2,
299,
32152,
13,
9078,
287,
1988,
3419,
2476,
284,
779,
24841,
... | 2.985965 | 285 |
#!/usr/bin/env python3
#
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import sys
prefix = os.path.abspath(os.path.dirname(__file__))
external = os.path.join(pre... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
15069,
1584,
12,
42334,
14780,
2351,
3115,
785,
48074,
9072,
357,
34,
6173,
50,
14,
20702,
43412,
8,
198,
2,
797,
19778,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
... | 2.522029 | 749 |
from django.conf import settings
from django.contrib import admin
from tomoko.repaint.models import Point
from tomoko.lib.inline import inline
admin.site.register(Point, PointAdmin)
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
16667,
16044,
13,
7856,
2913,
13,
27530,
1330,
6252,
198,
6738,
16667,
16044,
13,
8019,
13,
45145,
1330,
26098,
628,
198,
28482,
... | 3.607843 | 51 |
import os
import numpy as np
import torch
import shutil
import torchvision.transforms as transforms
from torch.autograd import Variable
import itertools
from genotypes import PRIMITIVES, LSTM_PRIMITIVES, Genotype, PRIV_PRIMITIVES
from graphviz import Digraph
from collections import defaultdict
# Written... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
4423,
346,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
340,
861,
10141,
198,
6738,... | 2.245586 | 623 |
import pandas as pd
import numpy as np
from src import datasets
import os
from PIL import Image
from torchvision import transforms
# for clf, | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12351,
1330,
40522,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
28034,
10178,
1330,
31408,
628,
198,
198,
2,
329,
537,
69,
11
] | 3.6 | 40 |
import networkx as nx
import os
import matplotlib.pyplot as plt
import sys
import numpy as np
sys.path.append('./')
from dynamicgem.graph_generation import SBM_graph
from dynamicgem.graph_generation import dynamic_SBM_graph
outdir = './data'
if __name__ == "__main__":
# length=5
# dynamic_sbm_series = ... | [
11748,
3127,
87,
355,
299,
87,
198,
11748,
28686,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
198,
17597,
13,
6978,
13,
33295,
7,
4458,
14,
11537,
198,
6738... | 1.759202 | 652 |
"""
This module implements 1d and 2d Monte Carlo integration
"""
import numpy as np
| [
37811,
198,
1212,
8265,
23986,
352,
67,
290,
362,
67,
22489,
40089,
11812,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 3.625 | 24 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.57586 | 6,479 |
import requests
from .config import GITHUB_ENDPOINT, GITHUB_TOKEN
| [
11748,
7007,
628,
198,
6738,
764,
11250,
1330,
402,
10554,
10526,
62,
1677,
6322,
46,
12394,
11,
402,
10554,
10526,
62,
10468,
43959,
628
] | 2.875 | 24 |
import re
| [
11748,
302,
198
] | 3.333333 | 3 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author : Santosh
# e-mail : kcraj2[AT]gmail[DOT]com
# Date created : 02 Apr 2021
# Last modified : 29 Jun 2021
"""
Select keywords from alignment that satisfy the given conditions
"""
import os
import sys
import argparse
from random import shuffle
import numpy as np
fr... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1772,
1058,
10844,
3768,
198,
2,
304,
12,
4529,
1058,
479,
66,
430,
73,
17,
58,
1404,
60,
14816,
58,
35,
... | 2.219596 | 2,919 |
# coding=utf-8
from abc import abstractmethod
from OTLMOW.OTLModel.Classes.AIMNaamObject import AIMNaamObject
from OTLMOW.GeometrieArtefact.GeenGeometrie import GeenGeometrie
# Generated with OTLClassCreator. To modify: extend, do not edit
class SoftwareToegang(AIMNaamObject, GeenGeometrie):
"""Een abstracte waar... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
450,
66,
1330,
12531,
24396,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,
13,
9487,
274,
13,
32,
3955,
26705,
321,
10267,
1330,
317,
3955,
26705,
321,
10267,
198,
6738,
440,
14990,
44... | 2.746667 | 225 |
import os
import shutil
import pickle as pkl
import argparse
import tensorflow as tf
import numpy as np
np.random.seed(4321)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from sklearn.preprocessing import MinMaxScaler
from .model_AVB import *
LATENT_S... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
2298,
293,
355,
279,
41582,
198,
11748,
1822,
29572,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
37659,
13,
25120,
13,
28826,
7,
3559,
2481,
8... | 2.601124 | 178 |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from past.utils import old_div
from . import geometry
import scipy
import scipy.linalg
from . import _beam
edges = scipy.array(([-1,-1],
[-1, 1],
... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
3170,
1040,
1330,
2837,
198,
6738,
1613,
13,
26791,
1330,
1468,
62,
7146,
198,
6738... | 2.124216 | 15,312 |
from flask_restful import Resource, reqparse
from flask import jsonify, request
from sunpower.database import db_session
from agents.models import Agent
parser = reqparse.RequestParser()
| [
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
43089,
29572,
198,
6738,
42903,
1330,
33918,
1958,
11,
2581,
198,
6738,
4252,
6477,
13,
48806,
1330,
20613,
62,
29891,
198,
6738,
6554,
13,
27530,
1330,
15906,
198,
48610,
796,
43089,
29572,
... | 4.177778 | 45 |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
11900,
29113,
29113,
7804,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
1853,
12,
5304,
3427,
16065,
354,
10599,
1313,
47532,
29118,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
... | 3.88806 | 402 |
import tensorflow as tf
with tf.GradientTape() as tape:
x = tf.Variable(tf.constant(3.0))
y = tf.pow(x, 2)
grad = tape.gradient(y, x)
print(grad)
| [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
4480,
48700,
13,
42731,
1153,
51,
1758,
3419,
355,
9154,
25,
201,
198,
220,
220,
220,
2124,
796,
48700,
13,
43015,
7,
27110,
13,
9979,
415,
7,
18,
13,
15,
4008,
201,
198,
2... | 2.103896 | 77 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
import logging
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from allauth.account.models import EmailAddress
import build.models
import InvenTree.helpers
import I... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
32465,
1330,
4280,
4402,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,... | 2.517148 | 1,108 |
#!/usr/bin/env python
"""
3a. Open the following two XML files: show_security_zones.xml and show_security_zones_single_trust.xml.
Use a generic function that accepts an argument "filename" to open and read a file.
Inside this function, use xmltodict to parse the contents of the file.
Your function should return the... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
18,
64,
13,
4946,
262,
1708,
734,
23735,
3696,
25,
905,
62,
12961,
62,
89,
1952,
13,
19875,
290,
905,
62,
12961,
62,
89,
1952,
62,
29762,
62,
38087,
13,
19875,
13,... | 3.03913 | 230 |
import aiohttp
from datetime import datetime
| [
11748,
257,
952,
4023,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198
] | 3.615385 | 13 |
n = int(input())
arr = list(map(int, input().rstrip().split()))
counter = [0] * 101
for e in arr:
counter[e] += 1
print(n - max(counter))
| [
77,
796,
493,
7,
15414,
28955,
201,
198,
201,
198,
3258,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
81,
36311,
22446,
35312,
3419,
4008,
201,
198,
201,
198,
24588,
796,
685,
15,
60,
1635,
8949,
201,
198,
201,
198,
1640,
304,
287... | 2.197183 | 71 |
"""This module contains the code to calculate infections by events."""
import pandas as pd
from sid.config import DTYPE_VIRUS_STRAIN
from sid.virus_strains import combine_first_factorized_infections
from sid.virus_strains import factorize_boolean_or_categorical_infections
def calculate_infections_by_events(states, pa... | [
37811,
1212,
8265,
4909,
262,
2438,
284,
15284,
16079,
416,
2995,
526,
15931,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
9785,
13,
11250,
1330,
360,
25216,
62,
53,
4663,
2937,
62,
2257,
3861,
1268,
198,
6738,
9785,
13,
85,
19397... | 2.692992 | 899 |
## This file is adapted from NNI project: https://github.com/microsoft/nni
'''
Evaluate pruning attack using auto-compress
'''
import argparse
import os
import json
import torch
from torchvision import datasets, transforms
import random
from nni.compression.torch import SimulatedAnnealingPruner
from nni.compression.to... | [
2235,
770,
2393,
318,
16573,
422,
399,
22125,
1628,
25,
3740,
1378,
12567,
13,
785,
14,
40485,
14,
77,
8461,
198,
7061,
6,
198,
36,
2100,
4985,
778,
46493,
1368,
1262,
8295,
12,
5589,
601,
198,
7061,
6,
198,
11748,
1822,
29572,
198,... | 2.457471 | 1,305 |
import random as rand
from web3 import Web3
import copy
import sys
from collections import defaultdict
ORBIT_MODE = False
if 'orbit' in sys.argv:
ORBIT_MODE = True
# whether to generate more blocks in shards 0 and 1 (makes ORBITs happen faster)
MORE_BLOCKS_IN = None #[0, 1, 3, 4] # create more blocks in these shar... | [
11748,
4738,
355,
43720,
198,
6738,
3992,
18,
1330,
5313,
18,
198,
11748,
4866,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
1581,
26094,
62,
49058,
796,
10352,
198,
361,
705,
42594,
6,
287,
25064,
13,
853,
85,
25... | 2.465753 | 1,095 |
import asyncio
import html
from datetime import datetime
import async_timeout
import discord
from discord.ext import commands
import custom_classes as cc
TRIVIA_URL = "https://opentdb.com/api.php?amount=5"
COLOURS = {'easy': rgb(255, 211, 0), 'medium': rgb(232, 97, 0), 'hard': rgb(255, 36, 0)}
EMOJIS = {1: '1\u20e... | [
11748,
30351,
952,
198,
11748,
27711,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
30351,
62,
48678,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
11748,
2183,
62,
37724,
355,
36624,
628,
198,
198,
54... | 2.200307 | 1,303 |
import pytest
from globus_sdk.authorizers import AccessTokenAuthorizer
TOKEN = "DUMMY_TOKEN"
@pytest.fixture
def test_get_authorization_header(authorizer):
"""
Get authorization header, confirms expected value
"""
assert authorizer.get_authorization_header() == "Bearer " + TOKEN
def test_handle_... | [
11748,
12972,
9288,
198,
198,
6738,
15095,
385,
62,
21282,
74,
13,
9800,
11341,
1330,
8798,
30642,
13838,
7509,
198,
198,
10468,
43959,
796,
366,
35,
5883,
26708,
62,
10468,
43959,
1,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
... | 3.216561 | 157 |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 23:57:01 2020
@author: Arnob
Changes:
! thresh 180 to 127
"""
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from skl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2758,
1478,
2242,
25,
3553,
25,
486,
12131,
198,
198,
31,
9800,
25,
16644,
672,
198,
198,
29238,
25,
198,
220,
220,
220,
5145,
294,
3447... | 3.159236 | 157 |
import unittest
from mumbling import mumble
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
285,
14739,
1330,
285,
10344,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.685714 | 35 |
# -*- coding: utf-8-*-
import logging
import signal
import platform
import time
import multiprocessing
import os
from assistant.plugins.utilities import paths
from assistant.notifier import Notifier
from assistant.brain import Brain
from vision.camera_loop import camera_loop
from vision.gray_resizing_loop import gra... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
12,
9,
12,
198,
11748,
18931,
198,
11748,
6737,
198,
11748,
3859,
198,
11748,
640,
198,
11748,
18540,
305,
919,
278,
198,
11748,
28686,
198,
198,
6738,
8796,
13,
37390,
13,
315,
2410,
13... | 3.304348 | 253 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198
] | 1.714286 | 14 |
import os
INPUTS = ["CLOUD_COVER", "DEWPOINT", "HEAT_INDEX", "TEMPERATURE", "WIND_CHILL",
"WIND_DIRECTION", "WIND_SPEED", "TOTAL_CAP_GEN_RES",
"TOTAL_CAP_LOAD_RES", "AVERAGE", "total_load", "DA_PRICE"]
OUTPUTS = ["response_var"]
DATE_TIME = "DateTime"
_DATA_FOLDER = "./data"
_TRAIN_DATA_FILE = "Tr... | [
11748,
28686,
198,
198,
1268,
30076,
50,
796,
14631,
5097,
2606,
35,
62,
8220,
5959,
1600,
366,
35,
6217,
16402,
12394,
1600,
366,
13909,
1404,
62,
12115,
6369,
1600,
366,
51,
3620,
18973,
40086,
1600,
366,
28929,
62,
3398,
8267,
1600,
... | 2.081169 | 308 |
import paho.mqtt.client as mqttClient
import mariadb
import decoder
import json
import os
import datetime
from threading import Event
# The Things Network MQQT broker credentials
broker_endpoint = os.getenv("BROKER_ADDRESS")
port = os.getenv("BROKER_PORT")
user = os.getenv("BROKER_USER")
password = os.getenv("BROKER_P... | [
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
11792,
198,
11748,
1667,
72,
324,
65,
198,
11748,
875,
12342,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
6738,
4704,
278,
1330,
8558,
198,
198,
... | 2.755556 | 720 |
"""
A feature store client. This module exposes an API for interacting with feature stores in Hopsworks.
It hides complexity and provides utility methods such as:
- `connect()`.
- `project_featurestore()`.
- `get_featuregroup()`.
- `get_feature()`.
- `get_features()`.
- `sql()`
- `get_featu... | [
37811,
198,
32,
3895,
3650,
5456,
13,
770,
8265,
32142,
281,
7824,
329,
24986,
351,
3895,
7000,
287,
9996,
2032,
3647,
13,
198,
1026,
30768,
13357,
290,
3769,
10361,
5050,
884,
355,
25,
628,
220,
220,
220,
532,
4600,
8443,
3419,
44646... | 2.401131 | 33,059 |
# -*- coding: utf-8 -*-
import pytest
from pytest_mock import MockerFixture
from green_eggs.api import TwitchApi
from tests.fixtures import * # noqa
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytes... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
6738,
12972,
9288,
62,
76,
735,
1330,
337,
12721,
37,
9602,
198,
198,
6738,
4077,
62,
33856,
82,
13,
15042,
1330,
23835,
32,
14415,
198,
6738,
... | 2.112023 | 1,705 |
"""
## network_firewall_enable_logging
What it does: Enable logging (Flow Logs or Alert) for a network firewall. The log destination type must be specified, the options are: S3, CloudWatchLogs, KinesisDataFirehose.
For S3 and CloudWatchLogs, the bot can create the log destination, by adding 'create' as a third paramete... | [
37811,
198,
2235,
3127,
62,
6495,
11930,
62,
21633,
62,
6404,
2667,
198,
2061,
340,
857,
25,
27882,
18931,
357,
37535,
5972,
82,
393,
23276,
8,
329,
257,
3127,
32928,
13,
383,
2604,
10965,
2099,
1276,
307,
7368,
11,
262,
3689,
389,
... | 3.234375 | 448 |
#!/usr/bin/env python3
if __name__ == '__main__':
definiteness = __import__('5-definiteness').definiteness
import numpy as np
mat1 = np.array([[5, 1], [1, 1]])
mat2 = np.array([[2, 4], [4, 8]])
mat3 = np.array([[-1, 1], [1, -1]])
mat4 = np.array([[-2, 4], [4, -9]])
mat5 = np.array([[1, 2],... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2730,
270,
9449,
796,
11593,
11748,
834,
10786,
20,
12,
4299,
15003,
9449,
27691,
4299,
15003,
94... | 2.025424 | 354 |
# -*- encoding: utf-8 -*-
"""
tests.core.test_reply module
Test endpoint and location reply messages
routes: /end/role and /loc/scheme
"""
import os
import pytest
from hio.help.hicting import Mict
from keri import kering
from keri.core import eventing, parsing, routing
from keri.core.coring import MtrDex, Salter
... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41989,
13,
7295,
13,
9288,
62,
47768,
8265,
198,
198,
14402,
36123,
290,
4067,
10971,
6218,
198,
81,
448,
274,
25,
1220,
437,
14,
18090,
290,
1220,
17946,
... | 1.728443 | 32,542 |
from flask import Blueprint, flash, g, request, jsonify
from flaskr.db import get_db
from werkzeug.security import check_password_hash, generate_password_hash
from sqlite3 import Error as SQLiteError
from jwt import DecodeError, encode as jwt_encode, decode as jwt_decode, ExpiredSignatureError
from functools import wra... | [
6738,
42903,
1330,
39932,
11,
7644,
11,
308,
11,
2581,
11,
33918,
1958,
198,
6738,
42903,
81,
13,
9945,
1330,
651,
62,
9945,
198,
6738,
266,
9587,
2736,
1018,
13,
12961,
1330,
2198,
62,
28712,
62,
17831,
11,
7716,
62,
28712,
62,
178... | 3.265403 | 211 |
# -*- coding: utf-8 -*-
"""
Tests for auth manager Basic configuration update proxy
From build dir, run from test directory:
LC_ALL=en_US.UTF-8 ctest -R PyQgsAuthManagerProxy -V
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
51,
3558,
329,
6284,
4706,
14392,
8398,
4296,
15741,
198,
198,
4863,
1382,
26672,
11,
1057,
422,
1332,
8619,
25,
198,
5639,
62,
7036,
28,
268,
62,
2937,
13... | 2.962567 | 374 |
from spacy.cli.download import download as spacy_download
from reqtagger import ReqTagger
import spacy
main() | [
6738,
599,
1590,
13,
44506,
13,
15002,
1330,
4321,
355,
599,
1590,
62,
15002,
198,
6738,
302,
39568,
7928,
1330,
797,
80,
51,
7928,
198,
11748,
599,
1590,
628,
198,
198,
12417,
3419
] | 3.393939 | 33 |
from zoopt.algos.opt_algorithms.racos.racos_common import RacosCommon
from zoopt.algos.opt_algorithms.racos.sracos import SRacos
from zoopt import Solution, Objective, Dimension, Parameter, Opt, ExpOpt
import numpy as np
def ackley(solution):
"""
Ackley function for continuous optimization
"""
x = sol... | [
6738,
40565,
8738,
13,
14016,
418,
13,
8738,
62,
282,
7727,
907,
13,
11510,
418,
13,
11510,
418,
62,
11321,
1330,
24746,
418,
17227,
198,
6738,
40565,
8738,
13,
14016,
418,
13,
8738,
62,
282,
7727,
907,
13,
11510,
418,
13,
82,
11510... | 2.413934 | 244 |