content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
""" 5. Faa um programa que receba do usurio um arquivo texto e um caracter. Mostre na tela
quantas vezes aquele caractere ocorre dentro do arquivo.
"""
arquivo=open('CursoUdemyPython/exercicios/Lista6/arq.txt')
texto=arquivo.read()
carac=input('Informe um caractere: ')
ca=0
for c in texto:
if(c == carac):
... | [
37811,
642,
13,
376,
7252,
23781,
1430,
64,
8358,
1407,
7012,
466,
39954,
952,
23781,
610,
421,
23593,
2420,
78,
304,
23781,
1097,
7321,
13,
4042,
260,
12385,
256,
10304,
198,
40972,
292,
1569,
12271,
257,
4188,
293,
1097,
529,
567,
2... | 2.327381 | 168 |
#---------------------------------------------------------
# Superset specific config
#---------------------------------------------------------
ROW_LIMIT = 5000
SUPERSET_WEBSERVER_PORT = 8088
#---------------------------------------------------------
#---------------------------------------------------------
# Flask... | [
2,
43801,
12,
198,
2,
5200,
364,
316,
2176,
4566,
198,
2,
43801,
12,
198,
49,
3913,
62,
43,
3955,
2043,
796,
23336,
198,
198,
40331,
4877,
2767,
62,
8845,
4462,
1137,
5959,
62,
15490,
796,
41241,
23,
198,
2,
43801,
12,
198,
198,
... | 2.212664 | 1,674 |
import argparse
import cv2
import re
import numpy as np
import string
import PIL
import os,glob
import ntpath
import time
import matplotlib.pyplot as plt
from PIL import Image
from yad2k.models.keras_yolo import (preprocess_true_boxes, yolo_body,
yolo_eval, yolo_head, yolo_loss)
fr... | [
11748,
1822,
29572,
198,
11748,
269,
85,
17,
198,
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4731,
198,
11748,
350,
4146,
198,
11748,
28686,
11,
4743,
672,
198,
11748,
299,
83,
6978,
198,
11748,
640,
198,
11748,
2603,
... | 2.321875 | 320 |
"""
===================================================================
Plot time-frequency representations on topographies for MEG sensors
===================================================================
Both induced power and phase locking values are displayed.
"""
print(__doc__)
# Authors: Alexandre Gramfort <g... | [
37811,
198,
23926,
18604,
198,
43328,
640,
12,
35324,
24612,
319,
1353,
41480,
329,
337,
7156,
15736,
198,
23926,
18604,
198,
198,
10265,
18268,
1176,
290,
7108,
22656,
3815,
389,
9066,
13,
198,
37811,
198,
4798,
7,
834,
15390,
834,
8,
... | 2.883884 | 999 |
import bluetooth
import sys, os
import subprocess as sp
import datetime
from pushBulletForBluetooth import pushNotification
from makeReminderforBluetooth import Reminder
import csv
if __name__ == "__main__":
main()
| [
11748,
48208,
16271,
220,
198,
11748,
25064,
11,
28686,
198,
11748,
850,
14681,
355,
599,
198,
11748,
4818,
8079,
198,
6738,
4574,
33481,
1616,
1890,
38676,
16271,
1330,
4574,
3673,
2649,
198,
6738,
787,
8413,
5540,
1640,
38676,
16271,
13... | 3.393939 | 66 |
appendMe = '\nNew bit of information'
appendFile = open('example.txt','a')
appendFile.write(appendMe)
appendFile.close()
| [
33295,
5308,
796,
705,
59,
77,
3791,
1643,
286,
1321,
6,
201,
198,
201,
198,
33295,
8979,
796,
1280,
10786,
20688,
13,
14116,
41707,
64,
11537,
201,
198,
33295,
8979,
13,
13564,
7,
33295,
5308,
8,
201,
198,
33295,
8979,
13,
19836,
3... | 2.822222 | 45 |
from kafka import KafkaProducer
TOPIC_NAME = 'items'
KAFKA_SERVER = 'localhost:9092'
producer = KafkaProducer(bootstrap_servers=KAFKA_SERVER)
producer.send(TOPIC_NAME, b'Test Message!!!')
producer.flush()
| [
6738,
479,
1878,
4914,
1330,
46906,
11547,
2189,
628,
198,
35222,
2149,
62,
20608,
796,
705,
23814,
6,
198,
42,
8579,
25123,
62,
35009,
5959,
796,
705,
36750,
25,
44675,
17,
6,
198,
198,
18230,
2189,
796,
46906,
11547,
2189,
7,
18769,... | 2.64557 | 79 |
from datetime import datetime
import myfitnesspal
import sqlite_utils
import click
from . import utils
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
616,
69,
3659,
18596,
198,
11748,
44161,
578,
62,
26791,
198,
11748,
3904,
198,
6738,
764,
1330,
3384,
4487,
628,
198
] | 3.62069 | 29 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628
] | 3.333333 | 6 |
import pluginpackageRENAME
import preload
import os
if __name__ == "__main__":
preload.preload()
app = pluginpackageRENAME.app
app.static_folder = os.path.join(os.getcwd(), "html")
app.run()
| [
11748,
13877,
26495,
49,
1677,
10067,
198,
11748,
662,
2220,
198,
11748,
28686,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
662,
2220,
13,
3866,
2220,
3419,
198,
220,
220,
220,
598,
796,
1387... | 2.54878 | 82 |
import matplotlib.pyplot as plt
import numpy as np
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import json
from scipy.interpolate import interp1d
from data_utils import *
#draw_curve()
# (y_pred + 1.9600 * sigma)[::-1]]),
# alpha=.5, ... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
... | 2.204461 | 269 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AoiInfoDTO import AoiInfoDTO
from alipay.aop.api.domain.ItemStoreDTO import ItemStoreDTO
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
33918,
198,
198,
6738,
435,
541,
323,
13,
64,
404,
13,
15042,
13,
9979,
415,
13,
22973,
34184,
1187,
1330,
163... | 2.483871 | 93 |
import subprocess
import time
import logging
import os
import signal
log = logging.getLogger(__name__)
| [
11748,
850,
14681,
198,
11748,
640,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
6737,
628,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628
] | 3.483871 | 31 |
# drones/serializers.py file
from rest_framework import serializers
from drones.models import DroneCategory, Drone, Pilot, Competition
from django.contrib.auth.models import User
import drones.views
| [
2,
15382,
14,
46911,
11341,
13,
9078,
2393,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
15382,
13,
27530,
1330,
38959,
27313,
11,
38959,
11,
21697,
11,
27348,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
... | 3.942308 | 52 |
import learnables.py
# cration d'un objet Calamous
| [
201,
198,
11748,
2193,
2977,
13,
9078,
201,
198,
201,
198,
2,
1067,
341,
288,
6,
403,
26181,
316,
2199,
10877,
201
] | 2.545455 | 22 |
import random
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
############################ STATS input data ################################################
def return_nan_percentage(input_data):
"""
prints percentage of nan values in max. 3D sized array
Parameters
-----... | [
11748,
4738,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
9756,
628,
198,
14468,
7804,
4242,
37889,
5128,
1366,
1303,
29113,
7804,
4242,
21017,
628... | 2.752107 | 1,424 |
print(decode_output())
| [
628,
198,
198,
4798,
7,
12501,
1098,
62,
22915,
28955,
198
] | 2.454545 | 11 |
#!/usr/bin/env python
#
# This is the library for Grove Base Hat.
#
# Button Base Class
#
'''
## License
The MIT License (MIT)
Grove Base Hat for the Raspberry Pi, used to connect grove sensors.
Copyright (C) 2018 Seeed Technology Co.,Ltd.
Permission is hereby granted, free of charge, to any person... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
201,
198,
2,
770,
318,
262,
5888,
329,
24144,
7308,
10983,
13,
201,
198,
2,
201,
198,
2,
20969,
7308,
5016,
201,
198,
2,
201,
198,
201,
198,
7061,
6,
201,
198,
2235,
1378... | 3.482667 | 375 |
# Reverse a linked list
# Developer: Murillo Grubler
# https://www.hackerrank.com/challenges/reverse-a-linked-list/problem
# Time complexity of reverse function: O(n)
# Complete the reverse function below.
#
# For your reference:
#
# SinglyLinkedListNode:
# int data
# SinglyLinkedListNode next
#
def reverse(he... | [
2,
31849,
257,
6692,
1351,
198,
2,
23836,
25,
5921,
16111,
1902,
549,
1754,
198,
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
50188,
12,
64,
12,
25614,
12,
4868,
14,
45573,
198,
2,
3862,
13357,
286,
95... | 2.283019 | 424 |
import os
from PIL import Image
import random
from functools import wraps
from flask import jsonify
from flask_jwt_extended import get_current_user
from .artpiece import Artpiece
from .exceptions import InvalidUsage
from web.extensions import cache
#decorator to require admin_acccess for a route
"""
Return a list o... | [
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
4738,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
651,
62,
14421,
62,
7220,
198,
6738,... | 3.930769 | 130 |
import spconv
import torch
from torch import nn
| [
11748,
599,
42946,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
628,
628,
628
] | 3.533333 | 15 |
#!/usr/bin/env python
#
# Copyright (c) 2013 In-Q-Tel, Inc/Lab41, 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
220,
220,
15069,
357,
66,
8,
2211,
554,
12,
48,
12,
33317,
11,
3457,
14,
17822,
3901,
11,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
1378... | 3.148256 | 344 |
import copy
import logging
import math
import torch
from torch import nn
logger = logging.getLogger('global')
| [
11748,
4866,
198,
11748,
18931,
198,
11748,
10688,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
20541,
11537,
628,
628,
628,
198
] | 3.371429 | 35 |
# This Python file uses the following encoding: utf-8
import os; import sys; import urllib.request; from bs4 import BeautifulSoup; import wikipedia
from PyQt5.QtWebEngineWidgets import *; from PyQt5.QtGui import QIcon; from PyQt5.QtWidgets import *; from PyQt5.QtNetwork import QNetworkProxy
if __name__ == "__main__"... | [
2,
770,
11361,
2393,
3544,
262,
1708,
21004,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
26,
1330,
25064,
26,
1330,
2956,
297,
571,
13,
25927,
26,
422,
275,
82,
19,
1330,
23762,
50,
10486,
26,
1330,
47145,
11151,
198,
6738,
9485,
... | 2.783217 | 143 |
__author__ = 'petriau'
import requests # for HTTP requests
from bs4 import BeautifulSoup # for HTML parsing
url_SBM_FinanceProgress = 'http://sbm.gov.in/sbmreport/Report/Financial/SBM_StateReleaseAllocationincludingUnapproved.aspx'
# Function to return HTML parsed with BeautifulSoup from a POST request URL and param... | [
834,
9800,
834,
796,
705,
6449,
380,
559,
6,
198,
11748,
7007,
220,
1303,
329,
14626,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
220,
1303,
329,
11532,
32096,
198,
198,
6371,
62,
50,
12261,
62,
37,
14149,
32577,
796,
705,... | 1.401421 | 11,681 |
b=listprimenumber(100)
print b
count=3
for x in range(len(b)-count):
sum=0
for y in range(count):
sum+=b[x+y]
if sum in b:
print sum
#if b[x+0]+b[x+1]+b[x+2] in b:
# print b[x],b[x+1],b[x+2] | [
65,
28,
4868,
1050,
19027,
4494,
7,
3064,
8,
201,
198,
4798,
275,
201,
198,
9127,
28,
18,
201,
198,
201,
198,
1640,
2124,
287,
2837,
7,
11925,
7,
65,
13219,
9127,
2599,
201,
198,
220,
220,
220,
2160,
28,
15,
201,
198,
220,
220,
... | 1.662069 | 145 |
__author__ = 'ferrard'
# ---------------------------------------------------------------
# Imports
# ---------------------------------------------------------------
import scipy as sp
import random
import time
# ---------------------------------------------------------------
# Class - Graph
# -----------------------... | [
834,
9800,
834,
796,
705,
2232,
81,
446,
6,
198,
198,
2,
20368,
1783,
24305,
198,
2,
1846,
3742,
198,
2,
20368,
1783,
24305,
198,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
4738,
198,
11748,
640,
198,
198,
2,
20368,
1783,
243... | 4.059459 | 185 |
from flask import Flask, render_template, request
app = Flask(__name__)
if __name__ == '__main__':
app.run()
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
3419,
198
] | 2.809524 | 42 |
"""
Django settings for spartify project.
Generated by 'django-admin startproject' using Django 2.2.12.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | [
37811,
198,
35,
73,
14208,
6460,
329,
599,
433,
1958,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
362,
13,
17,
13,
1065,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198... | 2.237151 | 2,724 |
#!/usr/bin/env python
#
# tdwggeo2csv.py
#
# Description: convert TDWG plant distribution files out of the box to a single
# CSV file
#
# TODO: should create new id's for each entry and have a tdwg_code for
# each so we can maintain as much data as possbible
# TODO: we should probably include the original text files ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
41560,
86,
70,
469,
78,
17,
40664,
13,
9078,
198,
2,
198,
2,
12489,
25,
10385,
13320,
54,
38,
4618,
6082,
3696,
503,
286,
262,
3091,
284,
257,
2060,
198,
2,
44189,
239... | 2.902715 | 442 |
#!/usr/bin/python
"""
Program to read and parse haproxylogs to put them in shape to upload to DataLogger
The input date schould be sorted by date, and finished
the uploaded data will immediately split into TimeseriesArray, so no further data
of this day could be appended
"""
import os
import sys
import gzip
import logg... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
15167,
284,
1100,
290,
21136,
387,
1676,
87,
2645,
18463,
284,
1234,
606,
287,
5485,
284,
9516,
284,
6060,
11187,
1362,
198,
464,
5128,
3128,
5513,
426,
307,
23243,
416,
3128,
11,... | 2.576214 | 1,791 |
from enum import Enum
| [
6738,
33829,
1330,
2039,
388,
628,
628,
628,
198
] | 3.111111 | 9 |
import pandas as pd
from sklearn.linear_model import LogisticRegression
import mlflow
import mlflow.sklearn
import flask
model_path = "models/logit_games_v1"
model
= mlflow.sklearn.load_model(model_path)
app = flask.Flask(__name__)
data = {"success": False}
params = flask.request.args
if "G1" in params.keys():
new_row ... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
198,
11748,
285,
1652,
9319,
198,
11748,
285,
1652,
9319,
13,
8135,
35720,
198,
11748,
42903,
198,
19849,
62,
6978,
796,
366,
... | 2.424615 | 325 |
"""Handles websockets and asynchronous endpoints provided by Tornado instead
of Django, but use the Django model framework for a database ORM.
"""
import datetime
import functools
import json
import logging
import tornado.escape
from tornado.ioloop import IOLoop
import tornado.web
import tornado.websocket
from django... | [
37811,
12885,
829,
2639,
11603,
290,
39354,
886,
13033,
2810,
416,
48970,
2427,
198,
1659,
37770,
11,
475,
779,
262,
37770,
2746,
9355,
329,
257,
6831,
6375,
44,
13,
198,
37811,
198,
198,
11748,
4818,
8079,
198,
11748,
1257,
310,
10141,... | 3.133028 | 436 |
from models import Base, engine
Base.metadata.create_all(engine)
| [
198,
6738,
4981,
1330,
7308,
11,
3113,
198,
14881,
13,
38993,
13,
17953,
62,
439,
7,
18392,
8,
198
] | 3.473684 | 19 |
#!/usr/bin/env python3
""" DFaker Model
Based on the dfaker model: https://github.com/dfaker """
from keras.initializers import RandomNormal
from keras.layers import Input
from lib.model.nn_blocks import Conv2DOutput, UpscaleBlock, ResidualBlock
from .original import Model as OriginalModel, KerasModel
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
36323,
3110,
9104,
198,
220,
220,
220,
13403,
319,
262,
47764,
3110,
2746,
25,
3740,
1378,
12567,
13,
785,
14,
7568,
3110,
37227,
628,
198,
6738,
41927,
292,
13,
36733,
1134... | 3.344086 | 93 |
# encoding: utf-8
"""
@author: gallupliu
@contact: gallup-liu@hotmail.com
@version: 1.0
@license: Apache Licence
@file: train.py
@time: 2018/3/5 22:58
"""
import tensorflow as tf
from classify.dataset import data_utils
from sklearn.model_selection import train_test_split
from classify.model import TextCNN
if __n... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
37811,
198,
31,
9800,
25,
7976,
84,
489,
16115,
198,
31,
32057,
25,
7976,
929,
12,
4528,
84,
31,
8940,
4529,
13,
785,
198,
198,
31,
9641,
25,
352,
13,
15,
198,
31,
43085,
25,
24843,
10483,
... | 2.212451 | 1,012 |
from django.urls import path
from .views import FollowStatsViews, AuthorFollowViews
urlpatterns = [
# /authors/followers/ or ../following/
path("<str:follow_state>/", FollowStatsViews.as_view(), name="follows"),
# /authors/<author_username>/follow
path("<str:username>/follow/", AuthorFollowViews.as_vi... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
7281,
29668,
7680,
82,
11,
6434,
7155,
7680,
82,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
1303,
1220,
41617,
14,
27780,
364,
14,
393,
11485,
... | 2.85 | 120 |
from cone.app import get_root
from cone.app import security
from cone.app import testing
from cone.app.browser.login import login_view
from cone.app.browser.login import logout_view
from cone.tile import render_tile
from cone.tile.tests import TileTestCase
from webob.response import Response
from webob.exc import HTTPF... | [
6738,
27763,
13,
1324,
1330,
651,
62,
15763,
198,
6738,
27763,
13,
1324,
1330,
2324,
198,
6738,
27763,
13,
1324,
1330,
4856,
198,
6738,
27763,
13,
1324,
13,
40259,
13,
38235,
1330,
17594,
62,
1177,
198,
6738,
27763,
13,
1324,
13,
4025... | 3.747126 | 87 |
from tkinter import * | [
6738,
256,
74,
3849,
1330,
1635
] | 3.5 | 6 |
# workaround static linked python
from julia.api import Julia
__julia__ = Julia(compiled_modules=False)
import os
import sys
import subprocess
from .wrappers import apply
script_dir = os.path.dirname(os.path.realpath(__file__))
def install():
"""
Install Julia packages required for yao-framework.
"""
... | [
2,
46513,
9037,
6692,
21015,
198,
6738,
474,
43640,
13,
15042,
1330,
22300,
198,
834,
73,
43640,
834,
796,
22300,
7,
5589,
3902,
62,
18170,
28,
25101,
8,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
198,
673... | 2.992424 | 132 |
# TODO: Generalize this with the discordutil module, factor out oauth
import logging
from urllib.parse import urlencode
import requests
import json
from flask import request, redirect, session
from creds import get_creds
from config import config
from sessionutil import invalidate_session
# TODO: this should be c... | [
2,
16926,
46,
25,
3611,
1096,
428,
351,
262,
36446,
22602,
8265,
11,
5766,
503,
267,
18439,
198,
198,
11748,
18931,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
198,
11748,
7007,
198,
11748,
33918,
198,
198,
6738,
42... | 3.982143 | 112 |
#!/usr/bin/python3
"""transliteration of Kim Asendorf's pixel sorting script"""
from copy import copy
from random import random, gauss
from PIL import Image
from numpy import int32
from argparse import ArgumentParser
# PROGRAM CONSTANTS
# rgb(103, 105, 128)
BLACK_VALUE = int32(-10000000)
# rgb(164, 114, 128)
WHITE_V... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
37811,
7645,
17201,
341,
286,
6502,
1081,
18738,
69,
338,
17465,
29407,
4226,
37811,
198,
198,
6738,
4866,
1330,
4866,
198,
6738,
4738,
1330,
4738,
11,
31986,
1046,
198,
6738,
350,
4146,
... | 2.379722 | 2,594 |
import pandas as pd
from preprocessing import preprocess
from wordclouds import wordcloud, find_by_word
from sentiment_analysis import calculate_sentiment, find_by_sentiment
import nltk
import os
import tempfile
from topic_modelling import lda_topic_model, show_topics, show_example_sentences_by_topic
os.environ["MPLCO... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
662,
36948,
1330,
662,
14681,
198,
6738,
1573,
17721,
82,
1330,
1573,
17721,
11,
1064,
62,
1525,
62,
4775,
198,
6738,
15598,
62,
20930,
1330,
15284,
62,
34086,
3681,
11,
1064,
62,
1525,
62,
... | 3.618406 | 1,706 |
import copy
from finetune.errors import FinetuneError
from finetune.target_models.classifier import Classifier, ClassificationPipeline
from finetune.target_models.regressor import Regressor, RegressionPipeline
from finetune.base import BaseModel
| [
11748,
4866,
198,
198,
6738,
957,
316,
1726,
13,
48277,
1330,
4463,
316,
1726,
12331,
198,
6738,
957,
316,
1726,
13,
16793,
62,
27530,
13,
4871,
7483,
1330,
5016,
7483,
11,
40984,
47,
541,
4470,
198,
6738,
957,
316,
1726,
13,
16793,
... | 3.637681 | 69 |
from exceptions import ValueError
| [
6738,
13269,
1330,
11052,
12331,
198
] | 5.666667 | 6 |
# Copyright (c) 2020-2021 Matematyka dla Ciekawych wiata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softw... | [
2,
15069,
357,
66,
8,
12131,
12,
1238,
2481,
6550,
368,
265,
88,
4914,
288,
5031,
327,
494,
74,
707,
88,
354,
45967,
1045,
357,
4023,
1378,
66,
494,
74,
23368,
13,
291,
76,
13,
15532,
13,
489,
34729,
198,
2,
15069,
357,
66,
8,
... | 1.768943 | 13,910 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
from setuptools import setup
gh_run_number = os.environ.get("BUILD_NUMBER", None)
build_number = None if gh_run_number is None or gh_run_number == "" else gh_run_number
version = '0.2.2'
setup(
name='pytest-snowflake_bdd',
version=f"{v... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
40481,
82,
198,
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
198,
456,
62,
5143,
... | 2.372289 | 830 |
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 Nokia
import pytest
import logging
import os
from onapsdk.dmaap.dmaap import Dmaap
logging.basicConfig(level=os.environ.get("LOGLEVEL", "DEBUG"))
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
15069,
12131,
26182,
198,
11748,
12972,
9288,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
319,
1686,
34388,
13,
67,
2611,
499,
13,
67,
2611,
499,... | 2.833333 | 72 |
# Generated by Django 2.2.8 on 2020-03-25 13:50
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
23,
319,
12131,
12,
3070,
12,
1495,
1511,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import numpy as np
import torch
from utils.helpers import process_state, device
def make_epsilon_greedy_policy(estimator, nA):
"""
:param estimator: model that returns q values for a given statem/action pair
:param nA: number of actions in the environment
:return: A function that takes in a state and ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
3384,
4487,
13,
16794,
364,
1330,
1429,
62,
5219,
11,
3335,
198,
198,
4299,
787,
62,
538,
18217,
261,
62,
16694,
4716,
62,
30586,
7,
395,
320,
1352,
11,
299,
32,
2599,
198... | 2.421053 | 380 |
__name__ = 'onsets'
__version__ = '1.5.1'
__package__ = 'phonotactics'
# imports
#some import machinery checking and manipulations...
#import sys
#import os
#from os import path
#if '__file__' in dir():
# __mod_path = path.dirname(__file__)
# if __mod_path not in sys.path:
# sys.path.app... | [
201,
198,
201,
198,
834,
3672,
834,
796,
705,
684,
1039,
6,
201,
198,
834,
9641,
834,
796,
705,
16,
13,
20,
13,
16,
6,
201,
198,
834,
26495,
834,
796,
705,
746,
261,
313,
529,
873,
6,
201,
198,
201,
198,
2,
17944,
201,
198,
... | 2.828346 | 635 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Aptitudetech and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
| [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
13130,
11,
317,
457,
26331,
316,
3055,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
... | 3.217949 | 78 |
from collections import deque
T = int(input())
for t in range(T):
n = int(input())
lengths = deque(map(int, input().split()))
top = max(lengths)
while len(lengths) > 0:
left = lengths[0]
right = lengths[-1]
if (right >= left) and (right <= top):
top = right
lengths.pop()
elif (left >= right) and (lef... | [
6738,
17268,
1330,
390,
4188,
198,
198,
51,
796,
493,
7,
15414,
28955,
198,
1640,
256,
287,
2837,
7,
51,
2599,
198,
197,
77,
796,
493,
7,
15414,
28955,
198,
197,
13664,
82,
796,
390,
4188,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
... | 2.326316 | 190 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
| [
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
14,
260,
7501,
25,
4023,
13,
65,
48274,
1600,
366,
4023,
62,
17474,
4943,
628
] | 2.413793 | 29 |
import stokepy as sp
import numpy as np
# instantiate class
fmc = sp.FiniteMarkovChain()
# create initial distribution vector
phi = np.array([0, 0, 1, 0, 0])
# generate Markov chain with no boundary conditions
fmc.gen_from_params(phi, p = 0.6, num_states = 5, dim = 1)
# apply boundary condition: absorbing, reflecti... | [
11748,
336,
2088,
9078,
355,
599,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
9113,
9386,
1398,
198,
69,
23209,
796,
599,
13,
37,
9504,
9704,
709,
35491,
3419,
198,
198,
2,
2251,
4238,
6082,
15879,
198,
34846,
796,
45941,
13,
1... | 2.645477 | 409 |
import doctest
import sys
import unittest
import r2dto
from tests.test_acceptance import AcceptanceTests
from tests.test_base_serializer import BaseSerializerTests
__all__ = ["doctest", "sys", "unittest", "r2dto", "AcceptanceTests", "BaseSerializerTests"]
try:
import pep8
except ImportError:
print("WARNING: ... | [
11748,
10412,
395,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
198,
11748,
374,
17,
67,
1462,
198,
6738,
5254,
13,
9288,
62,
13635,
590,
1330,
21699,
590,
51,
3558,
198,
6738,
5254,
13,
9288,
62,
8692,
62,
46911,
7509,
1330,
... | 2.21519 | 553 |
"""
Module that defines the interface between the `manager` (i.e Django) and the `broker` (i.e. RabbitMQ).
Defines three functions involved in a job's lifecycle:
- `dispatch_job` - send a job to a queue
- `update_job` - update the status of a job by checking it's (intermediate) result
- `check_job` - for a parent job... | [
37811,
198,
26796,
326,
15738,
262,
7071,
1022,
262,
4600,
37153,
63,
357,
72,
13,
68,
37770,
8,
290,
262,
4600,
7957,
6122,
63,
357,
72,
13,
68,
13,
25498,
49215,
737,
198,
198,
7469,
1127,
1115,
5499,
2950,
287,
257,
1693,
338,
... | 2.302603 | 4,610 |
"""Data loading/munging utilities.
This will need to leverage a lot of existing stuff
(e.g. numpy.genfromtxt)...
"""
import logging
| [
37811,
6601,
11046,
14,
76,
2150,
278,
20081,
13,
198,
198,
1212,
481,
761,
284,
16094,
257,
1256,
286,
4683,
3404,
198,
7,
68,
13,
70,
13,
299,
32152,
13,
5235,
6738,
14116,
26513,
198,
37811,
198,
11748,
18931,
628,
628
] | 3.317073 | 41 |
#!/bin/python
# coding: utf-8
import argparse
import time
import collections
import os
import sys
import torch
import torch.nn
from torch.autograd import Variable
import torch.nn as nn
import numpy as np
from models_grad import RNN, GRU
from models_grad import make_model as TRANSFORMER
parser = argparse.ArgumentPars... | [
2,
48443,
8800,
14,
29412,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
11748,
17268,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
198,
6738,
28034,
... | 2.691943 | 3,798 |
import FWCore.ParameterSet.Config as cms
run3_nanoAOD_devel = cms.Modifier()
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
5143,
18,
62,
77,
5733,
32,
3727,
62,
2934,
626,
796,
269,
907,
13,
5841,
7483,
3419,
198
] | 2.516129 | 31 |
# IDLEX EXTENSION
## """
## Copyright(C) 2011-2012 The Board of Trustees of the University of Illinois.
## All rights reserved.
##
## Developed by: Roger D. Serwy
## University of Illinois
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of thi... | [
2,
4522,
2538,
55,
27489,
16938,
2849,
198,
2235,
220,
220,
220,
37227,
198,
2235,
220,
220,
220,
15069,
7,
34,
8,
2813,
12,
6999,
383,
5926,
286,
9870,
2841,
286,
262,
2059,
286,
9486,
13,
198,
2235,
220,
220,
220,
1439,
2489,
10... | 3.100376 | 797 |
GPIO_CON_1_BUT_1 = 10
GPIO_CON_1_BUT_2 = 9
GPIO_CON_2_BUT_1 = 11
GPIO_CON_2_BUT_2 = 14
GPIO_BUZZER = 15
| [
16960,
9399,
62,
10943,
62,
16,
62,
47526,
62,
16,
796,
838,
198,
16960,
9399,
62,
10943,
62,
16,
62,
47526,
62,
17,
796,
860,
198,
16960,
9399,
62,
10943,
62,
17,
62,
47526,
62,
16,
796,
1367,
198,
16960,
9399,
62,
10943,
62,
1... | 1.704918 | 61 |
#!/bin/python
# -*- coding: utf-8 -*-
''''''
import sys
from ctrls.Tester import Tester
from models.exampleModel import exampleModel
if __name__ == '__main__':
sys.exit(main())
| [
2,
48443,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
39115,
7061,
198,
198,
11748,
25064,
198,
6738,
269,
2213,
7278,
13,
51,
7834,
1330,
309,
7834,
198,
6738,
4981,
13,
20688,
17633,
... | 2.628571 | 70 |
from tempfile import TemporaryDirectory
from typing import Any, Dict, Tuple
import datasets
import flair
import numpy as np
import pytest
import torch
from flair.data import Corpus
from numpy import typing as nptyping
from embeddings.data.data_loader import HuggingFaceDataLoader
from embeddings.data.dataset import Hu... | [
6738,
20218,
7753,
1330,
46042,
43055,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
309,
29291,
198,
198,
11748,
40522,
198,
11748,
37457,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
28034,
198,
6738,
37457... | 2.820375 | 746 |
# Prosz zaimplementowa funkcj, ktra otrzymuje na wejciu posortowan niemalejco tablic A
# o rozmiarze n oraz liczb x i sprawdza, czy x wystpuje w A. Jeli tak, to zwraca najmniejszy indeks,
# pod ktrym x wystpuje.
T = [0, 1, 2, 3, 4, 5, 5, 5, 6]
for i in range(len(T)):
print(i, binary_search(T, 0, len(T) - 1, T[i]... | [
2,
27631,
89,
1976,
1385,
26908,
8455,
46212,
66,
73,
11,
479,
9535,
267,
2213,
89,
4948,
84,
18015,
12385,
356,
73,
979,
84,
1426,
419,
45197,
37628,
10144,
73,
1073,
7400,
677,
317,
198,
2,
267,
686,
89,
11632,
283,
2736,
299,
3... | 2.006211 | 161 |
import re, io, os, sys
from nltk import word_tokenize
from argparse import ArgumentParser
# Allow package level imports in module
script_dir = os.path.dirname(os.path.realpath(__file__))
lib = os.path.abspath(script_dir + os.sep + "..")
sys.path.append(lib)
from conll_reader import space_join, text2conllu
if __name_... | [
11748,
302,
11,
33245,
11,
28686,
11,
25064,
198,
6738,
299,
2528,
74,
1330,
1573,
62,
30001,
1096,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
2,
22507,
5301,
1241,
17944,
287,
8265,
198,
12048,
62,
15908,
796,
28686,
13,
6978,
... | 2.223273 | 1,057 |
"""
Contributors can be viewed at:
http://svn.secondlife.com/svn/linden/projects/2008/pyogp/lib/base/trunk/CONTRIBUTORS.txt
$LicenseInfo:firstyear=2008&license=apachev2$
Copyright 2009, Linden Research, Inc.
Licensed under the Apache License, Version 2.0.
You may obtain a copy of the License at:
http://www.apa... | [
198,
37811,
198,
37146,
669,
460,
307,
9569,
379,
25,
198,
4023,
1378,
21370,
77,
13,
12227,
6042,
13,
785,
14,
21370,
77,
14,
75,
521,
268,
14,
42068,
14,
11528,
14,
9078,
519,
79,
14,
8019,
14,
8692,
14,
2213,
2954,
14,
10943,
... | 2.73057 | 386 |
from enum import Enum
from typing import List, Optional
from pydantic import BaseModel, HttpUrl
| [
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
367,
29281,
28165,
628,
628
] | 3.703704 | 27 |
import pytest
from wtforms.validators import symbol_required
from wtforms.validators import ValidationError
| [
11748,
12972,
9288,
198,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
6194,
62,
35827,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
3254,
24765,
12331,
628,
198
] | 3.7 | 30 |
# using the input() function
message = input("Tell me something, and I'll repeat it!")
print(message) | [
2,
1262,
262,
5128,
3419,
2163,
198,
198,
20500,
796,
5128,
7203,
24446,
502,
1223,
11,
290,
314,
1183,
9585,
340,
2474,
8,
198,
4798,
7,
20500,
8
] | 3.642857 | 28 |
from src.Node import Node
from src.Nodes import Block
from src.SymbolTable import SymbolTable
| [
6738,
12351,
13,
19667,
1330,
19081,
198,
6738,
12351,
13,
45,
4147,
1330,
9726,
198,
6738,
12351,
13,
13940,
23650,
10962,
1330,
38357,
10962,
198
] | 3.76 | 25 |
"""Get information about this package."""
def info(system):
"""Get information about this package."""
import googledevices.utils.const as package
print("Projectname: ", package.NAME)
print("Version: ", package.VERSION)
print("GitHub link: ", package.URLS.get("github"))
print("PyPi link... | [
37811,
3855,
1321,
546,
428,
5301,
526,
15931,
628,
198,
4299,
7508,
7,
10057,
2599,
198,
220,
220,
220,
37227,
3855,
1321,
546,
428,
5301,
526,
15931,
198,
220,
220,
220,
1330,
467,
519,
992,
1990,
1063,
13,
26791,
13,
9979,
355,
5... | 2.57931 | 290 |
arr = [1, 0, -2, 5, -4, 1, 9, -2]
print(check(arr))
| [
198,
3258,
796,
685,
16,
11,
657,
11,
532,
17,
11,
642,
11,
532,
19,
11,
352,
11,
860,
11,
532,
17,
60,
220,
198,
4798,
7,
9122,
7,
3258,
4008,
198
] | 1.6875 | 32 |
#! /usr/bin/env python
import argparse
import pandas as pd
import numpy as np
if __name__ == '__main__':
main()
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
... | 2.541667 | 48 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 3.843902 | 205 |
# test __init__ file
| [
2,
1332,
11593,
15003,
834,
2393,
198
] | 3 | 7 |
import re
PREFIX = {}
NSMAP = {}
OIM_COMMON_RESERVED_PREFIXES = {}
OIM_COMMON_RESERVED_PREFIX_MAP = {}
buildPrefixMaps()
LINK_RESERVED_URI_MAP = {
"_": LinkGroup.default,
"footnote": LinkType.footnote,
"explanatoryFact": LinkType.explanatoryFact,
}
| [
11748,
302,
198,
198,
47,
31688,
10426,
796,
23884,
198,
8035,
33767,
796,
23884,
198,
46,
3955,
62,
9858,
27857,
62,
19535,
1137,
53,
1961,
62,
47,
31688,
10426,
1546,
796,
23884,
198,
46,
3955,
62,
9858,
27857,
62,
19535,
1137,
53,
... | 2.226891 | 119 |
try:
from .helpers import config, management, xp, spam
except ImportError:
import helpers.config, helpers.management, helpers.xp, helpers.spam
import time
import discord
from discord.ext import commands
from discord.commands import slash_command | [
28311,
25,
198,
220,
220,
220,
422,
764,
16794,
364,
1330,
4566,
11,
4542,
11,
36470,
11,
18084,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1330,
49385,
13,
11250,
11,
49385,
13,
27604,
11,
49385,
13,
42372,
11,
49385,
13,
27... | 3.695652 | 69 |
import logging
import os
import subprocess
import sys
import yaml
files_dir = ""
# --- General util commands ---
# --- File and path handling commands ---
| [
11748,
18931,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
11748,
331,
43695,
198,
198,
16624,
62,
15908,
796,
13538,
628,
198,
2,
11420,
3611,
7736,
9729,
11420,
628,
628,
198,
2,
11420,
9220,
290,
3108,
9041... | 3.630435 | 46 |
# -*- coding: utf-8 -*-
import re
import calendar
import datetime, time
from datetime import timedelta
import urllib.request
import requests, json
from http.cookiejar import CookieJar
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
from pandas import DataFrame
import pandas.io.sql as pdsql
from ma... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
11748,
11845,
198,
198,
11748,
4818,
8079,
11,
640,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
7007,
... | 2.896341 | 164 |
import csv
import os
import math
import logging
import traceback
import requests
import sys
from collections import namedtuple
from optparse import make_option
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.db i... | [
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
10688,
198,
11748,
18931,
198,
11748,
12854,
1891,
198,
11748,
7007,
198,
11748,
25064,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
2172,
29572,
1330,
787,
62,
18076,
198,
6738,
42... | 2.602817 | 8,165 |
# Author: Kim Hammar <kimham@kth.se> KTH 2018
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import TweetTokenizer
from nltk.tag.perceptron import PerceptronTagger
import nltk
import emoji
nltk.download('averaged_perceptron_tagger')
nltk.download('stopwords')
nltk.download... | [
2,
6434,
25,
6502,
4345,
3876,
1279,
74,
320,
2763,
31,
74,
400,
13,
325,
29,
509,
4221,
2864,
198,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
6738,
299,
2528,
74,
13,
927,
1330,
9678,
7934,
43,
368,
6... | 2.743802 | 121 |
from .utils.handler.config import ConfigHandler | [
6738,
764,
26791,
13,
30281,
13,
11250,
1330,
17056,
25060
] | 4.7 | 10 |
from ._core import Collection, local, task
ns = Collection("start")
ns.add_task(start_all)
ns.add_task(start_main)
ns.add_task(start_minimal)
| [
6738,
47540,
7295,
1330,
12251,
11,
1957,
11,
4876,
628,
628,
198,
198,
5907,
796,
12251,
7203,
9688,
4943,
198,
5907,
13,
2860,
62,
35943,
7,
9688,
62,
439,
8,
198,
5907,
13,
2860,
62,
35943,
7,
9688,
62,
12417,
8,
198,
5907,
13,... | 2.722222 | 54 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 17 23:14:28 2018
@author: Akihiro Inui
"""
def rolloff(input_power_spectrum: list, param: float=0.85) -> float:
"""
Spectral Rolloff
:param input_power_spectrum: power spectrum in list
:param param: threadshold for roll off
:... | [
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,
7031,
1526,
1596,
2242,
25,
1415,
25,
2078,
2864,
198,
198,
31,
9800,
25,
48663,
49907,
5... | 2.674699 | 332 |
#!/usr/bin/env python
from lib2to3.main import main
import sys
import os
sys.exit(main("lib2to3.fixes"))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
6738,
9195,
17,
1462,
18,
13,
12417,
1330,
1388,
201,
198,
11748,
25064,
201,
198,
11748,
28686,
201,
198,
201,
198,
17597,
13,
37023,
7,
12417,
7203,
8019,
17,
1462,
18,
13,
42... | 2.434783 | 46 |
"""
Afterglow Core: photometric calibration job schemas
"""
from typing import List as TList
from marshmallow.fields import Integer, List, Nested
from ..job import JobSchema, JobResultSchema
from ..field_cal import FieldCalSchema, FieldCalResultSchema
from ..photometry import PhotSettingsSchema
from .source_extracti... | [
37811,
198,
3260,
4743,
322,
7231,
25,
2825,
16996,
36537,
1693,
3897,
5356,
198,
37811,
198,
198,
6738,
19720,
1330,
7343,
355,
309,
8053,
198,
198,
6738,
22397,
42725,
13,
25747,
1330,
34142,
11,
7343,
11,
399,
7287,
198,
198,
6738,
... | 3.627119 | 118 |
#import unittest
#case 1
t = Node(4)
#binary_insert(t, Node(2))
#binary_insert(t, Node(7))
#binary_insert(t, Node(3))
#binary_insert(t, Node(6))
#binary_insert(t, Node(2))
#binary_insert(t, Node(5))
#insertIntoBinaryTreeWithAGivenIntArray(t, [4, 2, 6, 3, 1, 5])
t.left = Node(2)
t.right = Node(6)
t.left.left = Node... | [
2,
11748,
555,
715,
395,
628,
628,
198,
2,
7442,
352,
198,
83,
796,
19081,
7,
19,
8,
198,
2,
39491,
62,
28463,
7,
83,
11,
19081,
7,
17,
4008,
198,
2,
39491,
62,
28463,
7,
83,
11,
19081,
7,
22,
4008,
198,
2,
39491,
62,
28463,... | 2.089686 | 223 |
expected_output = {
"interface": {
"GigabitEthernet0/0/0": {
"interface_is_ok": "YES",
"ip_address": "10.105.44.23",
"method": "other",
"protocol": "up",
"status": "up"
},
"GigabitEthernet0/0/1": {
"interface_is_ok": "YE... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
39994,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
38,
328,
29968,
36,
490,
3262,
15,
14,
15,
14,
15,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
22... | 1.615803 | 2,759 |
from common import is_connection_ok
import paramiko
"""
execute_ssh(host, port, username, password, cmd)
"""
| [
6738,
2219,
1330,
318,
62,
38659,
62,
482,
198,
11748,
5772,
12125,
198,
198,
37811,
198,
41049,
62,
45824,
7,
4774,
11,
2493,
11,
20579,
11,
9206,
11,
23991,
8,
198,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.878049 | 41 |
'''
'''
HEADERS_IPHONE = {'user-agent': (
'Mozilla/5.0 '
'(iPhone; CPU iPhone OS 6_0 like Mac OS X) '
'AppleWebKit/536.26 (KHTML, like Gecko) '
'Version/6.0 Mobile/10A5376e Safari/8536.25'
)}
HEADERS_CHROME = {'user-agent': (
'Mozilla/5.0 (X11; Linux x86_64) '
'AppleWebKit/537.36 (KHTML, like... | [
7061,
6,
198,
198,
7061,
6,
198,
198,
37682,
4877,
62,
4061,
39,
11651,
796,
1391,
6,
7220,
12,
25781,
10354,
357,
198,
220,
220,
220,
705,
44,
8590,
5049,
14,
20,
13,
15,
705,
198,
220,
220,
220,
29513,
37032,
26,
9135,
7133,
7... | 2.016216 | 185 |
from ped_core import editor_common
import io
import pprint
import os
import curses
import curses.ascii
import time
import re
from ped_core import keymap
from ped_core import keytab
from ped_core import clipboard
from ped_test_util import read_str, match_attr, undo_all, window_pos, play_macro, validate_mark, validate_sc... | [
6738,
7190,
62,
7295,
1330,
5464,
62,
11321,
198,
11748,
33245,
198,
11748,
279,
4798,
198,
11748,
28686,
198,
11748,
43878,
198,
11748,
43878,
13,
292,
979,
72,
198,
11748,
640,
198,
11748,
302,
198,
6738,
7190,
62,
7295,
1330,
1994,
... | 3.447619 | 105 |
from rsmtpd.response.action import OK
from rsmtpd.response.base_response import BaseResponse
| [
6738,
374,
5796,
83,
30094,
13,
26209,
13,
2673,
1330,
7477,
198,
6738,
374,
5796,
83,
30094,
13,
26209,
13,
8692,
62,
26209,
1330,
7308,
31077,
628
] | 3.481481 | 27 |
import datetime
import re
from django.contrib.sites.models import Site
from django.core import mail
from django.test import TestCase
from django.urls import reverse
from django.utils import timezone
import numpy as np
import pandas as pd
import pytz
from qatrack.qa.tests import utils
from qatrack.qatrack_core.seriali... | [
11748,
4818,
8079,
198,
11748,
302,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
27530,
1330,
14413,
198,
6738,
42625,
14208,
13,
7295,
1330,
6920,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
1... | 3.167883 | 137 |
from django.conf.urls import patterns, url
from app.blog import views as blog_views
urlpatterns = [
#django url
url(r'^$', blog_views.index, name='blog_index'),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
7572,
11,
19016,
198,
198,
6738,
598,
13,
14036,
1330,
5009,
355,
4130,
62,
33571,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
1303,
28241,
14208,
19016,
198,
220,
220,
... | 2.557143 | 70 |
# -*- coding: utf-8 -*-
from os import environ
from typing import Optional, Dict, Any, Type
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
19720,
1330,
32233,
11,
360,
713,
11,
4377,
11,
5994,
628,
628,
198
] | 2.771429 | 35 |
try:
s = raw_input("Enter score between 0.0 and 1.0: ")
score = float(s)
if score < 0 or score > 1:
raise Exception
except ValueError:
print "You didn't even enter a number"
except:
print "Not a possible score."
else:
if score >= 0.9:
print "A"
elif score >= 0.8:
prin... | [
28311,
25,
198,
220,
220,
220,
264,
796,
8246,
62,
15414,
7203,
17469,
4776,
1022,
657,
13,
15,
290,
352,
13,
15,
25,
366,
8,
198,
220,
220,
220,
4776,
796,
12178,
7,
82,
8,
198,
220,
220,
220,
611,
4776,
1279,
657,
393,
4776,
... | 2.096154 | 208 |
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 150)
voices = engine.getProperty('voices')
engine.setProperty("voice", 'english_rp+f4')
talk("My name is robot leena")
| [
11748,
12972,
83,
912,
87,
18,
198,
198,
18392,
796,
12972,
83,
912,
87,
18,
13,
15003,
3419,
198,
18392,
13,
2617,
21746,
10786,
4873,
3256,
6640,
8,
198,
13038,
1063,
796,
3113,
13,
1136,
21746,
10786,
13038,
1063,
11537,
198,
198,
... | 2.676056 | 71 |
import logging
| [
11748,
18931,
628,
198
] | 4.25 | 4 |