content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
r""" latexnewfloat.py extension for latex builder to replace
literal-block environment by \captionof{LiteralBlockNewFloat}{caption_title} command.
For \captionof command (in capt-of pacakge), the new environment
LiteralBlockNewFloat should be configured by newfloat pagage instead of
original float package.
needspace ... | [
81,
37811,
47038,
3605,
22468,
13,
9078,
7552,
329,
47038,
27098,
284,
6330,
220,
198,
18250,
1691,
12,
9967,
2858,
416,
3467,
6888,
1159,
1659,
90,
43,
270,
1691,
12235,
3791,
43879,
18477,
6888,
1159,
62,
7839,
92,
3141,
13,
198,
19... | 3.046713 | 578 |
"""
Module to fetch and parse regional NIC delegation data
"""
import urllib.parse
import ftplib
import os
from functools import lru_cache
import socket
import ipaddress
from binascii import hexlify
import tempfile
TWD = tempfile.gettempdir()
DELEGATES = [
# America (non-latin)
"ftp://ftp.arin.net/pub/stats/a... | [
37811,
198,
26796,
284,
21207,
290,
21136,
7915,
45593,
22635,
1366,
198,
37811,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
10117,
489,
571,
198,
11748,
28686,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
11748,
... | 2.388584 | 3,101 |
# -*- coding: utf-8 -*-
from helper.resource import YuzukiResource
from helper.template import render_template
from config.config import SITE_DESCRIPTION
from helper.content import markdown_convert_file
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
31904,
13,
31092,
1330,
575,
10277,
11308,
26198,
198,
6738,
31904,
13,
28243,
1330,
8543,
62,
28243,
198,
6738,
4566,
13,
11250,
1330,
311,
12709,
62,
30910,
40165,... | 3.578947 | 57 |
# -*- coding: utf-8 -*-
"""
Author : Jacques Flores
Created : October 17th,2019
About: Script for creating datasets in Dataverse.
An Empty JSON file with Dataverse structure is imported and converted into a JSON dict
Metadata is imported from an excel file into a pandas dataframe and written into the ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
13838,
1058,
35437,
40222,
198,
41972,
1058,
3267,
1596,
400,
11,
23344,
198,
8585,
25,
220,
12327,
329,
4441,
40522,
287,
6060,
4399,
13,
220,
198,
220,
220... | 2.903797 | 395 |
from flask_script import Manager, prompt_bool
# from flask_migrate import Migrate, MigrateCommand
from school_api.app import create_app
from school_api.db import create_tables, drop_tables
from school_api.data_generator import test_db
"""
Refused flask_migration because it was overkill for this project
"""
app = create... | [
6738,
42903,
62,
12048,
1330,
9142,
11,
6152,
62,
30388,
198,
2,
422,
42903,
62,
76,
42175,
1330,
337,
42175,
11,
337,
42175,
21575,
198,
6738,
1524,
62,
15042,
13,
1324,
1330,
2251,
62,
1324,
198,
6738,
1524,
62,
15042,
13,
9945,
1... | 3.187919 | 149 |
p="\nTell me something, and I will repeat it back to you"
p+="\nEnter 'quit' to end the program."
active = True
while active:
message=input(p)
if message =='quit':
active = False
else:
print(message) | [
79,
2625,
59,
77,
24446,
502,
1223,
11,
290,
314,
481,
9585,
340,
736,
284,
345,
1,
201,
198,
79,
10,
2625,
59,
77,
17469,
705,
47391,
6,
284,
886,
262,
1430,
526,
201,
198,
5275,
796,
6407,
201,
198,
4514,
4075,
25,
201,
198,
... | 2.641975 | 81 |
# Sample implementation of a custom layer info module
def layer_info(layer, x, y, crs, params, identity):
"""Query layer and return info result as dict:
{
'features': [
{
'id': <feature ID>, # optional
'attributes': [
... | [
2,
27565,
7822,
286,
257,
2183,
7679,
7508,
8265,
628,
198,
4299,
7679,
62,
10951,
7,
29289,
11,
2124,
11,
331,
11,
1067,
82,
11,
42287,
11,
5369,
2599,
198,
220,
220,
220,
37227,
20746,
7679,
290,
1441,
7508,
1255,
355,
8633,
25,
... | 1.954864 | 1,285 |
from google.auth.transport.requests import Request
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
import google_auth_oauthlib.flow
import logging
import os
if __name__ == "__main__":
g = gCalIntegratinator()
| [
6738,
23645,
13,
18439,
13,
7645,
634,
13,
8897,
3558,
1330,
19390,
198,
6738,
23645,
499,
291,
75,
1153,
13,
67,
40821,
1330,
1382,
198,
6738,
23645,
499,
291,
75,
1153,
13,
48277,
1330,
367,
29281,
12331,
198,
11748,
23645,
62,
1843... | 3.225 | 80 |
from random import choice
from django.contrib import admin
from pins.models import Batch, Pin
from pins.forms import BatchForm
admin.site.register(Batch, BatchAdmin)
admin.site.register(Pin, PinAdmin)
| [
6738,
4738,
1330,
3572,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
20567,
13,
27530,
1330,
347,
963,
11,
13727,
198,
6738,
20567,
13,
23914,
1330,
347,
963,
8479,
628,
628,
198,
198,
28482,
13,
15654,
13... | 3.25 | 64 |
main('maxcross.in', 'maxcross.out') | [
220,
220,
628,
198,
12417,
10786,
9806,
19692,
13,
259,
3256,
705,
9806,
19692,
13,
448,
11537,
220
] | 2.277778 | 18 |
'''
Given an unsorted integer array, find the smallest missing positive integer.
Example 1:
Input: [1,2,0]
Output: 3
Example 2:
Input: [3,4,-1,1]
Output: 2
Example 3:
Input: [7,8,9,11,12]
Output: 1
Note:
Your algorithm should run in O(n) time and uses constant extra space.
'''
s = Solution()
print(s.firstMissingP... | [
7061,
6,
198,
15056,
281,
5576,
9741,
18253,
7177,
11,
1064,
262,
18197,
4814,
3967,
18253,
13,
198,
198,
16281,
352,
25,
198,
198,
20560,
25,
685,
16,
11,
17,
11,
15,
60,
198,
26410,
25,
513,
198,
16281,
362,
25,
198,
198,
20560,... | 2.555556 | 135 |
"""
Calculate the translational entropy with EW, HSM and IGM models
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
plt.style.use("paper")
ha2kjmol = 627.5 * 4.184
def _q_t_ew(self):
cap_lambda = ((2.0 * self.mass_au * np.pi) / (
beta_au * Constant... | [
37811,
198,
9771,
3129,
378,
262,
4779,
864,
40709,
351,
43255,
11,
367,
12310,
290,
314,
15548,
4981,
198,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
... | 1.884872 | 1,051 |
from .nlgsearch import templatize # NOQA: F401
| [
6738,
764,
21283,
70,
12947,
1330,
2169,
489,
265,
1096,
220,
220,
220,
220,
220,
220,
1303,
8005,
48,
32,
25,
376,
21844,
198
] | 2.208333 | 24 |
##############################################
#
# Author: Aniruddha Gokhale
#
# Created: Spring 2022
#
# Purpose: demonstrate a basic remote procedure call-based client
#
# A RPC uses message passing under the hood but provides a more
# type-safe and intuitive way for users to make invocations on the remote
# side bec... | [
29113,
7804,
4242,
2235,
198,
2,
198,
2,
6434,
25,
1052,
343,
4185,
3099,
402,
482,
71,
1000,
198,
2,
198,
2,
15622,
25,
8225,
33160,
198,
2,
198,
2,
32039,
25,
10176,
257,
4096,
6569,
8771,
869,
12,
3106,
5456,
198,
2,
198,
2,
... | 4.256334 | 671 |
import sys
from PyQt5.QtWidgets import QApplication,QMainWindow,QDialog
from PyQt5 import QtCore, QtGui, QtWidgets
from ui.main_window import Ui_MainWindow
# from login import Ui_dialog
from lib.tcmd import TCmdClass
# from SignalsE import Example
# class SignalsWindow(QWidget,SignalsExample):
# def __init__(self... | [
198,
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
48,
13383,
27703,
11,
48,
44204,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
1... | 2.305085 | 295 |
# Copyright 2014-2015, Tresys Technology, LLC
#
# This file is part of SETools.
#
# SETools is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of
# the License, or (at your option) any l... | [
2,
15069,
1946,
12,
4626,
11,
309,
411,
893,
8987,
11,
11419,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
25823,
10141,
13,
198,
2,
198,
2,
25823,
10141,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2... | 3.680365 | 219 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""Description:
"""
import os
import sys
import comtypes.client
try:
ETABSObject = comtypes.client.GetActiveObject("CSI.ETABS.API.ETABSObject")
print("Coneccion exitosa!.\nadjuntando a una instancia existente.")
except (OSError, comtypes.COMError):
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
201,
198,
37811,
11828,
25,
201,
198,
201,
198,
37811,
201,
198,
11748,
28686,
201,
198,
11748,
25064,
201,
198,
11748... | 2.166667 | 972 |
# -*- 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 |
#variables de entrada
print("area del triangulo")
#datos de entrada
B=int(input("ingrese base:"))
H=int(input("ingrese haltura:"))
#proceso
area=(B*H)/2
#datos de salida
print("el area es: ", area) | [
2,
25641,
2977,
390,
24481,
4763,
198,
4798,
7203,
20337,
1619,
1333,
648,
43348,
4943,
198,
2,
19608,
418,
390,
24481,
4763,
198,
33,
28,
600,
7,
15414,
7203,
278,
260,
325,
2779,
11097,
4008,
198,
39,
28,
600,
7,
15414,
7203,
278,... | 2.493671 | 79 |
from typing import Any, Optional
from django.contrib.sessions.middleware import SessionMiddleware
| [
6738,
19720,
1330,
4377,
11,
32233,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
82,
6202,
13,
27171,
1574,
1330,
23575,
34621,
1574,
628,
198,
220
] | 3.777778 | 27 |
import cloudpassage
import provisioner
import pytest
import os
here_dir = os.path.abspath(os.path.dirname(__file__))
fixture_dir = os.path.join(here_dir, "../fixture")
| [
11748,
6279,
6603,
496,
198,
11748,
8287,
263,
198,
11748,
12972,
9288,
198,
11748,
28686,
198,
198,
1456,
62,
15908,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
69,
960... | 2.741935 | 62 |
import os
import sys
import boto3
import boto
import moto
import botocore
import unittest
import logging
import re
import sure
import botocore.session
from datetime import datetime
from moto import mock_sns_deprecated, mock_sqs_deprecated
from botocore.stub import Stubber
from freezegun import freeze_time
from mock imp... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
275,
2069,
18,
198,
11748,
275,
2069,
198,
11748,
285,
2069,
198,
11748,
10214,
420,
382,
198,
11748,
555,
715,
395,
198,
11748,
18931,
198,
11748,
302,
198,
11748,
1654,
198,
11748,
10214,
4... | 2.737154 | 506 |
import json
from api.helper import json_405_response, json_error_response
def no_test(func):
"""
Use for URLs that do not require testing, use wisely
"""
inner.__name__ = func.__name__
inner.__module__ = func.__module__
inner.__doc__ = func.__doc__
inner.__dict__ = func.__dict__
inner... | [
11748,
33918,
198,
198,
6738,
40391,
13,
2978,
525,
1330,
33918,
62,
26598,
62,
26209,
11,
33918,
62,
18224,
62,
26209,
628,
198,
4299,
645,
62,
9288,
7,
20786,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5765,
329,
32336,
... | 2.647059 | 136 |
'''
Created on Apr 16, 2012
@author: Haak Saxberg
'''
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ObjectDoesNotExist
from django.db.utils import IntegrityError
from ...models import Campus, Course, Professor, Section, Meeting, Timeslot, Day, Semester,\
... | [
7061,
6,
198,
41972,
319,
2758,
1467,
11,
2321,
198,
198,
31,
9800,
25,
9398,
461,
29242,
3900,
198,
7061,
6,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
6738,
42625,
14208,
13,
7... | 3.102941 | 136 |
import pandas as pd
classificacoes = pd.read_csv('email.csv')
textosPuros = classificacoes['email']
textosQuebrados = textosPuros.str.lower().str.split(' ')
dicionario = set()
for lista in textosQuebrados:
dicionario.update(lista)
totalPalavras = len(dicionario)
tuplas = list(zip(dicionario, range(totalPalavras)... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
4871,
811,
330,
3028,
796,
279,
67,
13,
961,
62,
40664,
10786,
12888,
13,
40664,
11537,
198,
5239,
418,
47,
1434,
82,
796,
1398,
811,
330,
3028,
17816,
12888,
20520,
198,
5239,
418,
15681,
... | 2.481481 | 270 |
import copy
import os
import pickle
import unittest
from unittest.mock import patch
from dgcastle import dgcastle
from dgcastle.exceptions import IncompleteException
from dgcastle.exceptions import ValidationException
from dgcastle.handlers.challonge import Challonge
TEST_TOURNAMENT = pickle.loads(b'\x80\x03}q\x00(X\... | [
11748,
4866,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
288,
70,
18676,
1330,
288,
70,
18676,
198,
6738,
288,
70,
18676,
13,
1069,
11755,
1... | 1.399123 | 15,742 |
# uncompyle6 version 3.3.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
# Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\pushbase\step_duplicator.py
# Compiled at: 2018-11-30 15:48:12
from _... | [
2,
34318,
2349,
21,
2196,
513,
13,
18,
13,
20,
198,
2,
11361,
18022,
8189,
362,
13,
22,
357,
21,
1828,
1157,
8,
198,
2,
4280,
3361,
3902,
422,
25,
11361,
513,
13,
22,
13,
18,
357,
12286,
11,
2758,
1987,
13130,
11,
1315,
25,
19... | 2.982222 | 225 |
from django.db import models
#Utilities
from cride.utils.models import BetmatcherModel
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
18274,
2410,
198,
6738,
1067,
485,
13,
26791,
13,
27530,
1330,
5147,
6759,
2044,
17633,
628
] | 3.423077 | 26 |
# This macro allows changing the position of an external axis by hand or within a program as a function call.
# Example of a function call (units are in mm or deg):
# MoveAxis(0)
# MoveAxis(100)
# https://robodk.com/doc/en/RoboDK-API.html
import sys # allows getting the passed argument parameters
from robodk.rob... | [
2,
770,
15021,
3578,
5609,
262,
2292,
286,
281,
7097,
16488,
416,
1021,
393,
1626,
257,
1430,
355,
257,
2163,
869,
13,
198,
2,
17934,
286,
257,
2163,
869,
357,
41667,
389,
287,
8085,
393,
3396,
2599,
198,
2,
220,
220,
220,
10028,
... | 3.037475 | 507 |
import os.path
import unittest
from setup import iter_vendored_files
VENDORED = {file.replace('/', os.path.sep) for file in [
'pydevd/pydev_run_in_console.py',
'pydevd/setup_cython.py',
'pydevd/pydev_app_engine_debug_startup.py',
'pydevd/pydevd_tracing.py',
'pydevd/pydev_pysrc.py',
'pydevd/p... | [
11748,
28686,
13,
6978,
198,
11748,
555,
715,
395,
198,
198,
6738,
9058,
1330,
11629,
62,
85,
437,
1850,
62,
16624,
628,
198,
198,
53,
10619,
32023,
796,
1391,
7753,
13,
33491,
10786,
14,
3256,
28686,
13,
6978,
13,
325,
79,
8,
329,
... | 1.86701 | 5,820 |
from psycopg2 import connect
from psycopg2.sql import SQL, Identifier, Literal, Composed
from collections import OrderedDict
from itertools import count
from pgcsv.util import normalize_column
| [
6738,
17331,
22163,
70,
17,
1330,
2018,
198,
6738,
17331,
22163,
70,
17,
13,
25410,
1330,
16363,
11,
11440,
7483,
11,
25659,
1691,
11,
3082,
1335,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
340,
861,
10141,
1330,
954,
19... | 3.611111 | 54 |
##Rate Coefficients
import numpy as np
| [
2235,
32184,
1766,
41945,
198,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.333333 | 12 |
import math
import numpy as np
FULL_RANGE = 1024
| [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
37,
9994,
62,
49,
27746,
796,
28119,
198
] | 2.777778 | 18 |
# XXX verification for bug 30828 - runs ice_pbdagcon on a spurious cluster
# and checks that it discards the resulting all-N consensus sequence
import subprocess
import tempfile
import unittest
import os.path as op
from pbcore.io import FastaReader
CLUSTER_FA = """\
>m54007_151222_230824/47383194/334_64_CCS
CATTGAA... | [
198,
2,
27713,
19637,
329,
5434,
35617,
2078,
532,
4539,
4771,
62,
79,
17457,
363,
1102,
319,
257,
49062,
13946,
198,
2,
290,
8794,
326,
340,
1221,
1371,
262,
7186,
477,
12,
45,
11529,
8379,
198,
198,
11748,
850,
14681,
198,
11748,
... | 2.061489 | 618 |
/home/runner/.cache/pip/pool/a5/a1/10/06eab95524f667caa51362a09c577fd5f6d45980e5390034745c0a322f | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
64,
20,
14,
64,
16,
14,
940,
14,
3312,
68,
397,
24,
2816,
1731,
69,
28933,
6888,
64,
48645,
5237,
64,
2931,
66,
49447,
16344,
20,
69,
21,
67,
33459,
1795,
68,
20,
... | 1.777778 | 54 |
import unittest
def banana():
"Yellow"
return 42
def make_adder(n):
"Function adding N"
def add(x):
"Compute N + X"
return n + x
return add
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
628,
198,
4299,
25996,
33529,
198,
220,
220,
220,
366,
39499,
1,
198,
220,
220,
220,
1441,
5433,
628,
628,
198,
198,
4299,
787,
62,
26676,
7,
77,
2599,
198,
220,
220,
220,
366,
22203,
4375,
399,
1,
198,
220,
... | 2.165138 | 109 |
from __future__ import print_function
import argparse
import json
import jsonschema
import logging
import numpy as np
import networkx as nx
import os
import pandas as pd
import random
import sys
logger = logging.getLogger(name=__file__)
__SCHEMA__ = _load_schema()
def validate(participant_data):
"""Check that... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
44804,
684,
2395,
2611,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
2... | 2.204144 | 4,923 |
from dataclasses import dataclass, field
from typing import List
from itertools import chain
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
7343,
198,
6738,
340,
861,
10141,
1330,
6333,
628
] | 4.086957 | 23 |
import os, time, datetime, threading, random
import numpy as np
import matplotlib.pyplot as plt
import sys
from cortix.src.module import Module
from cortix.src.port import Port
from cortix.src.cortix_main import Cortix
import time
from bb_plot import Plot
import shapely.geometry as geo
import shapely.ops
from shapely i... | [
11748,
28686,
11,
640,
11,
4818,
8079,
11,
4704,
278,
11,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
6738,
12794,
844,
13,
10677,
13,
21412,
1330,
19... | 1.998439 | 1,281 |
# Copyright 2018 Mathias Burger <mathias.burger@gmail.com>
#
# SPDX-License-Identifier: MIT
import os
import shutil
import textwrap
from tempfile import TemporaryDirectory
import numpy as np
import pytest
from pgimp.GimpFile import GimpFile, GimpFileType
from pgimp.GimpFileCollection import GimpFileCollection, NonEx... | [
2,
15069,
2864,
16320,
4448,
28983,
1279,
11018,
4448,
13,
6236,
1362,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
2420,
37150,
... | 3.414634 | 164 |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 29 13:07:10 2016
@author: chyam
purpose: A vanila lstm model for text classification.
"""
from __future__ import print_function
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.layers import LSTM
from sklearn.feature_ex... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
8621,
2808,
1511,
25,
2998,
25,
940,
1584,
198,
198,
31,
9800,
25,
442,
88,
321,
198,
29983,
25,
317,
5719,
10102,
300,
301,
76,
2746,
... | 2.541096 | 584 |
# 1 1 2 3 5 8 13 21 ....
# f(n) = f(n - 1) + f(n - 2)
# f(0) = f(1) = 1
print(fibonacci(5))
| [
2,
352,
352,
362,
513,
642,
807,
1511,
2310,
19424,
198,
2,
277,
7,
77,
8,
796,
277,
7,
77,
532,
352,
8,
1343,
277,
7,
77,
532,
362,
8,
198,
2,
277,
7,
15,
8,
796,
277,
7,
16,
8,
796,
352,
628,
198,
4798,
7,
69,
571,
2... | 1.709091 | 55 |
#pythran export entry()
#runas entry()
import simple_case_import
| [
2,
79,
5272,
2596,
10784,
5726,
3419,
198,
2,
5143,
292,
5726,
3419,
198,
11748,
2829,
62,
7442,
62,
11748,
198
] | 3.095238 | 21 |
import torchvision.models
from .resnext101_32x4d import resnext101_32x4d
from .inception_v4 import inception_v4
from .inception_resnet_v2 import inception_resnet_v2
from .wrn50_2 import wrn50_2
from .my_densenet import densenet161, densenet121, densenet169, densenet201
from .my_resnet import resnet18, resnet34, resnet5... | [
11748,
28034,
10178,
13,
27530,
198,
6738,
764,
411,
19545,
8784,
62,
2624,
87,
19,
67,
1330,
581,
19545,
8784,
62,
2624,
87,
19,
67,
198,
6738,
764,
924,
1159,
62,
85,
19,
1330,
30839,
62,
85,
19,
198,
6738,
764,
924,
1159,
62,
... | 2.311932 | 1,651 |
#!/usr/bin/env python3
"""
Add +x to every .sh file
"""
# import argparse
import os
import subprocess
go_recursive(".") | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
4550,
1343,
87,
284,
790,
764,
1477,
2393,
198,
37811,
198,
198,
2,
1330,
1822,
29572,
198,
11748,
28686,
198,
11748,
850,
14681,
628,
198,
2188,
62,
8344,
30753,
... | 2.795455 | 44 |
# TEXAS HOLD'EM (Program by Isaac Thompson)
import random, itertools, copy, sys
import os
from playsound import playsound
import pyttsx3
# Set to true to enable betting.
do_bets = False
RANKS = ['2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A']
SUITS = ['C', 'D', 'H', 'S']
SORT_RANKS = {'2': 0, '3': 1... | [
2,
309,
6369,
1921,
367,
15173,
6,
3620,
357,
15167,
416,
19068,
11654,
8,
198,
198,
11748,
4738,
11,
340,
861,
10141,
11,
4866,
11,
25064,
198,
11748,
28686,
198,
6738,
5341,
633,
1330,
5341,
633,
198,
11748,
12972,
83,
912,
87,
18... | 2.174628 | 1,884 |
"""
s="preeni"
ss="e"
"""
s=input("enter the string:")
ss=input("enter the substring:")
j=0
for i in range(len(s)):
m=s.find(ss)
#the first occurence of ss
if(j==0):
print("m=%d"%m)
if(m== -1 and j==0):
print("no such substring is available")
break
if(m== -... | [
37811,
201,
198,
82,
2625,
79,
1361,
72,
1,
201,
198,
824,
2625,
68,
1,
201,
198,
37811,
201,
198,
82,
28,
15414,
7203,
9255,
262,
4731,
25,
4943,
201,
198,
824,
28,
15414,
7203,
9255,
262,
3293,
1806,
25,
4943,
201,
198,
201,
1... | 1.730469 | 256 |
#!/bin/usr/python
# -*- coding:utf-8 -*-
# 628.
s = Solution()
num = s.maximumProduct([-4, -3, -2, -1, 60])
print(num)
| [
2,
48443,
8800,
14,
14629,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
718,
2078,
13,
198,
198,
82,
796,
28186,
3419,
198,
22510,
796,
264,
13,
47033,
15667,
26933,
12,
19,
11,
532,
18,
11,
532... | 2.05 | 60 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 16 15:35:53 2021
@author: alef
"""
import os.path
# modulo de instropeco amigvel
import inspect
print('Objeto: ', inspect.getmodule(os.path))
print('Classe?', inspect.isclass(str))
# Lista todas as funes que existem em os.path
print('Membros: ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
3158,
1467,
1315,
25,
2327,
25,
4310,
33448,
198,
198,
31,
9800,
25,
31341,
69,
19... | 2.49711 | 173 |
import sys
import pyfiglet
import pandas as pd
import numpy as np
from tabulate import tabulate
import dateutil
import datetime
import re
result = pyfiglet.figlet_format("h r s y s t e m", font="slant")
strStatus = ""
# Main Body of Script ------------------------------------------------------ #
if __name__ ==... | [
11748,
25064,
198,
11748,
12972,
5647,
1616,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
11748,
3128,
22602,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
198,
... | 2.410138 | 434 |
from . import similarity
from .distance import frechet_dist
from .similarity import pcc, sa
from . import robust
from .robust import iqr, cv, fwhm, count_missing_values
| [
6738,
764,
1330,
26789,
198,
6738,
764,
30246,
1330,
2030,
20043,
62,
17080,
198,
6738,
764,
38610,
414,
1330,
279,
535,
11,
473,
198,
6738,
764,
1330,
12373,
198,
6738,
764,
22609,
436,
1330,
1312,
80,
81,
11,
269,
85,
11,
277,
192... | 3.313725 | 51 |
import scraper.scraper as scraper
import scraper.parser as parser
import sys
from dotenv import load_dotenv
load_dotenv()
if __name__ == "__main__":
if "--noScrape" not in sys.argv:
scraper.main()
parser.main()
| [
11748,
19320,
525,
13,
1416,
38545,
355,
19320,
525,
198,
11748,
19320,
525,
13,
48610,
355,
30751,
198,
11748,
25064,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
361,
11593,
... | 2.602273 | 88 |
from __future__ import division
import time
import json
from collections import deque
import serial
import redis
import numpy as np
if __name__ == '__main__':
run_main() | [
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
640,
198,
11748,
33918,
198,
6738,
17268,
1330,
390,
4188,
198,
198,
11748,
11389,
198,
11748,
2266,
271,
198,
11748,
299,
32152,
355,
45941,
628,
220,
220,
220,
220,
198,
361,
11593... | 3.175439 | 57 |
from django.db import models
from django.utils import timezone | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340
] | 3.875 | 16 |
from syft_tensorflow.serde.serde import MAP_TF_SIMPLIFIERS_AND_DETAILERS
| [
6738,
827,
701,
62,
83,
22854,
11125,
13,
2655,
2934,
13,
2655,
2934,
1330,
34645,
62,
10234,
62,
48913,
6489,
5064,
40,
4877,
62,
6981,
62,
35,
20892,
4146,
4877,
198
] | 2.354839 | 31 |
#!/bin/env python
# In this challenge, we are going to use regular expressions to manipulate
# text data
import re
# 1. Compile a regular expression that matches URLs
P_URL = re.compile(r'http://dlab\.berkeley\.edu', flags=re.I)
# 2. Using that pattern, write a function that pulls all of the URLs out of a document... | [
2,
48443,
8800,
14,
24330,
21015,
198,
198,
2,
554,
428,
4427,
11,
356,
389,
1016,
284,
779,
3218,
14700,
284,
18510,
198,
2,
2420,
1366,
198,
198,
11748,
302,
198,
198,
2,
352,
13,
3082,
576,
257,
3218,
5408,
326,
7466,
32336,
19... | 3.445545 | 101 |
# -----------------------------------------------------------------------------
# WSDM Cup 2017 Classification and Evaluation
#
# Copyright (c) 2017 Stefan Heindorf, Martin Potthast, Gregor Engels, Benno Stein
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associ... | [
2,
16529,
32501,
198,
2,
370,
10305,
44,
5454,
2177,
40984,
290,
34959,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
28842,
679,
521,
24263,
11,
5780,
6902,
400,
459,
11,
8547,
273,
42532,
11,
14025,
78,
15215,
198,
2,
198,
2,
2448,
... | 2.978506 | 1,861 |
from struct import unpack, pack
from math import ceil, inf, acos, degrees
from vectors import Vector3, Triangle, Vector2, Matrix3x3
from re import match
UPVECTOR = Vector3(0.0, 1.0, 0.0)
FWVECTOR = Vector3(1.0, 0.0, 0.0)
SIDEVECTOR = Vector3(0.0, 0.0, 1.0)
class BJMPTriangle(object):
def fill_verti... | [
6738,
2878,
1330,
555,
8002,
11,
2353,
198,
6738,
10688,
1330,
2906,
346,
11,
1167,
11,
936,
418,
11,
7370,
198,
6738,
30104,
1330,
20650,
18,
11,
33233,
11,
20650,
17,
11,
24936,
18,
87,
18,
198,
6738,
302,
1330,
2872,
198,
8577,
... | 1.833592 | 2,578 |
#!/usr/bin/env python3
# https://open.kattis.com/problems/integerlists
for _ in range(int(input())):
p = input()
n = int(input())
i, j = 0, n
xs = input()[1:-1].split(',')
front = True
for c in p:
if c == 'R':
front = not front
elif i == j:
i += 1
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
3740,
1378,
9654,
13,
74,
1078,
271,
13,
785,
14,
1676,
22143,
14,
41433,
20713,
198,
1640,
4808,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
198,
220,
220,
220,
279,
796,
512... | 1.725664 | 339 |
import pytest
from django.http import HttpResponse
from django.urls import reverse
from main.middleware import IpRestrictionMiddleware
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
1388,
13,
27171,
1574,
1330,
314,
79,
19452,
46214,
34621,
1574,
628,
198
] | 3.631579 | 38 |
import json
import re
from urllib.request import urlopen
'''
The use of objects has various benefits.
1. Better control of context
2. State that can be evaluated
3. Data can be created and then processing can be added
4. Clean interface
'''
def main():
from argparse import ArgumentParser
... | [
11748,
33918,
201,
198,
11748,
302,
201,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
201,
198,
201,
198,
7061,
6,
201,
198,
464,
779,
286,
5563,
468,
2972,
4034,
13,
201,
198,
16,
13,
11625,
1630,
286,
4732,
201,
198,
... | 2.822222 | 225 |
import pandas as pd
import numpy as np
import json
from simpletransformers.classification import ClassificationModel, ClassificationArgs
import sklearn
from sklearn.model_selection import train_test_split
import torch
import re
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import os
from tqdm impor... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
2829,
35636,
364,
13,
4871,
2649,
1330,
40984,
17633,
11,
40984,
42035,
198,
11748,
1341,
35720,
198,
6738,
1341,
35720,
13,
19849,
62,
4... | 2.389401 | 1,736 |
#!/usr/bin/env python3
"""
A module that defines any general purpose functions used by all scripts, including loading configuration files,
connecting to the database, and handling Twitch's timestamp formats.
"""
import json
import sqlite3
from datetime import datetime
from typing import Tuple, Union
##############... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
197,
32,
8265,
326,
15738,
597,
2276,
4007,
5499,
973,
416,
477,
14750,
11,
1390,
11046,
8398,
3696,
11,
198,
197,
8443,
278,
284,
262,
6831,
11,
290,
9041,
2383... | 3.020147 | 546 |
from unidecode import unidecode
from unicodedata import name
import ftfy
for i in range(33, 65535):
if i > 0xEFFFF:
continue # Characters in Private Use Area and above are ignored
if 0xD800 <= i <= 0xDFFF:
continue
h = hex(i)
u = chr(i)
f = ftfy.fix_text(u, normalization="NFKC")
... | [
6738,
555,
485,
8189,
1330,
555,
485,
8189,
198,
6738,
28000,
9043,
1045,
1330,
1438,
198,
11748,
10117,
24928,
198,
198,
1640,
1312,
287,
2837,
7,
2091,
11,
45021,
2327,
2599,
198,
220,
220,
220,
611,
1312,
1875,
657,
87,
36,
29312,
... | 1.786232 | 552 |
import dash_bootstrap_components as dbc
from dash import html
from app import app
layout = dbc.Container(
children=[
dbc.Card([
#dbc.CardHeader("EURONEWS (Unio Europia)"),
dbc.CardBody([html.Iframe(className="ytvid", width="420", height="315", src="https://www.youtube.com/embed/s... | [
11748,
14470,
62,
18769,
26418,
62,
5589,
3906,
355,
288,
15630,
198,
6738,
14470,
1330,
27711,
198,
198,
6738,
598,
1330,
598,
198,
198,
39786,
796,
288,
15630,
13,
29869,
7,
198,
220,
220,
220,
1751,
41888,
220,
628,
220,
220,
220,
... | 2.034418 | 2,121 |
# -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~
main module
#author guoweikuang
"""
from flask import render_template
from flask import redirect
from flask import url_for
from flask import request
from flask_login import login_required
from pyecharts import Bar
from pyecharts.utils import json_dumps
#from pyechart... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
27156,
8728,
4907,
198,
12417,
8265,
198,
198,
2,
9800,
915,
47097,
28643,
648,
198,
37811,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
1330,
... | 3.298246 | 285 |
#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
#
# 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
# on the... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
357,
34,
8,
15069,
19764,
10501,
5472,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
198... | 3.086885 | 610 |
from __future__ import division
| [
6738,
11593,
37443,
834,
1330,
7297,
628
] | 4.714286 | 7 |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from webui.dataforj import get_flow
def create_dependson_tuple(flow):
depends_on_list=[step... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42807,
62,
23914,
13,
2978,
525,
1330,
5178,
47429,
198,
6738,
42807,
62,
23914,
13,
39786,
1330,
47639,
11,
4777,
11,
39900,
11,
11532,
11,
20969,
11,
11314,
11,
7663,
198,
6738,
42807,
62,
... | 3.205674 | 141 |
import logging
from c8ydp.device_proxy import DeviceProxy, WebSocketFailureException
from threading import Thread
import threading
from c8yMQTT import C8yMQTT
import concurrent.futures
import os
logging.basicConfig(level=logging.INFO,format='%(asctime)s %(name)s %(message)s')
logger = logging.getLogger(__name__)
st... | [
11748,
18931,
198,
6738,
269,
23,
5173,
79,
13,
25202,
62,
36436,
1330,
16232,
44148,
11,
5313,
39105,
50015,
16922,
198,
6738,
4704,
278,
1330,
14122,
198,
11748,
4704,
278,
198,
6738,
269,
23,
88,
49215,
15751,
1330,
327,
23,
88,
49... | 2.659649 | 285 |
from context import fe621
import numpy as np
import pandas as pd
def convergenceSegmentLimit():
"""Function to compute the number of segments required for convergence of
various quadrature methods.
"""
# Objective function
# Setting target tolerance level for termination
epsilon = 1e-3
... | [
6738,
4732,
1330,
730,
21,
2481,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
4299,
40826,
41030,
434,
39184,
33529,
198,
220,
220,
220,
37227,
22203,
284,
24061,
262,
1271,
286,
17894,
2672,
... | 2.496198 | 526 |
from .utils import vc, load_config, tensors_close, tensors_close_sum, rand_true, freivalds_rounds, submul_ratio
from .partial_class import partial_class
from .validation_set import ValidationSet
from .validation_buffer import ValidationBuffer
from .register_hooks import register_activation_hooks, register_gradient_hook... | [
6738,
764,
26791,
1330,
410,
66,
11,
3440,
62,
11250,
11,
11192,
669,
62,
19836,
11,
11192,
669,
62,
19836,
62,
16345,
11,
43720,
62,
7942,
11,
2030,
452,
1940,
82,
62,
744,
82,
11,
850,
76,
377,
62,
10366,
952,
198,
6738,
764,
... | 3.451128 | 133 |
from .alerts import AlertStubMixin
from .analysis import AnalysisStubMixin
from .identities import IdentityStubMixin
from .capsules import CapsuleStubMixin
from .streams import StreamStubMixin
from .zone_statuses import ZoneStatusStubMixin
from .zones import ZoneStubMixin
from .storage import StorageStubMixin
from .ala... | [
6738,
764,
44598,
82,
1330,
23276,
1273,
549,
35608,
259,
198,
6738,
764,
20930,
1330,
14691,
1273,
549,
35608,
259,
198,
6738,
764,
738,
871,
1330,
27207,
1273,
549,
35608,
259,
198,
6738,
764,
27979,
5028,
1330,
23534,
2261,
1273,
549... | 3.311628 | 215 |
from shgo.shgo_m.triangulation import *
from ._shgo import shgo
__all__ = [s for s in dir() if not s.startswith('_')] | [
6738,
427,
2188,
13,
1477,
2188,
62,
76,
13,
28461,
648,
1741,
1330,
1635,
198,
6738,
47540,
1477,
2188,
1330,
427,
2188,
198,
198,
834,
439,
834,
796,
685,
82,
329,
264,
287,
26672,
3419,
611,
407,
264,
13,
9688,
2032,
342,
10786,
... | 2.565217 | 46 |
"""Corpus filtering"""
import difflib
import itertools
import logging
import math
import os
import string
from typing import Iterator, List, Tuple
import rapidfuzz
import regex
from langid.langid import LanguageIdentifier, model
import pycld2
from bs4 import BeautifulSoup as bs
import fasttext
from . import FilterAB... | [
37811,
45680,
385,
25431,
37811,
198,
198,
11748,
814,
8019,
198,
11748,
340,
861,
10141,
198,
11748,
18931,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4731,
198,
6738,
19720,
1330,
40806,
1352,
11,
7343,
11,
309,
29291,
198,
198,
... | 2.826667 | 525 |
s=0
c=0
for n in range(6):
num=int(input('digite o {} nmero:'.format(n+1)))
if num%2==0:
s+=num
c+=1
print('a soma dos {} nmeros pares {}'.format(c,s)) | [
82,
28,
15,
198,
66,
28,
15,
198,
1640,
299,
287,
2837,
7,
21,
2599,
198,
220,
220,
220,
997,
28,
600,
7,
15414,
10786,
12894,
578,
267,
23884,
299,
647,
78,
25,
4458,
18982,
7,
77,
10,
16,
22305,
198,
220,
220,
220,
611,
997,... | 1.852632 | 95 |
# coding: utf-8
# In[1]:
##Includes
from flask import request, url_for
from flask_api import FlaskAPI, status, exceptions
from flask_cors import CORS, cross_origin
from flask import Blueprint, render_template, abort
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.rea... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
198,
198,
2235,
42986,
198,
6738,
42903,
1330,
2581,
11,
19016,
62,
1640,
198,
6738,
42903,
62,
15042,
1330,
46947,
17614,
11,
3722,
11,
13269,
198,
6738,
42903,
... | 2.57115 | 513 |
#py_numpy_1.py
"""a snake-charming application"""
from PIL import Image
import numpy as np
import os
idir =os.getcwd()
iname= 'im3.png'# 'white_snake.PNG'
saveas='new_snake.PNG'
#sets up an array for pixel processing
white=np.array([255,255,255,0]) #r, g, b, a
transparent = np.array([0, 0, 0, 0])
background = whit... | [
2,
9078,
62,
77,
32152,
62,
16,
13,
9078,
198,
198,
37811,
64,
17522,
12,
354,
18052,
3586,
37811,
198,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
312,
343,
796,
418,
13,
1136,
66,
... | 2.727156 | 777 |
index = -1
# compound "container" entries
# list entries
# data value entries
# comments
fileData = ""
with open(input(), 'r') as file:
fileData = file.read()
fileSize = len(fileData)
if (fileSize == 0):
print("File is empty!")
else:
fileContent = parseContainer(Container(), file... | [
201,
198,
9630,
796,
532,
16,
201,
198,
201,
198,
2,
13061,
366,
34924,
1,
12784,
201,
198,
201,
198,
2,
1351,
12784,
201,
198,
201,
198,
2,
1366,
1988,
12784,
201,
198,
201,
198,
2,
3651,
201,
198,
201,
198,
7753,
6601,
796,
13... | 2.544776 | 134 |
"""
Copyright 2018 EPAM Systems, Inc.
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... | [
37811,
198,
220,
220,
220,
15069,
2864,
14724,
2390,
11998,
11,
3457,
13,
628,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
28... | 3.502128 | 235 |
import time
b = time.time()
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
from math import log2, exp
a = time.time()
print('Imports complete in %.3f seconds' % (a-b))
print('\nGenerator Summary\n')
gen = Generator(max_resolution=512,max_channels=512,min_channels=... | [
11748,
640,
198,
65,
796,
640,
13,
2435,
3419,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
49736,
1330,
10638,
198,
6738,
10688,
1330,
2604,
17,
1... | 2.674528 | 212 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import scriptcontext as sc
try:
import compas # noqa: F401
import compas_rhino # noqa: F401
import compas_ags # noqa: F401
import compas_tna # noqa: F401
import compas_cloud ... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
11748,
4226,
22866,
355,
629,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
552,
... | 3.208163 | 245 |
#!/usr/bin/env python
# vim: set sw=4 ts=4 softtabstop=4 expandtab:
"""
Read invocation info file for smt-runner
and report which benchmarks are supported
by the CoralPrinter.
"""
# HACK: put smt2coral in search path
import os
import sys
_repo_root = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
900,
1509,
28,
19,
40379,
28,
19,
2705,
8658,
11338,
28,
19,
4292,
8658,
25,
198,
37811,
198,
220,
4149,
43219,
7508,
2393,
329,
895,
83,
12,
16737,
198,
220,
290,
98... | 2.651376 | 218 |
"""
The filterer object.
@author: Chris Scott
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import time
import logging
import numpy as np
import six
from six.moves import zip
from .filters import _filtering as filtering_c
from ..system.atoms import elements
from . i... | [
198,
37811,
198,
464,
1226,
83,
11882,
2134,
13,
198,
198,
31,
9800,
25,
5180,
4746,
198,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
48... | 3.539683 | 126 |
import sqlite3
connection = sqlite3.connect("Project.db")
cursor = connection.cursor()
S_user = cursor.execute(f"SELECT * FROM Current_login WHERE No = '{1}'")
record = S_user.fetchone()
user = record[0]
print(user)
try:
Spl_user = cursor.execute(f"SELECT * FROM Col_Pref_list where Username = '{user}'")
recor... | [
11748,
44161,
578,
18,
198,
198,
38659,
796,
44161,
578,
18,
13,
8443,
7203,
16775,
13,
9945,
4943,
198,
66,
21471,
796,
4637,
13,
66,
21471,
3419,
198,
50,
62,
7220,
796,
23493,
13,
41049,
7,
69,
1,
46506,
1635,
16034,
9236,
62,
... | 2.60989 | 182 |
class TestClass:
if __name__ == "__main__":
# Calling functions normally (Supported)
arr1 = []
for i in generator_func():
arr1.append(i)
assert arr1 == [1, 5, 10]
# -----------------------
arr2 = []
for i in generator_func_loop():
arr2.append(i)
assert arr2 == [0, 1, 2... | [
198,
4871,
6208,
9487,
25,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1303,
32677,
5499,
7685,
357,
48181,
8,
198,
220,
220,
220,
5240,
16,
796,
17635,
198,
220,
220,
220,
329,
1312,
287,
... | 2.345502 | 767 |
from fastapi import (
Depends,
FastAPI,
)
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
from quipper import (
models,
schemas,
services,
)
from quipper.database import (
SessionLocal,
engine,
)
# Create the tables
models.Base.metadata.create_all(bin... | [
6738,
3049,
15042,
1330,
357,
198,
220,
220,
220,
2129,
2412,
11,
198,
220,
220,
220,
12549,
17614,
11,
198,
8,
198,
6738,
3049,
15042,
13,
27171,
1574,
13,
66,
669,
1330,
23929,
12310,
2509,
1574,
198,
198,
6738,
44161,
282,
26599,
... | 2.60181 | 221 |
"""Adjacency list is a graph representation using array or a hash map"""
from collections import deque
def create_graph():
"""Create and insert vertices and paths"""
graph = AdjacencyListGraph()
graph.insert_vertex(0)
graph.insert_vertex(1)
graph.insert_vertex(2)
graph.insert_vertex(3)
... | [
37811,
2782,
30482,
1387,
1351,
318,
257,
4823,
10552,
1262,
7177,
393,
257,
12234,
3975,
37811,
198,
6738,
17268,
1330,
390,
4188,
628,
198,
198,
4299,
2251,
62,
34960,
33529,
198,
220,
220,
220,
37227,
16447,
290,
7550,
9421,
1063,
29... | 2.589888 | 356 |
#!/usr/bin/python
import json
import subprocess
import logging
from pyroute2 import IPDB
import sys
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("runme")
if __name__ == "__main__":
sys.exit(main())
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
33918,
198,
11748,
850,
14681,
198,
11748,
18931,
198,
6738,
279,
2417,
13192,
17,
1330,
314,
5760,
33,
198,
11748,
25064,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
26... | 2.82716 | 81 |
#!/usr/bin/env python3
import sys
import os
import argparse
import subprocess
import textwrap
import helpers
def parser(default_args, args):
"""Return parsed command line arguments."""
parser = argparse.ArgumentParser(
description=(
'Extracts the results of the NGWF CG optimisation steps ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
2420,
37150,
198,
11748,
49385,
628,
198,
198,
4299,
30751,
7,
12286,
62,
22046,
11,
264... | 2.151578 | 1,458 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Import required libraries
import time
import random
import datetime
import RPi.GPIO as GPIO
# Use BCM GPIO references instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# 1 step = 1/4 of full
'''
limit = 5
cur_rot = '... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
17267,
2672,
12782,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
4818,
8079,
198,
11748,
25812,
72,
13,
16960,
9399,
355,... | 2.11245 | 747 |
import spotipy
import argparse
sp = spotipy.Spotify()
parser = argparse.ArgumentParser()
parser.add_argument("term", help="The artist that you want to search for")
parser.add_argument("-c", "--count", help="The amount of results that you want, capped at 20", type=int)
args = parser.parse_args()
if args.count:
if ... | [
11748,
4136,
541,
88,
198,
11748,
1822,
29572,
198,
198,
2777,
796,
4136,
541,
88,
13,
32565,
1958,
3419,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
4354,
1600,
1037,
2625,
464,
... | 2.810127 | 158 |
"""
##Big Data Transfer Protocol
###What does it do
This protocol sends big data on a address (IPv4,port)
without worrying about pipe errors.
"""
__author__ = "Xcodz"
__version__ = "2021.2.24"
import abc
import socket
import time
import typing
from . import thread_control
default_buffer_size = 100000
def n... | [
37811,
198,
2235,
12804,
6060,
20558,
20497,
198,
21017,
2061,
857,
340,
466,
198,
198,
1212,
8435,
12800,
1263,
1366,
319,
257,
2209,
357,
4061,
85,
19,
11,
634,
8,
198,
19419,
18916,
546,
12656,
8563,
13,
198,
37811,
198,
198,
834,
... | 2.735701 | 2,675 |
# Copyright 2017 SrMouraSilva
#
# 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,... | [
2,
15069,
2177,
21714,
44,
280,
430,
15086,
6862,
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,
1... | 3.753012 | 166 |
from geo import *
from geo.routines import *
from matplotlib import *
from sys import *
from pylab import *
import os
import time
import pylab
size = (166, 141, 20)
print "loading image..."
data_3D = load_ind_property("BIG_SOFT_DATA_160_141_20.INC", -99, [0,1], size)
data = data_3D[0][:,:,0]
mask =... | [
6738,
40087,
1330,
1635,
201,
198,
6738,
40087,
13,
81,
448,
1127,
1330,
1635,
201,
198,
6738,
2603,
29487,
8019,
1330,
1635,
201,
198,
6738,
25064,
1330,
1635,
201,
198,
6738,
279,
2645,
397,
1330,
1635,
201,
198,
201,
198,
11748,
28... | 2.07772 | 579 |
# faa um programa q leia o ano de nascimento de um jovem e informe de
# acordo com sua idade se ele ainda vai se alistar ao servio miliar,
# se a hora de se alistar ou se ja passsou do tempo do alistamento
from datetime import date
hoje = date.today().year
print(hoje)
nascimento = int(input("Diga o ano que voce nasce... | [
2,
277,
7252,
23781,
1430,
64,
10662,
443,
544,
267,
281,
78,
390,
299,
3372,
3681,
78,
390,
23781,
474,
659,
76,
304,
4175,
68,
390,
198,
2,
936,
585,
78,
401,
424,
64,
4686,
671,
384,
9766,
257,
22261,
410,
1872,
384,
435,
472... | 2.572816 | 206 |
import os
import sys
import json
import time
import base64
import subprocess
DEBUG = 0
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Arg Error")
else:
instr = sys.argv[1]
sta1 = json_paser(instr)
sta2 = dmsl_runner(sta1)
print(sta2) | [
11748,
28686,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
2779,
2414,
198,
11748,
850,
14681,
628,
198,
30531,
796,
657,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
... | 2.084507 | 142 |
import chess
from chess import Board
from chess.engine import Score
def investigate(a: Score, b: Score, board: Board):
"""
determine if the difference between position A and B
is worth investigating for a puzzle.
"""
a_cp, a_mate = a.score(), a.mate()
b_cp, b_mate = b.score(), b.mate()
... | [
11748,
19780,
198,
6738,
19780,
1330,
5926,
198,
6738,
19780,
13,
18392,
1330,
15178,
628,
628,
198,
198,
4299,
9161,
7,
64,
25,
15178,
11,
275,
25,
15178,
11,
3096,
25,
5926,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
500... | 2.363426 | 432 |
from typing import List
def create_new_endtype(endtype_name: str, endtype_id: int, folder_name: str) -> int:
"""Create a new endtype
Args:
endtype_name (str): name
endtype_id (int): endtype id
folder_name (str): folder name
Returns:
int: endtype id
"""
def get_en... | [
6738,
19720,
1330,
7343,
628,
198,
4299,
2251,
62,
3605,
62,
437,
4906,
7,
437,
4906,
62,
3672,
25,
965,
11,
886,
4906,
62,
312,
25,
493,
11,
9483,
62,
3672,
25,
965,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
16447,
257,
649,... | 2.349671 | 1,367 |
from floodsystem.flood import highest_risk
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task 2G"""
stations= build_station_list()
for s in highest_risk(stations,dt=3,N=10,y=3):
print(s)
#works with whole list but takes v. long time
if __name__ == "__mai... | [
6738,
6947,
10057,
13,
2704,
702,
1330,
4511,
62,
19121,
198,
6738,
6947,
10057,
13,
17529,
7890,
1330,
1382,
62,
17529,
62,
4868,
198,
198,
4299,
1057,
33529,
198,
220,
220,
220,
37227,
42249,
329,
15941,
362,
38,
37811,
198,
220,
22... | 2.809859 | 142 |