content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import sys
import os.path
import numpy as np
import matplotlib.colors as colors
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
from mpl_toolkits.axes_grid1 import make_axes_locatable
import swiftsimio_binder as swift
from losgeometry import LosGeometry
from unyt import hydrogen_mass, speed... | [
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
4033,
669,
355,
7577,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
80... | 2.590652 | 706 |
# Copyright (C) 2015-2021 Virgil Security, Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this li... | [
2,
15069,
357,
34,
8,
1853,
12,
1238,
2481,
16310,
37718,
4765,
11,
3457,
13,
198,
2,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
... | 2.471117 | 2,112 |
#!/usr/bin/python3
import argparse
import os
import subprocess
import serial as pyserial
import time
parser = argparse.ArgumentParser()
parser.add_argument("--bossac", help="Path to the bossa cli tool",
type=filepath, default=platformio_bossac())
parser.add_argument("--port", help="Se... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
11389,
355,
279,
893,
48499,
198,
11748,
640,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198... | 2.401709 | 585 |
# -*- coding: utf-8 -*-
import mysqlstmt
from .set_values_mixin import SetValuesMixin
class Insert(mysqlstmt.Stmt, SetValuesMixin):
"""INSERT statement.
Attributes:
ignore_error (bool): Include the IGNORE option in the INSERT statement.
Examples: ::
>>> q = Insert('t1')
>>> q.s... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
48761,
301,
16762,
198,
6738,
764,
2617,
62,
27160,
62,
19816,
259,
1330,
5345,
40161,
35608,
259,
628,
198,
4871,
35835,
7,
28744,
13976,
301,
16762,
13,
12... | 2.032226 | 4,996 |
import time
import gzip
import simplejson
users = processGenderAge()
for e in parse("Beeradvocate.txt.gz"):
try:
e['review/appearance'] = float(e['review/appearance'])
e['review/taste'] = float(e['review/taste'])
e['review/overall'] = float(e['review/overall'])
e['review/palate'] = float(e['review/p... | [
11748,
640,
198,
11748,
308,
13344,
198,
11748,
2829,
17752,
198,
198,
18417,
796,
1429,
41394,
23396,
3419,
198,
198,
1640,
304,
287,
21136,
7203,
49802,
32225,
13369,
13,
14116,
13,
34586,
1,
2599,
198,
220,
1949,
25,
198,
220,
220,
... | 2.408416 | 404 |
smtp_config = {
"host": "", # SMTP Server IP or hostname
"port": 587, # SMTP Server Port
"use_ssl": True, # Whether or not to use SSL to talk with the SMTP Server
"username": "", # If SMTP server requires authentication, the username to use
"password": "", # If SMTP server requires authentication,... | [
198,
5796,
34788,
62,
11250,
796,
1391,
198,
220,
220,
220,
366,
4774,
1298,
366,
1600,
1303,
9447,
7250,
9652,
6101,
393,
2583,
3672,
198,
220,
220,
220,
366,
634,
1298,
642,
5774,
11,
1303,
9447,
7250,
9652,
4347,
220,
198,
220,
2... | 2.897833 | 323 |
#- Import packages
import names
import random
'''
@module: Travel Dataset Generator
@authors: Leonardo Mauro <leomaurodesenv>
@link: https://github.com/Argo-Solutions/travel-dataset-generator GitHub
@license: Creative Commons BY License
@copyright: 2019 Argo Solutions
@access: public
'''
#- Functions
def funcUserGen... | [
2,
12,
17267,
10392,
198,
11748,
3891,
198,
11748,
4738,
198,
198,
7061,
6,
198,
31,
21412,
25,
13524,
16092,
292,
316,
35986,
198,
31,
41617,
25,
38083,
28931,
305,
1279,
293,
296,
559,
305,
8906,
24330,
29,
198,
31,
8726,
25,
3740... | 2.876471 | 340 |
from . import util
NETWORK_PROFILE_PROTOCOL_DHCP = 'dhcp'
NETWORK_PROFILE_PROTOCOL_STATIC = 'static'
class NetworkProfile:
"""
A NetworkProfile is a configuration section in OpenWRT's /etc/config/network file.
See: http://wiki.openwrt.org/doc/uci/network
"""
@property
@property
@prop... | [
198,
6738,
764,
1330,
7736,
198,
198,
12884,
33249,
62,
31190,
25664,
62,
4805,
2394,
4503,
3535,
62,
41473,
8697,
796,
705,
34985,
13155,
6,
198,
12884,
33249,
62,
31190,
25664,
62,
4805,
2394,
4503,
3535,
62,
35744,
2149,
796,
705,
... | 2.641791 | 134 |
"""mBuild conversion utilities."""
from warnings import warn
import numpy as np
def RB_to_OPLS(
c0,
c1,
c2,
c3,
c4,
c5,
error_tolerance=1e-4,
error_if_outside_tolerance=True,
):
r"""Convert Ryckaert-Bellemans type dihedrals to OPLS type.
.. math::
RB_{torsions} &= c_0 + c... | [
37811,
76,
15580,
11315,
20081,
526,
15931,
198,
6738,
14601,
1330,
9828,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
17986,
62,
1462,
62,
3185,
6561,
7,
198,
220,
220,
220,
269,
15,
11,
198,
220,
220,
220,
269,
16,
11,... | 2.119326 | 5,992 |
from rest_framework import serializers, status
from ..api_view_mixins import ExternalObjectAPIViewMixin
from ..generics import RetrieveAPIView
from .base import BaseAPITestCase
from .mixins import APIUserTestCaseMixin, TestAPIViewTestCaseMixin
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
11,
3722,
198,
198,
6738,
11485,
15042,
62,
1177,
62,
19816,
1040,
1330,
34579,
10267,
2969,
3824,
769,
35608,
259,
198,
6738,
11485,
8612,
873,
1330,
4990,
30227,
2969,
3824,
769,
198,
198,
67... | 3.478873 | 71 |
# Copyright 2016 The TensorFlow Authors. 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 appl... | [
2,
220,
15069,
1584,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2... | 3.5168 | 625 |
__version_info__ = (1, 8, 3)
__version__ = '.'.join(str(i) for i in __version_info__)
default_app_config = 'comments.apps.CommentsConfig' | [
834,
9641,
62,
10951,
834,
796,
357,
16,
11,
807,
11,
513,
8,
198,
834,
9641,
834,
796,
705,
2637,
13,
22179,
7,
2536,
7,
72,
8,
329,
1312,
287,
11593,
9641,
62,
10951,
834,
8,
198,
198,
12286,
62,
1324,
62,
11250,
796,
705,
1... | 2.653846 | 52 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core import serializers
import json, requests
from entidades.models import Entidad, Gauser_extra
from django.db.models import Q
def load_fichero_data_json(fichero, url=''):
"""
:param fichero: String. Texto con la ruta del fichero. E... | [
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,
6738,
42625,
14208,
13,
7295,
1330,
11389,
11341,
198,
11748,
33918,
11,
7007,
198,
6738,
920,
312,
... | 2.104839 | 1,364 |
import pandas as pd
import string
from nltk.corpus import stopwords
nltk_stopwords = stopwords.words("english")+["rt", "via","-»","--»","--","---","-->","<--","->","<-","«--","«","«-","»","«»"]
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
4731,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
77,
2528,
74,
62,
11338,
10879,
796,
2245,
10879,
13,
10879,
7203,
39126,
4943,
10,
14692,
17034,
1600,
366,
8869... | 2.506329 | 79 |
import os
from dotenv import load_dotenv
import boto3
load_dotenv()
_AWS_ACCESS_KEY = os.getenv('AWS_ACCESS_KEY')
_AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY')
_AWS_REGION_KEY = os.getenv('REGION_NAME')
_AWS_KVS_ROLE_ARN = os.getenv('AWS_KVS_ROLE_ARN')
_KINESISVIDEO_ARN = os.getenv('AWS_KINESISVIDEO_AR... | [
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
11748,
275,
2069,
18,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
62,
12298,
50,
62,
26861,
7597,
62,
20373,
796,
28686,
13,
1136,
24330,
10786,
12298,
50,
... | 1.806967 | 1,751 |
import sys
from mailpile.app import Main
if __name__ == "__main__":
main()
| [
11748,
25064,
198,
6738,
6920,
79,
576,
13,
1324,
1330,
8774,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.645161 | 31 |
import dash
import pandas as pd
import pandasql as ps
import json
import requests
# import dash_core_components as dcc
from dash import dcc
# import dash_html_components as html
from dash import html
from dash.dependencies import Input, Output, State
import plotly.express as px
from dash.exceptions import Pr... | [
11748,
14470,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
19798,
292,
13976,
355,
26692,
201,
198,
11748,
33918,
201,
198,
11748,
7007,
201,
198,
2,
1330,
14470,
62,
7295,
62,
5589,
3906,
355,
288,
535,
201,
198,
6738,... | 2.391791 | 804 |
import copy
from lto.accounts.ecdsa.account_factory_ecdsa import AccountFactoryECDSA
import base58
import pytest
from lto.transactions.anchor import Anchor
| [
11748,
4866,
198,
198,
6738,
300,
1462,
13,
23317,
82,
13,
721,
9310,
64,
13,
23317,
62,
69,
9548,
62,
721,
9310,
64,
1330,
10781,
22810,
27295,
4090,
198,
11748,
2779,
3365,
198,
11748,
12972,
9288,
198,
6738,
300,
1462,
13,
7645,
... | 3.16 | 50 |
#!/usr/bin/python
from __future__ import print_function, absolute_import
#Python Libraries
import subprocess, sys, os
from os import listdir
from os.path import isfile, join
import datetime
#Pymol API
from pymol import cmd
########################################
########### S T E R I M O L ############
############... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
198,
2,
37906,
46267,
198,
11748,
850,
14681,
11,
25064,
11,
28686,
198,
6738,
28686,
1330,
1351,
15908,
198,
6738,
28... | 3.311828 | 186 |
#kisa 자료실의 최신동향 크롤링
#정확도와 신뢰성이 있는 자료라서 크롤
from requests_html import HTMLSession
session = HTMLSession();
r = session.get('https://www.krcert.or.kr/data/trendView.do?bulletin_writing_sequence=35110')
tag_sel='body > div#wrap > div#contentWrap > div.widthWrap > div#contentDiv.contents > table.basicView > tbody > tr > t... | [
2,
74,
9160,
23821,
252,
238,
167,
96,
234,
168,
233,
97,
35975,
246,
23821,
113,
250,
168,
233,
254,
167,
237,
247,
169,
244,
98,
220,
169,
223,
105,
167,
94,
97,
167,
100,
223,
198,
2,
168,
254,
243,
169,
247,
243,
167,
237,... | 2.053521 | 355 |
# -*- coding: utf-8 -*-
import unittest.mock
import jsonpickle
from django.template.loader import render_to_string
from django.test import TestCase
from django.urls import reverse
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
13,
76,
735,
198,
198,
11748,
33918,
27729,
293,
198,
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
8543,
62,
1462,
62,
8841,
198,
6738,
42625,
... | 3 | 61 |
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description: Create CoSENT model for text matching task
"""
import math
import os
import pandas as pd
import torch
from loguru import logger
from torch.utils.data import DataLoader, Dataset
from tqdm.auto import tqdm, trange
from transformers.optimization ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
55,
84,
44,
278,
7,
87,
12595,
21,
1731,
31,
38227,
13,
785,
8,
198,
31,
11213,
25,
13610,
1766,
50,
3525,
2746,
329,
2420,
12336,
4876,
... | 2.9869 | 229 |
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks
from tint.storage.permanent import ObservableStorage
| [
6738,
19074,
13,
45994,
1330,
555,
715,
395,
198,
6738,
19074,
13,
37675,
13,
4299,
263,
1330,
26098,
14134,
10146,
198,
198,
6738,
34791,
13,
35350,
13,
525,
44172,
1330,
19243,
540,
31425,
628
] | 4.147059 | 34 |
"""
Many tests, high coverage, but a bit messy.
author: Deniss Stepanovs
"""
from time import sleep
import unittest
from botium import *
from botium.entities import *
from botium.signals import *
from botium.utils import *
from botium.ui import bot_ui
from botium.intents import *
from botium.bots import TestBot
from b... | [
37811,
198,
7085,
5254,
11,
1029,
5197,
11,
475,
257,
1643,
24097,
13,
198,
198,
9800,
25,
5601,
747,
5012,
272,
709,
82,
198,
37811,
198,
6738,
640,
1330,
3993,
198,
11748,
555,
715,
395,
198,
6738,
10214,
1505,
1330,
1635,
198,
67... | 3.011429 | 175 |
from .mobilenets import MobileNetFeatures
from .resnets import ResNetFeatures
from .squeezenets import SqueezeNetFeatures
| [
6738,
764,
76,
25898,
268,
1039,
1330,
12173,
7934,
23595,
198,
6738,
764,
411,
45938,
1330,
1874,
7934,
23595,
198,
6738,
764,
16485,
1453,
4801,
1039,
1330,
5056,
1453,
2736,
7934,
23595,
198
] | 3.69697 | 33 |
import pymongo
url = "127.0.0.1"
port = 27017
client = pymongo.MongoClient(host=url, port=port)
| [
11748,
279,
4948,
25162,
198,
198,
6371,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
198,
634,
796,
2681,
29326,
198,
16366,
796,
279,
4948,
25162,
13,
44,
25162,
11792,
7,
4774,
28,
6371,
11,
2493,
28,
634,
8,
628
] | 2.333333 | 42 |
import json
import os
import pytest
import subprocess as sp
from unittest.mock import call, MagicMock, patch, ANY
import yaml
from k8s_jobs import klib
@pytest.fixture(scope='function')
@pytest.mark.parametrize('time, expected_time', [
(None, None),
('', ''),
('35', '2100'),
])
@pytest.mark.param... | [
11748,
33918,
198,
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
850,
14681,
355,
599,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
869,
11,
6139,
44,
735,
11,
8529,
11,
15529,
198,
198,
11748,
331,
43695,
198,
198,
6738,
479,
... | 2.161558 | 1,207 |
import numpy as np
import xarray as xr
from numpy.testing import assert_array_almost_equal
from bioimageio.core import load_resource_description
from bioimageio.core.resource_io.nodes import Model
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2124,
18747,
355,
2124,
81,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
28177,
62,
40496,
198,
198,
6738,
13401,
9060,
952,
13,
7295,
1330,
3440,
62,
31092,
62,
11213,
198,
6... | 3.4 | 60 |
#1
print(CheckIfArrayIsSorted([1,3,4,9,6,878]))
print(CheckIfArrayIsSorted([1,3,4,6,8,9,3123,99]))
print(CheckIfArrayIsSorted([1,3,4,6,8,9,99]))
| [
2,
16,
198,
198,
4798,
7,
9787,
1532,
19182,
3792,
50,
9741,
26933,
16,
11,
18,
11,
19,
11,
24,
11,
21,
11,
23,
3695,
60,
4008,
198,
198,
4798,
7,
9787,
1532,
19182,
3792,
50,
9741,
26933,
16,
11,
18,
11,
19,
11,
21,
11,
23,... | 1.783133 | 83 |
import logging
from datetime import datetime
import redis
from src.challenges.challenge_event_bus import ChallengeEvent, ChallengeEventBus
from src.challenges.connect_verified_challenge import connect_verified_challenge_manager
from src.models import Block, User
from src.models.models import Challenge
from src.utils.c... | [
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
2266,
271,
198,
6738,
12351,
13,
36747,
34120,
13,
36747,
3540,
62,
15596,
62,
10885,
1330,
13879,
9237,
11,
13879,
9237,
16286,
198,
6738,
12351,
13,
36747,
34120,
... | 3.496403 | 139 |
import requests
import urllib
import json
import re
import os.path
import logging
import sys
import getopt
sessionId = ''
config = ''
# expects a function returning a list of all bugzilla tasks
# returns the same list of tasks formatted as:
# ((BZ_ID, BZ_TIMESTAMP), THE_BZ)
# expects a function returning a lis... | [
11748,
7007,
198,
11748,
2956,
297,
571,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
28686,
13,
6978,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
651,
8738,
198,
198,
29891,
7390,
796,
10148,
198,
11250,
796,
10148,
628,
628,
... | 2.311663 | 523 |
#!/usr/bin/env python
"""
This utility generates random data for the file crawler. We use a two level
hierarchy to prevent having too many files in a given directory.
"""
import sys
import os
from os.path import abspath, join, dirname, exists, expanduser, isdir
from optparse import OptionParser
from math import ceil
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
1212,
10361,
18616,
4738,
1366,
329,
262,
2393,
27784,
1754,
13,
775,
779,
257,
734,
1241,
198,
71,
959,
9282,
284,
2948,
1719,
1165,
867,
3696,
287,
257,
1813,
8619,
13,
... | 2.216883 | 770 |
#from http://jakascorner.com/blog/2016/08/omp-cancel.html
import numpy as np
| [
2,
6738,
2638,
1378,
73,
461,
3372,
273,
1008,
13,
785,
14,
14036,
14,
5304,
14,
2919,
14,
3361,
12,
66,
21130,
13,
6494,
198,
198,
11748,
299,
32152,
355,
45941,
198
] | 2.4375 | 32 |
import abc
import numpy as np
class Query(abc.ABC):
"""
ABC is an abstract base class to define an interface for all queries
"""
@abc.abstractmethod
| [
11748,
450,
66,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4871,
43301,
7,
39305,
13,
24694,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9738,
318,
281,
12531,
2779,
1398,
284,
8160,
281,
7071,
329,
477,
20743,
198,
220,
... | 3 | 56 |
# Copyright 2021 Sony Group Corporation
#
# 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 i... | [
2,
15069,
33448,
10184,
4912,
10501,
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,
7... | 2.423933 | 1,078 |
# vim: fdm=indent
# author: Fabio Zanini
# date: 02/08/17
# content: Support module for filenames related to pickle files.
# Modules
import pandas as pd
# Parser
| [
2,
43907,
25,
277,
36020,
28,
521,
298,
198,
2,
1772,
25,
220,
220,
220,
220,
14236,
952,
47022,
5362,
198,
2,
3128,
25,
220,
220,
220,
220,
220,
220,
7816,
14,
2919,
14,
1558,
198,
2,
2695,
25,
220,
220,
220,
7929,
8265,
329,
... | 2.492958 | 71 |
# in this class the top of the stack is at the END!
s = Stack()
print(s.isEmpty())
s.push(4)
s.push('dog')
print(s.peek())
s.push(True)
print(s.size())
print(s.isEmpty())
s.push(8.4)
print(s.pop())
print(s.pop())
print(s.size())
print(divideBy2(42))
| [
220,
220,
220,
1303,
287,
428,
1398,
262,
1353,
286,
262,
8931,
318,
379,
262,
23578,
0,
628,
198,
82,
796,
23881,
3419,
198,
198,
4798,
7,
82,
13,
271,
40613,
28955,
198,
82,
13,
14689,
7,
19,
8,
198,
82,
13,
14689,
10786,
9703... | 2.20339 | 118 |
from core import (identity_matrix, inverse, multiply_matrix, multiply_tuple,
transpose, tuple_4d)
if __name__ == "__main__":
main()
| [
6738,
4755,
1330,
357,
738,
414,
62,
6759,
8609,
11,
34062,
11,
29162,
62,
6759,
8609,
11,
29162,
62,
83,
29291,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1007,
3455,
11,
46545,
... | 2.308824 | 68 |
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import pickle
import random
import tensorflow as tf
from keras import backend as K
from keras.models import Sequential
from keras.layers import Activation, BatchNormalization
from keras.layers import... | [
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
5239,
1330,
29130,
7509,
198,
6738,
41927,
292,
13,
3866,
36948,
13,
43167,
1330,
14841,
62,
3107,
3007,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
11748,
111... | 2.448582 | 1,128 |
#!/usr/bin/env python3
# coding=utf-8
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
# import moxalib
from csv import reader
# Generate Root window
root = tk.Tk()
root.title('Moxa Configurator')
# root.geometry('1000x600')
# root.minsize(1920, 1080)
root.attribu... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
19617,
28,
40477,
12,
23,
201,
198,
201,
198,
11748,
256,
74,
3849,
355,
256,
74,
201,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
201,
198,
6738,
256,
74,
3849,
13,
... | 2.341019 | 824 |
#
# PySNMP MIB module TPLINK-SYSLOG-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPLINK-SYSLOG-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:18:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
309,
6489,
17248,
12,
23060,
8634,
7730,
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,
14,
14490,
... | 2.604421 | 2,624 |
# python_help.py : Python class to support the help patch for the [python] object.
# Import the callback module built in to the external.
import pdgui
# Define a class which can generate objects to be instantiated in Pd [python] objects.
# This would be created in Pd as [python demo_class DemoClass].
# The class... | [
2,
21015,
62,
16794,
13,
9078,
1058,
11361,
1398,
284,
1104,
262,
1037,
8529,
329,
262,
685,
29412,
60,
2134,
13,
198,
198,
2,
17267,
262,
23838,
8265,
3170,
287,
284,
262,
7097,
13,
198,
11748,
279,
67,
48317,
198,
198,
2,
2896,
... | 3.682203 | 236 |
# Author: Jack English (Skeleton provided by Professor Foley)
# CS 0451 Machine Learning, Practical 8
# April 1st, 2021
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction import DictVectorizer
import numpy as np
from scipy.spatial.distance import euclidean
from typing import List, Tup... | [
2,
6434,
25,
3619,
3594,
357,
50,
38800,
2810,
416,
8129,
35535,
8,
198,
2,
9429,
657,
36330,
10850,
18252,
11,
13672,
605,
807,
198,
2,
3035,
352,
301,
11,
33448,
198,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
... | 2.480256 | 2,659 |
#! /usr/bin/python
import sys
g_quote = "------------------------------------------------"
g_chicken = (
" \\\n"
" \\ /\\__/\\\n"
" \\ \\ /\n"
" | 0 >>\n"
" | |\n"
" |____|\n"
" ... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
25064,
198,
198,
70,
62,
22708,
796,
366,
47232,
1,
198,
70,
62,
354,
5973,
796,
357,
198,
197,
1,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.422131 | 488 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: tendermint/p2p/conn.proto, tendermint/p2p/pex.proto, tendermint/p2p/types.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
@data... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
4237,
25,
15403,
34289,
14,
79,
17,
79,
14,
37043,
13,
1676,
1462,
11,
15403,
34289,
14,
79,
17,
79,
14,
24900,
13,
1676,
1462,
11,
15403,
34289,
... | 2.636986 | 292 |
# coding: utf-8
class Solution:
"""
@param nums: A list of integers
@return: A list of integers includes the index of the first number
and the index of the last number
"""
# medium: http://lintcode.com/problem/subarray-sum-closest
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
4871,
28186,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2488,
17143,
997,
82,
25,
317,
1351,
286,
37014,
198,
220,
220,
220,
2488,
7783,
25,
317,
1351,
286,
37014,
3407,
262,
6376,... | 2.683673 | 98 |
from .keezer_server import app
| [
6738,
764,
365,
8471,
263,
62,
15388,
1330,
598,
198
] | 3.1 | 10 |
from django.views.generic.base import View
from django.http import HttpResponse
from django.contrib.gis.geos import Point
from json import dumps
from models import WorldBorder
| [
6738,
42625,
14208,
13,
33571,
13,
41357,
13,
8692,
1330,
3582,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
469,
418,
1330,
6252,
198,
6738,
33918,
1330,
45514,
... | 3.632653 | 49 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import numpy as np
from astropy import units as u
from astropy.table import Table
from ...hitran import Hitran
HITRAN_DATA = 'H2O.data'
| [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
6468,
28338,
1330,
4991,
355,
334,
198,
6738,
6468,
28338,
13,
... | 2.972603 | 73 |
#!/usr/bin/env python
import sys
import os.path
import os
import time
import pipes
import json
import mar_collection
mf_name = sys.argv[1]
main(mf_name)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
11748,
28686,
198,
198,
11748,
640,
198,
198,
11748,
19860,
198,
11748,
33918,
198,
198,
11748,
1667,
62,
43681,
628,
198,
198,
76,
... | 2.612903 | 62 |
import asyncio
import sys
from threading import Event
from unittest.mock import Mock
import pytest
from sanic.exceptions import SanicException
from sanic.response import text
@pytest.mark.skipif(sys.version_info < (3, 8), reason="Not supported in 3.7")
@pytest.mark.skipif(sys.version_info < (3, 8), reason="No... | [
11748,
30351,
952,
198,
11748,
25064,
198,
198,
6738,
4704,
278,
1330,
8558,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
5336,
291,
13,
1069,
11755,
1330,
2986,
291,
16922,
198,
67... | 3.017699 | 113 |
import kivy
kivy.require('1.10.0')
from radiobox import HoverBehavior
kivy.factory.Factory.register('HoverBehavior', HoverBehavior)
from radiobox import RadioBoxApp
if __name__ == "__main__":
RadioBoxApp().run()
| [
11748,
479,
452,
88,
198,
74,
452,
88,
13,
46115,
10786,
16,
13,
940,
13,
15,
11537,
198,
198,
6738,
19772,
672,
1140,
1330,
38452,
25267,
15759,
198,
74,
452,
88,
13,
69,
9548,
13,
22810,
13,
30238,
10786,
39,
2502,
25267,
15759,
... | 2.725 | 80 |
import select
res = select.select([0], [], [], 1.1)
print(res)
| [
11748,
2922,
628,
198,
411,
796,
2922,
13,
19738,
26933,
15,
4357,
685,
4357,
685,
4357,
352,
13,
16,
8,
198,
4798,
7,
411,
8,
198
] | 2.5 | 26 |
import copy
import base64
import datetime
import hashlib
import itertools
import json
import logging
import os
import queue
import threading
import time
from collections import Counter, defaultdict
from statistics import mean, median
from typing import Callable, Dict
import cv2
import matplotlib.pyplot as plt
import n... | [
11748,
4866,
198,
11748,
2779,
2414,
198,
11748,
4818,
8079,
198,
11748,
12234,
8019,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
16834,
198,
11748,
4704,
278,
198,
11748,
640,
198,
67... | 3.040956 | 293 |
'''
Uses Runge Kutta Fehlberg 7(8) numerical integration method to compute the state vector in
a time interval tf
'''
from math import *
from decimal import *
import numpy as np
np.set_printoptions(precision=16)
def ypol_a(y):
'''
Computes velocity and acceleration values by using the state vector y and kepl... | [
7061,
6,
198,
5842,
274,
5660,
469,
40323,
8326,
5452,
18519,
3900,
767,
7,
23,
8,
29052,
11812,
2446,
284,
24061,
262,
1181,
15879,
287,
198,
64,
640,
16654,
48700,
198,
7061,
6,
198,
198,
6738,
10688,
1330,
1635,
198,
6738,
32465,
... | 1.77883 | 2,957 |
"""
Secure - file ``/var/log/secure``
==================================
"""
from .. import Syslog, parser
from insights.specs import Specs
@parser(Specs.secure)
class Secure(Syslog):
"""Class for parsing the ``/var/log/secure`` file.
Sample log text::
Aug 24 09:31:39 localhost polkitd[822]: Finish... | [
37811,
198,
49793,
532,
220,
2393,
7559,
14,
7785,
14,
6404,
14,
22390,
15506,
198,
10052,
855,
198,
37811,
198,
6738,
11485,
1330,
311,
893,
6404,
11,
30751,
198,
6738,
17218,
13,
4125,
6359,
1330,
2531,
6359,
628,
198,
31,
48610,
7,... | 2.531148 | 610 |
from django.contrib import admin
from src.base.models import User, Task, TaskAttempt, Level, Test, TestAttempt
admin.site.register(User)
admin.site.register(Task)
admin.site.register(TaskAttempt)
admin.site.register(Level)
admin.site.register(Test)
admin.site.register(TestAttempt)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
12351,
13,
8692,
13,
27530,
1330,
11787,
11,
15941,
11,
15941,
37177,
11,
5684,
11,
6208,
11,
6208,
37177,
198,
198,
28482,
13,
15654,
13,
30238,
7,
12982,
8,
198,
28482,
13,
... | 3.252874 | 87 |
"""
Tests for the course indexer
"""
from datetime import datetime
from unittest import mock
from django.test import TestCase
import pytz
from cms.api import add_plugin
from richie.apps.core.helpers import create_i18n_page
from richie.apps.courses.cms_plugins import CategoryPlugin
from richie.apps.courses.defaults i... | [
37811,
198,
51,
3558,
329,
262,
1781,
6376,
263,
198,
37811,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
11748,
12972,
22877,
198,
... | 2.02722 | 18,626 |
from unittest.mock import patch, call
import pytest
from baserow.contrib.database.table.cache import (
invalidate_table_model_cache_and_related_models,
generated_models_cache,
)
@pytest.mark.django_db
@pytest.mark.django_db
@patch("baserow.contrib.database.table.cache.generated_models_cache")
@pytest.mar... | [
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
11,
869,
198,
198,
11748,
12972,
9288,
198,
6738,
1615,
263,
322,
13,
3642,
822,
13,
48806,
13,
11487,
13,
23870,
1330,
357,
198,
220,
220,
220,
12515,
378,
62,
11487,
62,
19849,
62,
2... | 2.526316 | 171 |
import os
import glob
import logging
import pandas as pd
from pymongo import MongoClient
from typing import Any, Dict, List, Text
from tfx import types
from tfx.components.base import base_component
from tfx.components.base import executor_spec
from tfx.components.base import base_executor
from tfx.types import st... | [
11748,
28686,
198,
11748,
15095,
198,
11748,
18931,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
8255,
198,
198,
6738,
256,
... | 3.418182 | 165 |
"""
automatically maintains the latest git tag + revision info in a python file
"""
import imp
import os
import subprocess
if __name__ == "__main__":
import sys
get_project_version(sys.argv[1])
| [
37811,
198,
2306,
296,
4142,
16047,
262,
3452,
17606,
7621,
1343,
18440,
7508,
287,
257,
21015,
2393,
198,
198,
37811,
198,
198,
11748,
848,
198,
11748,
28686,
198,
11748,
850,
14681,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834... | 3.044118 | 68 |
"""
This submodule contains basic classes related to the feature store.
The feature store is the SDK component that holds the last known state of all feature flags, as
received from LaunchDarkly. This submodule does not include specific integrations with external
storage systems; those are in :class:`ldclient.integrat... | [
37811,
198,
1212,
850,
21412,
4909,
4096,
6097,
3519,
284,
262,
3895,
3650,
13,
198,
198,
464,
3895,
3650,
318,
262,
26144,
7515,
326,
6622,
262,
938,
1900,
1181,
286,
477,
3895,
9701,
11,
355,
198,
47844,
422,
21225,
17367,
306,
13,
... | 2.423716 | 2,589 |
import unittest
from typing import Dict, Optional, Any
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
4377,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.789474 | 38 |
from djitellopy import Tello
tello = Tello()
tello.connect()
# 연결
tello.takeoff()
# 이륙
tello.move_up(50) # 안전을 위해 50cm업
tello.move_forward(55) # 전진명령(cm)
# tello.move_forward(55)
tello.rotate_clockwise(360) # 시계방향으로 회전(degree)
tello.move_back(55) # 후진명령(cm)
# tello.move_back(55)
tello.land()
# 착륙
pass | [
6738,
42625,
578,
297,
11081,
1330,
309,
11109,
198,
198,
660,
18798,
796,
309,
11109,
3419,
198,
198,
660,
18798,
13,
8443,
3419,
198,
2,
23821,
245,
108,
166,
110,
108,
198,
660,
18798,
13,
20657,
2364,
3419,
198,
2,
23821,
251,
1... | 1.461905 | 210 |
from logging import getLogger
from typing import List, Tuple, Optional
from beamngpy import BeamNGpy
from drivebuildclient import static_vars
from lxml.etree import _ElementTree, _Element
_logger = getLogger("DriveBuild.SimNode.Generator")
| [
6738,
18931,
1330,
651,
11187,
1362,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
32233,
198,
198,
6738,
15584,
782,
9078,
1330,
25855,
10503,
9078,
198,
6738,
3708,
11249,
16366,
1330,
9037,
62,
85,
945,
198,
6738,
300,
19875,
13,... | 3.43662 | 71 |
from torch.utils.data.dataset import *
import torch
import os
import numpy as np
import cv2
import datasets.transforms as t
import pickle
| [
6738,
28034,
13,
26791,
13,
7890,
13,
19608,
292,
316,
1330,
1635,
198,
11748,
28034,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
40522,
13,
7645,
23914,
355,
256,
198,
11748,
2298,
293,
... | 3.285714 | 42 |
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from user_account.permissions import IsInventoryManager, IsSystemAdmin
from .serializers import AuditSerializer
from .models import Audit
class AuditViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows Audits t... | [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
1148,
47649,
3474,
198,
6738,
2836,
62,
23317,
13,
525,
8481,
1330,
1148,
818,
17158,
13511,
11,
1148,
11964,
46787,
198,
198,
6738,
764,
46911,
... | 3.480263 | 152 |
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2014
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
# ** See LICENSE.TXT for license detai... | [
2,
1635,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
9,
28,
... | 2.050562 | 356 |
"""
======================================================================
>> Autor: Johann Gordillo
>> Email: jgordillo@ciencias.unam.mx
>> Fecha: 21/10/2020
======================================================================
Universidad Nacional Autónoma de México
Facultad de Ciencias
Computación Distribuida [202... | [
37811,
198,
23926,
50155,
198,
4211,
5231,
273,
25,
28056,
39592,
16111,
198,
4211,
9570,
25,
474,
70,
585,
16111,
31,
979,
268,
979,
292,
13,
403,
321,
13,
36802,
198,
4211,
376,
3055,
64,
25,
2310,
14,
940,
14,
42334,
198,
23926,
... | 1.880807 | 2,777 |
import pytest
import numpy as np
from wmt_bgc.basic import calc_densityflux
| [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
266,
16762,
62,
35904,
66,
13,
35487,
1330,
42302,
62,
43337,
69,
22564,
198,
220,
220,
220,
220
] | 2.758621 | 29 |
import os
import subprocess
import ranger
from ranger.api.commands import Command
class vidir(Command):
""":vidir
Rename all files in the current directory or marked files if any.
"""
class cd_root(Command):
""":cd_root
Cd into the current project root.
"""
| [
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
11748,
43570,
198,
6738,
43570,
13,
15042,
13,
9503,
1746,
1330,
9455,
628,
198,
4871,
410,
312,
343,
7,
21575,
2599,
198,
220,
220,
220,
13538,
1298,
16921,
343,
628,
220,
220,
220... | 2.989691 | 97 |
"""
Florian Guillot & Julien Donche: Project 7
Topic modeling and keywords extractions for Holi.io
Jedha Full Stack, dsmf-paris-13
08-2021
FILE NAME :
preprocessing_text.py
OBJECTIVE :
This function will have a text as input and will give a preprocessized text as output, for instance without URL, without stop wo... | [
37811,
198,
26953,
666,
1962,
359,
313,
1222,
5979,
2013,
2094,
2395,
25,
4935,
767,
198,
47373,
21128,
290,
26286,
7925,
507,
329,
6479,
72,
13,
952,
198,
39952,
3099,
6462,
23881,
11,
288,
5796,
69,
12,
1845,
271,
12,
1485,
198,
8... | 3.393417 | 638 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean CLI v1.0. Copyright 2021 QuantConnect Corporation.
#
# 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... | [
2,
19604,
1565,
4825,
1340,
48842,
13,
9858,
532,
9755,
2890,
15007,
11,
2295,
6477,
278,
34884,
13,
198,
2,
45661,
43749,
410,
16,
13,
15,
13,
15069,
33448,
16972,
13313,
10501,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11... | 3.149784 | 928 |
# -*- coding: utf-8 -*-
# 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。
# 除非法律有要求或以书面形式达成协议,否则本软件分发时需保持当前许可“原样”... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
13328,
231,
230,
30266,
225,
33699,
222,
17312,
231,
13130,
10545,
115,
109,
28839,
111,
163,
109,
111,
163,
255,
238,
163,
100,
239,
162,
232,
222,
17312,
231,
165... | 1.01609 | 1,243 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@文件 :tool_utils.py
@说明 :
@时间 :2020/07/16 16:07:46
@作者 :Riven
@版本 :1.0.0
'''
import os
import sys
sys.path.append('..')
from Utils import file_utils | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
23877,
229,
20015,
114,
220,
220,
220,
220,
220,
220,
220,
1058,
25981,
62,
26791,
13,
9078,
198,
... | 1.661972 | 142 |
import numpy as np
import scipy as sp
from rl.util import logger, log_self
# Util functions for state preprocessing
def process_image_atari(im):
'''
Image preprocessing from the paper
Playing Atari with Deep Reinforcement Learning, 2013
Takes an RGB image and converts it to grayscale,
downsizes... | [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
6738,
374,
75,
13,
22602,
1330,
49706,
11,
2604,
62,
944,
628,
198,
2,
7273,
346,
5499,
329,
1181,
662,
36948,
628,
198,
198,
4299,
1429,
62,
9060,
62,
35554,
... | 2.499426 | 1,742 |
from dbSetup import dbClasses as db
voteClass = db.getDBClass('VOTE')
userClass = db.getDBClass('USER')
meetingClass = db.getDBClass('MEETING')
goalClass = db.getDBClass('GOAL')
attendeeClass = db.getDBClass('ATTENDEE')
| [
6738,
20613,
40786,
1330,
20613,
9487,
274,
355,
20613,
198,
198,
27257,
9487,
796,
20613,
13,
1136,
11012,
9487,
10786,
53,
23051,
11537,
198,
7220,
9487,
796,
20613,
13,
1136,
11012,
9487,
10786,
29904,
11537,
198,
1326,
13629,
9487,
79... | 2.7625 | 80 |
"""Detect primitive roots of a prime module."""
import sys
from mathext import euler_phi, relative_primes, is_prime
MODULE = 99989
# MODULE = 31
if __name__ == '__main__':
if not is_prime(MODULE):
sys.exit()
print('Module:', MODULE)
print('This module has', euler_phi(MODULE - 1), 'primitive roots... | [
37811,
47504,
20049,
11135,
286,
257,
6994,
8265,
526,
15931,
198,
11748,
25064,
198,
198,
6738,
2603,
258,
742,
1330,
304,
18173,
62,
34846,
11,
3585,
62,
1050,
999,
11,
318,
62,
35505,
198,
198,
33365,
24212,
796,
36006,
4531,
198,
... | 2.185268 | 448 |
# Copyright 2015 The TensorFlow Authors. 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 applica... | [
2,
15069,
1853,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
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,
... | 3.205008 | 1,278 |
from z3 import *
#currently I'm only using the real-valued attributes for ease, and the models were generated accordingly
age=Const("age", RealSort())
fnlwgt=Const("fnlwgt", RealSort())
education_num=Const("education-num", RealSort())
capital_gain=Const("capital-gain", RealSort())
capital_loss=Const("capital-loss", R... | [
6738,
1976,
18,
1330,
1635,
198,
198,
2,
41745,
314,
1101,
691,
1262,
262,
1103,
12,
39728,
12608,
329,
10152,
11,
290,
262,
4981,
547,
7560,
16062,
198,
198,
496,
28,
34184,
7203,
496,
1600,
6416,
42758,
28955,
198,
69,
21283,
86,
... | 2.161837 | 1,415 |
import glob
import codecs
import string, re, pickle, math
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize,sent_tokenize
from tqdm import tqdm
import numpy as np
f = codecs.open(f'F:/MTECH1/NLP/Assignment6/data.txt', encoding='utf-8')
sentence_list1=[]
for line in f:
line=line.lower()
... | [
11748,
15095,
198,
11748,
40481,
82,
198,
11748,
4731,
11,
302,
11,
2298,
293,
11,
10688,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
11,
3... | 2.07 | 1,200 |
# -*- coding: utf-8 -*-
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for calculating compatible binhosts."""
from __future__ import print_function
import collections
import jso... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
1853,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
46... | 2.800935 | 3,637 |
from pyrogram import Client, filters
from pyrogram.errors.exceptions.forbidden_403 import Forbidden
from .. import slave, config, help_dict, log_errors, public_log_errors
@Client.on_message(~filters.forwarded & ~filters.sticker & ~filters.via_bot & ~filters.edited & filters.me & filters.command(['w', 'wiki', 'wikipedi... | [
6738,
12972,
39529,
1330,
20985,
11,
16628,
198,
6738,
12972,
39529,
13,
48277,
13,
1069,
11755,
13,
1640,
37978,
62,
31552,
1330,
46014,
198,
6738,
11485,
1330,
11778,
11,
4566,
11,
1037,
62,
11600,
11,
2604,
62,
48277,
11,
1171,
62,
... | 2.727273 | 264 |
from rest_framework import status
from ee.api.test.base import APILicensedTest
from ee.models.dashboard_privilege import DashboardPrivilege
from posthog.models import Dashboard, OrganizationMembership, User
| [
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
304,
68,
13,
15042,
13,
9288,
13,
8692,
1330,
3486,
4146,
291,
15385,
14402,
198,
6738,
304,
68,
13,
27530,
13,
42460,
3526,
62,
13776,
41866,
1330,
16189,
3526,
20184,
41866,
198,
67... | 3.732143 | 56 |
"""
(C) Copyright 2021 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | [
37811,
198,
7,
34,
8,
15069,
33448,
19764,
11421,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
... | 2.532516 | 1,061 |
import pytest
from expackage import my_add
| [
198,
11748,
12972,
9288,
198,
6738,
1033,
441,
496,
1330,
616,
62,
2860,
628,
628
] | 3.133333 | 15 |
if __name__ == "__main__":
print("simple-pyro")
| [
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
36439,
12,
9078,
305,
4943,
198
] | 2.363636 | 22 |
from termcolor import colored
from cfour import Board
PLAYER1_CHR = 'Y'
PLAYER2_CHR = 'R'
PLAYER1_COLOR = 'yellow'
PLAYER2_COLOR = 'red'
class GameDisplay(object):
"""Game Display class. Initializes a board and displays status of the board."""
def display(self):
"""display the current status of ... | [
6738,
3381,
8043,
1330,
16396,
198,
6738,
269,
14337,
1330,
5926,
198,
198,
31519,
1137,
16,
62,
37846,
796,
705,
56,
6,
198,
31519,
1137,
17,
62,
37846,
796,
705,
49,
6,
198,
31519,
1137,
16,
62,
46786,
796,
705,
36022,
6,
198,
3... | 2.289973 | 369 |
from setuptools import setup, find_packages
import os, pathlib
DESCRIPTION = 'AgentFUD Art Engine'
this_directory = pathlib.Path(__file__).parent.resolve()
with open(os.path.join(this_directory, 'README.md')) as readme:
LONG_DESCRIPTION = readme.read()
setup(
name="agentfud-art-engine",
version="0.3.4",... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
28686,
11,
3108,
8019,
198,
198,
30910,
40165,
796,
705,
36772,
37,
8322,
3683,
7117,
6,
198,
198,
5661,
62,
34945,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
... | 2.640506 | 395 |
"""
Created by adam on 11/23/16
"""
__author__ = 'adam'
from nltk.tokenize import word_tokenize, sent_tokenize
class SentenceTokenizer( ITokenizer ):
"""Handles tokenization of sentences. Just a wrapper around nltk tokenizer"""
def process( self, item ):
"""Run the nltk sentence tokenizer on the i... | [
37811,
198,
41972,
416,
23197,
319,
1367,
14,
1954,
14,
1433,
198,
37811,
198,
834,
9800,
834,
796,
705,
324,
321,
6,
628,
198,
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1573,
62,
30001,
1096,
11,
1908,
62,
30001,
1096,
628,
198,
... | 2.829167 | 240 |
import os
from collections import namedtuple
import numpy as np
_default_data_dir = os.path.join(os.getenv('HOME'), 'var/data/cifar')
| [
11748,
28686,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
62,
12286,
62,
7890,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
24330,
10786,
39069,
33809,
705,
7785,
14,
78... | 2.8 | 50 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
383,
7054,... | 3.187661 | 389 |
import os
import yaml
import numpy as np
import astropy.units as u
import astropy.constants as const
import astropy.modeling.blackbody as blackbody
import optlo_calc.utils as utils
import optlo_calc.optics as optics | [
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
6468,
28338,
13,
41667,
355,
334,
198,
11748,
6468,
28338,
13,
9979,
1187,
355,
1500,
198,
11748,
6468,
28338,
13,
4666,
10809,
13,
13424,
2618,
355,
... | 3.223881 | 67 |
import sys, os
__pyver = sys.version_info[0] * 10 + sys.version_info[1]
if __pyver <= 26:
import unittest2 as unittest
else:
import unittest
if __pyver < 33:
import mock
else:
from unittest import mock
from docutils.nodes import emphasis, reference
from sphinxtrap.ext.rawtoc import Link, ParseLinks... | [
11748,
25064,
11,
28686,
198,
198,
834,
9078,
332,
796,
25064,
13,
9641,
62,
10951,
58,
15,
60,
1635,
838,
1343,
25064,
13,
9641,
62,
10951,
58,
16,
60,
198,
198,
361,
11593,
9078,
332,
19841,
2608,
25,
198,
220,
220,
220,
1330,
5... | 2.590047 | 422 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from collections import OrderedDict
from torch.nn import init
import math
import numpy as np
channel_scale = []
for i in range(31):
channel_scale += [(10 + i * 3)/100]
stage_out_channel = [32] + [64] + [128] * ... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
28034,
13,
20471,
... | 2.471223 | 278 |
# sensor.py
# Library for abstraction of getting data from sensor.
import RPi.GPIO as GPIO
import time
| [
2,
12694,
13,
9078,
198,
2,
10074,
329,
34651,
286,
1972,
1366,
422,
12694,
13,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198
] | 3.678571 | 28 |
from operator import attrgetter
from typing import (List,
Optional)
from hypothesis import strategies
from sqlalchemy.engine import Dialect
from sqlalchemy.schema import Column
from hypothesis_sqlalchemy.hints import Strategy
from hypothesis_sqlalchemy.utils import to_sql_identifiers
from . import... | [
6738,
10088,
1330,
708,
81,
1136,
353,
198,
6738,
19720,
1330,
357,
8053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32233,
8,
198,
198,
6738,
14078,
1330,
10064,
198,
6... | 3.356436 | 101 |
# Copyright 2015 Alcatel-Lucent
# All Rights Reserved.
from __future__ import print_function
from enum import Enum
import json
import netaddr
import re
from six import iteritems
from nuage_tempest_plugin.lib.cli import client
from nuage_tempest_plugin.lib.cli import output_parser as cli_output_parser
from nuage_temp... | [
2,
15069,
1853,
43757,
25791,
12,
25596,
1087,
198,
2,
1439,
6923,
33876,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
33829,
1330,
2039,
388,
198,
11748,
33918,
198,
11748,
2010,
29851,
198,
11748,
302,
... | 2.207801 | 4,692 |
# -*- encoding: utf-8 -*-
from momentx import MomentX
# create a class if you need to support multiple default timezones or restricy
class MomentXWrapper(object):
"""
Simple wrapper for momentx.
1) wrapped the moment api to set a custom default_timezone
2) additionally you may set a fixed 'now' which... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
2589,
87,
1330,
29278,
55,
198,
198,
2,
2251,
257,
1398,
611,
345,
761,
284,
1104,
3294,
4277,
640,
89,
1952,
393,
1334,
1173,
88,
198,
4871,
29278,
55,
3... | 2.815348 | 417 |
"""Simple multi-layer perception neural network on MNIST."""
import argparse
import os.path
import struct
import time
import numpy as real_numpy
import minpy.core as core
import minpy.numpy as np
from minpy.nn import io
from minpy.nn import layers
import minpy.nn.model
import minpy.nn.solver
from minpy.utils.minprof i... | [
37811,
26437,
5021,
12,
29289,
11202,
17019,
3127,
319,
29060,
8808,
526,
15931,
198,
11748,
1822,
29572,
198,
11748,
28686,
13,
6978,
198,
11748,
2878,
198,
11748,
640,
198,
11748,
299,
32152,
355,
1103,
62,
77,
32152,
198,
198,
11748,
... | 2.91954 | 435 |