content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
#
# -------------------------------------------------------------------------
# Copyright (c) 2019 AT&T Intellectual Property
#
# 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
#
# ... | [
2,
198,
2,
16529,
45537,
198,
2,
220,
220,
15069,
357,
66,
8,
13130,
5161,
5,
51,
42443,
14161,
198,
2,
198,
2,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
345... | 4.106383 | 188 |
import tensorflow as tf
x1_data=[73.,93.,89.,96.,73.]
x2_data=[80.,88.,91.,98.,66.]
x3_data=[75.,93.,90.,100.,70.]
y_data=[152.,185.,180.,196.,142.]
x1=tf.placeholder(tf.float32)
x2=tf.placeholder(tf.float32)
x3=tf.placeholder(tf.float32)
Y=tf.placeholder(tf.float32)
w1=tf.Variable(tf.random_normal([1]),name='weight... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
87,
16,
62,
7890,
41888,
4790,
1539,
6052,
1539,
4531,
1539,
4846,
1539,
4790,
8183,
198,
87,
17,
62,
7890,
41888,
1795,
1539,
3459,
1539,
6420,
1539,
4089,
1539,
2791,
8183,
198,
87,
18... | 2.128205 | 468 |
import pandas as pd
import nltk
import re
from nltk.stem import wordnet
from nltk import pos_tag
from nltk import word_tokenize
from datetime import datetime
data = pd.read_csv('traindata.csv', encoding='utf-8')
train_counter = 0
if __name__ == '__main__':
print("Time now: " + str(datetime.now()))
print(data.... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
2528,
74,
198,
11748,
302,
198,
6738,
299,
2528,
74,
13,
927,
1330,
1573,
3262,
198,
6738,
299,
2528,
74,
1330,
1426,
62,
12985,
198,
6738,
299,
2528,
74,
1330,
1573,
62,
30001,
1096... | 3.367647 | 272 |
import io
import logging
import queue
from collections import namedtuple
import torch
import zmq
from tensor_twister.status_codes import StatusCode
UnpackedMessage = namedtuple("UnpackedMessage", ["tensor", "name", "ip"])
def serve(host: str, port: int):
"""
Listen for incoming tensor data from clients. P... | [
11748,
33245,
198,
11748,
18931,
198,
11748,
16834,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
28034,
198,
11748,
1976,
76,
80,
198,
198,
6738,
11192,
273,
62,
4246,
1694,
13,
13376,
62,
40148,
1330,
12678,
10669,
628,
19... | 2.336283 | 791 |
#! /usr/bin/env python
# Copyright (c) 2014 KU Leuven, ESAT-STADIUS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notic... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
1946,
509,
52,
1004,
84,
574,
11,
13380,
1404,
12,
2257,
2885,
40,
2937,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
... | 2.809228 | 1,127 |
"""
This problem was asked by Twitter.
Implement an autocomplete system. That is, given a query string s and a set of all possible query strings, return all strings in the set that have s as a prefix.
For example, given the query string de and the set of strings [dog, deer, deal], return [deer, deal].
Hint: Try prep... | [
37811,
198,
1212,
1917,
373,
1965,
416,
3009,
13,
198,
198,
3546,
26908,
281,
1960,
42829,
6677,
1080,
13,
1320,
318,
11,
1813,
257,
12405,
4731,
264,
290,
257,
900,
286,
477,
1744,
12405,
13042,
11,
1441,
477,
13042,
287,
262,
900,
... | 3.671875 | 128 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 09.08.2018
This is basically a python port of of a script by berwinter
https://github.com/berwinter/uvr1611/blob/master/lib/backend/blnet-connection.inc.php
author: Niels
"""
import struct
from datetime import datetime
# Parser constant
# 1 bit
DIGITAL_ON ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7769,
13,
2919,
13,
7908,
198,
198,
1212,
318,
6209,
257,
21015,
2493,
286,
286,
257,
4226,
4... | 2.334448 | 299 |
from typing import Optional
from typing import List
from fastapi import APIRouter, Depends, Body
from models import User, Content, Node, Group, ExternalContent
from routers import get_current_user, admin_only
from schemas import NodeAdd, NodeEdit, NodeFind
#
router = APIRouter()
| [
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
2129,
2412,
11,
12290,
198,
198,
6738,
4981,
1330,
11787,
11,
14041,
11,
19081,
11,
4912,
11,
34579,
19746,
198,
6738,
411... | 3.617284 | 81 |
# https://programmers.co.kr/learn/courses/30/lessons/1845
print(solution([3,1,2,3]))
print(solution([3,3,3,2,2,4]))
print(solution([3,3,3,2,2,2])) | [
2,
3740,
1378,
23065,
11056,
13,
1073,
13,
38584,
14,
35720,
14,
66,
39975,
14,
1270,
14,
1203,
684,
14,
1507,
2231,
198,
198,
4798,
7,
82,
2122,
26933,
18,
11,
16,
11,
17,
11,
18,
60,
4008,
198,
4798,
7,
82,
2122,
26933,
18,
... | 1.934211 | 76 |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
33160,
1058,
33,
6532,
12,
22405,
12,
12041,
25,
19935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
4943,
198,
2,
345,
743,... | 3.370031 | 327 |
from itertools import count
from tqdm import tqdm
from neodroid.environments.droid_environment import VectorUnityEnvironment
| [
6738,
340,
861,
10141,
1330,
954,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
6738,
497,
375,
3882,
13,
268,
12103,
13,
67,
3882,
62,
38986,
1330,
20650,
35955,
31441,
628,
198
] | 3.583333 | 36 |
# -*- coding: utf-8 -*-
import re
import copy
import os
import string
import xlrd
import pickle
from .get_tokens import *
keywords_0 = ('auto', 'typedf', 'const', 'extern', 'register', 'static', 'volatile', 'continue', 'break',
'default', 'return', 'goto', 'else', 'case')
keywords_1 = ('catch', 'sizeof... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
302,
198,
11748,
4866,
198,
11748,
28686,
198,
11748,
4731,
198,
11748,
2124,
75,
4372,
198,
11748,
2298,
293,
198,
6738,
764,
1136,
62,
83,
482,
641,
1330,
1635,... | 2.143247 | 1,466 |
"""
Copyright (c) 2020 Flatipie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | [
201,
198,
37811,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15069,
357,
66,
8,
12131,
21939,
541,
494,
201,
198,
201,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
... | 3.291777 | 377 |
import os
import shutil
import xml.dom.minidom
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
35555,
13,
3438,
13,
1084,
312,
296,
198
] | 2.9375 | 16 |
"""
Contains path planning logic.
"""
import math
import numpy as np
from heapq import heappush, heappop
def heuristics(a, b):
"""Heuristics function using the Euclidian Distance."""
weight = 1.0
x1, y1 = a
x2, y2 = b
distance = np.sqrt(np.square(x2-x1) + np.square(y2-y1))
# distance = math.... | [
37811,
198,
4264,
1299,
3108,
5410,
9156,
13,
198,
37811,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
24575,
80,
1330,
339,
1324,
1530,
11,
339,
1324,
404,
628,
198,
4299,
339,
333,
3969,
7,
64,
11,
275,
2599,
... | 2.398693 | 153 |
from libcity.model.traffic_od_prediction.GEML import GEML
__all__ = [
"GEML"
]
| [
6738,
9195,
19205,
13,
19849,
13,
9535,
2108,
62,
375,
62,
28764,
2867,
13,
38,
3620,
43,
1330,
402,
3620,
43,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
38,
3620,
43,
1,
198,
60,
198
] | 2.1 | 40 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
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,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
import json
import logging
import sys
log = logging.getLogger(__name__)
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198
] | 3.173913 | 23 |
identifier = 'org.vistrails.test.upgrades_layout'
name ='test_upgrades_layout'
version = '0.3'
| [
738,
7483,
796,
705,
2398,
13,
85,
396,
430,
4487,
13,
9288,
13,
929,
31177,
62,
39786,
6,
198,
3672,
796,
6,
9288,
62,
929,
31177,
62,
39786,
6,
198,
9641,
796,
705,
15,
13,
18,
6,
198
] | 2.5 | 38 |
#for all read file code at the end of the code file should closed.
f = open('test.txt', 'r')
file_contents = f.read()
f.close()
words = file_contents.split(' ')
word_count = len(words)
print(word_count)
"""
OUTPUT:
3
"""
#for all the time use a file closing it is became a big job.
with open('test.txt', 'r') as f:
... | [
198,
2,
1640,
477,
1100,
2393,
2438,
379,
262,
886,
286,
262,
2438,
2393,
815,
4838,
13,
198,
69,
796,
1280,
10786,
9288,
13,
14116,
3256,
705,
81,
11537,
198,
7753,
62,
3642,
658,
796,
277,
13,
961,
3419,
198,
69,
13,
19836,
3419... | 2.651934 | 181 |
import torch
from einops import rearrange
"""
@openai - VD-VAE
https://github.com/openai/vdvae/blob/main/vae_helpers.py
Nice helper module as calling super.__init__() gets annoying
"""
"""
@lucidrains - Phil Wang (nystrom-attention)
https://github.com/lucidrains/nystrom-attention/blob/main/nystro... | [
11748,
28034,
198,
6738,
304,
259,
2840,
1330,
37825,
858,
198,
198,
37811,
198,
220,
220,
220,
2488,
9654,
1872,
532,
569,
35,
12,
11731,
36,
198,
220,
220,
220,
3740,
1378,
12567,
13,
785,
14,
9654,
1872,
14,
20306,
33353,
14,
243... | 2.586957 | 138 |
# coding=utf-8
import sys
import numpy as np
from p2_mahjong.card import MahjongCard as Card
log_head = "utils.py"
CARD_USED_TYPE = ['characters', 'green', 'red', 'white', 'east', 'west', 'north', 'south',
'spring', 'summer', 'autumn', 'winter', 'mei', 'lan', 'zhu', 'ju']
card_encoding_dict = {}
card... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
279,
17,
62,
76,
993,
32428,
13,
9517,
1330,
37380,
16962,
355,
5172,
198,
6404,
62,
2256,
796,
366,
26791,
13,
9078,
1,
198,
198,
34,
... | 2.157525 | 711 |
'''
class Solution:
def mySqrt(self,x) :
# Base cases
if (x == 0 or x == 1) :
return x
# Do Binary Search for integer square root
start = 1
end = x
while (start <= end) :
mid = (start + end) // 2
# If x is a perfect square
... | [
7061,
6,
201,
198,
4871,
28186,
25,
201,
198,
220,
825,
616,
50,
80,
17034,
7,
944,
11,
87,
8,
1058,
220,
201,
198,
220,
220,
201,
198,
220,
220,
220,
1303,
7308,
2663,
220,
201,
198,
220,
220,
220,
611,
357,
87,
6624,
657,
39... | 1.716247 | 437 |
"""MEG UI Manager
"""
import pkg_resources
from PyQt5 import QtCore, QtWidgets, QtGui, uic
from meg_runtime.config import Config
from meg_runtime.logger import Logger
from meg_runtime.app import App
| [
37811,
44,
7156,
12454,
9142,
198,
37811,
198,
198,
11748,
279,
10025,
62,
37540,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
54,
312,
11407,
11,
33734,
8205,
72,
11,
334,
291,
198,
6738,
17243,
62,
43282,
13,
11250,
... | 3.092308 | 65 |
"""testing
"""
from energy_demand.scripts import s_rs_raw_shapes
import numpy as np
| [
37811,
33407,
198,
37811,
198,
6738,
2568,
62,
28550,
13,
46521,
1330,
264,
62,
3808,
62,
1831,
62,
1477,
7916,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.111111 | 27 |
import argparse
import logging
import yaml
from pathlib import Path
from script_utils.common import common_setup
from release.davis16.compute_flow import link_splits
from release.helpers.misc import msg, subprocess_call
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
331,
43695,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
4226,
62,
26791,
13,
11321,
1330,
2219,
62,
40406,
198,
198,
6738,
2650,
13,
67,
23401,
1433,
13,
5589,
1133,
62,
11125,
... | 3.231707 | 82 |
# The MIT License (MIT)
# Copyright (c) 2021-present foxwhite25
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, ... | [
2,
220,
383,
17168,
13789,
357,
36393,
8,
198,
2,
220,
15069,
357,
66,
8,
33448,
12,
25579,
21831,
11186,
1495,
198,
2,
198,
2,
220,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
198,
2,
220,
... | 3.455172 | 435 |
import tkinter as tk
| [
11748,
256,
74,
3849,
355,
256,
74,
628
] | 2.75 | 8 |
# Generated by Django 3.0 on 2020-03-29 14:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
319,
12131,
12,
3070,
12,
1959,
1478,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
... | 3.1 | 50 |
import struct
import sys
import math
import numpy as np
#
# TODO 1: (NOW FIXED) Find the first occurrence of magic and start from there
# TODO 2: Warn if we cannot parse a specific section and try to recover
# TODO 3: Remove error at end of file if we have only fragment of TLV
#
def parseRDheatmap(data, tlvLeng... | [
11748,
2878,
198,
11748,
25064,
198,
11748,
10688,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
2,
198,
2,
16926,
46,
352,
25,
357,
45669,
44855,
1961,
8,
9938,
262,
717,
19810,
286,
5536,
290,
923,
422,
612,
198,
2,
16926,
46... | 2.06005 | 3,980 |
from io import StringIO
from os import path, listdir, remove
from math import radians, tan, cos, pi, atan, sin
from pandas import read_csv
import sympy as sy
import numpy as np
# these variables are used to solve symbolic mathematical equations
# x is the control variable over the height ... max(x) = H_cross_section
... | [
6738,
33245,
1330,
10903,
9399,
198,
6738,
28686,
1330,
3108,
11,
1351,
15908,
11,
4781,
198,
6738,
10688,
1330,
2511,
1547,
11,
25706,
11,
8615,
11,
31028,
11,
379,
272,
11,
7813,
198,
6738,
19798,
292,
1330,
1100,
62,
40664,
198,
19... | 2.77945 | 1,528 |
from __future__ import annotations
import json
import socket
import requests
from bunq.sdk.context.api_context import ApiContext, ApiEnvironmentType
from bunq.sdk.exception.bunq_exception import BunqException
from bunq.sdk.http.api_client import ApiClient
from bunq.sdk.model.generated import endpoint
from bunq.sdk.m... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
33918,
198,
11748,
17802,
198,
198,
11748,
7007,
198,
198,
6738,
28773,
80,
13,
21282,
74,
13,
22866,
13,
15042,
62,
22866,
1330,
5949,
72,
21947,
11,
5949,
72,
31441,
6030,
198,
... | 2.86385 | 213 |
import mysql.connector as mydb
conn = mydb.connect(
host='mysql_container',
port='3306',
user='docker',
password='docker',
database='my_db'
)
conn.is_connected()
| [
11748,
48761,
13,
8443,
273,
355,
616,
9945,
198,
198,
37043,
796,
616,
9945,
13,
8443,
7,
198,
220,
220,
220,
2583,
11639,
28744,
13976,
62,
34924,
3256,
198,
220,
220,
220,
2493,
11639,
18,
20548,
3256,
198,
220,
220,
220,
2836,
1... | 2.486486 | 74 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.75 | 8 |
from __future__ import unicode_literals
import frappe
from frappe import _
from datetime import datetime, timedelta, date, time
from frappe.utils import getdate, get_time, flt, now_datetime
from frappe.utils import escape_html
from frappe import throw, msgprint, _
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
5306,
27768,
198,
6738,
5306,
27768,
1330,
4808,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
3128,
11,
640,
198,
6738,
5306,
27768,
13,
26791,
13... | 3.454545 | 77 |
'''
goalboost.model package
The goalboost model package consists of MongoEngine models along with
Marshmallow schemas. MongoEngine is our database ORM to MongoDB,
and Marshmallow is a serialization library that helps us validate, consume,
and expose these Orm objects for clients that need it at the API layer.
For Mon... | [
7061,
6,
198,
35231,
39521,
13,
19849,
5301,
198,
464,
3061,
39521,
2746,
5301,
10874,
286,
42591,
13798,
4981,
1863,
351,
198,
41984,
42725,
3897,
5356,
13,
220,
42591,
13798,
318,
674,
6831,
6375,
44,
284,
42591,
11012,
11,
198,
392,
... | 3.615854 | 164 |
# Copyright 2018 Huawei Technologies Co.,Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
2,
15069,
2864,
43208,
21852,
1766,
1539,
43,
8671,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
198,
2,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.85 | 160 |
import boto3
from zipfile import ZipFile
import argparse
import json
import os
import shutil
if __name__ == "__main__":
main()
| [
198,
11748,
275,
2069,
18,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
138... | 3.046512 | 43 |
# Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
2,
406,
600,
355,
25,
21015,
18,
198,
2,
15069,
13130,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743... | 2.690522 | 1,034 |
"""Initialize the index package"""
# flake8: noqa
from __future__ import absolute_import
from .base import *
from .typ import *
| [
37811,
24243,
1096,
262,
6376,
5301,
37811,
198,
2,
781,
539,
23,
25,
645,
20402,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
764,
8692,
1330,
1635,
198,
6738,
764,
28004,
1330,
1635,
198
] | 3.394737 | 38 |
# -*- coding: utf-8 -*-
burgerPython = Saucer("Hamburguesa de Python", 0.13,
cadDescription="Barely an eigth of a byte")
print(burgerPython) | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
6236,
1362,
37906,
796,
23167,
2189,
7203,
39,
4131,
3686,
947,
64,
390,
11361,
1600,
657,
13,
1485,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2 | 87 |
import torch
import torch.nn.functional as F
from torch import nn
from resnext.resnext101_regular import ResNeXt101
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
1330,
299,
77,
198,
198,
6738,
581,
19545,
13,
411,
19545,
8784,
62,
16338,
1330,
1874,
8199,
55,
83,
8784,
628,
198
] | 3.305556 | 36 |
'Classes and functions for creating fonts and text buttons'
#IMPORTS
import pygame
from pathlib import Path
from .core import clip_surface, load_image
from .colour import palette_swap
#IMPORTS
#VARIALBES
__all__ = ['create_font', 'TextButton']
path = Path(__file__).resolve().parent
#VARIABLES
#CREATE_FON... | [
6,
9487,
274,
290,
5499,
329,
4441,
26806,
290,
2420,
12163,
6,
201,
198,
2,
3955,
47,
33002,
201,
198,
11748,
12972,
6057,
201,
198,
6738,
3108,
8019,
1330,
10644,
201,
198,
6738,
764,
7295,
1330,
10651,
62,
42029,
11,
3440,
62,
90... | 2.694617 | 966 |
"""
This modules contain helper function to deal with PIL / Pillow Images.
.. note::
Please note that the ``[PIL]`` (pillow) extra dependency must be installed
to allow functions from this module to work.
"""
from . import guetzli
def _to_pil_rgb_image(image):
"""Returns an PIL Image converted to the R... | [
37811,
198,
1212,
13103,
3994,
31904,
2163,
284,
1730,
351,
350,
4146,
1220,
19770,
322,
5382,
13,
198,
198,
492,
3465,
3712,
198,
220,
220,
220,
4222,
3465,
326,
262,
7559,
58,
47,
4146,
60,
15506,
357,
27215,
322,
8,
3131,
20203,
... | 2.58037 | 703 |
#
# @lc app=leetcode id=201 lang=python
#
# [201] Bitwise AND of Numbers Range
#
# https://leetcode.com/problems/bitwise-and-of-numbers-range/description/
#
# algorithms
# Medium (35.44%)
# Total Accepted: 77.3K
# Total Submissions: 217.7K
# Testcase Example: '5\n7'
#
# Given a range [m, n] where 0 <= m <= n <= 214... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
1264,
42392,
28,
29412,
198,
2,
198,
2,
685,
1264,
60,
4722,
3083,
5357,
286,
27797,
13667,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
254... | 2.423645 | 203 |
''' dip
@author Bardia Mojra - 1000766739
@brief ee-5323 - project -
@date 10/31/21
code based on below YouTube tutorial and Pymotw.com documentation for socket mod.
@link https://www.youtube.com/watch?v=3QiPPX-KeSc
@link https://pymotw.com/2/socket/tcp.html
python socket module documentation
@link ht... | [
7061,
6,
19550,
198,
220,
2488,
9800,
25654,
544,
40120,
430,
532,
8576,
22,
28933,
2670,
198,
220,
2488,
65,
3796,
304,
68,
12,
4310,
1954,
532,
1628,
532,
198,
220,
2488,
4475,
838,
14,
3132,
14,
2481,
628,
220,
2438,
1912,
319,
... | 2.086414 | 4,652 |
"""
A Command parser to parse over each jinja template for a given cmake command
"""
import os
from apigen.Logger import Logger
from jinja2 import Environment, PackageLoader, FileSystemLoader
| [
37811,
198,
32,
9455,
30751,
284,
21136,
625,
1123,
474,
259,
6592,
11055,
329,
257,
1813,
12067,
539,
3141,
198,
37811,
198,
198,
11748,
28686,
198,
6738,
2471,
9324,
13,
11187,
1362,
1330,
5972,
1362,
198,
6738,
474,
259,
6592,
17,
... | 3.784314 | 51 |
#!/usr/bin/env python
import sys
print("Please tell me your favorite color: ")
color = sys.stdin.readline()
animal = raw_input("Please tell me your favorite animal: ")
print(animal)
sys.stdout.write("Your favorite color is: " + color + " favorite animal is: " + animal + "\n")
print("*" * 10)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
198,
4798,
7203,
5492,
1560,
502,
534,
4004,
3124,
25,
366,
8,
198,
8043,
796,
25064,
13,
19282,
259,
13,
961,
1370,
3419,
198,
198,
41607,
796,
8246,
62,
154... | 3.05102 | 98 |
# Comet VOEvent Broker.
# Event handlers.
from comet.handler.relay import *
from comet.handler.spawn import *
| [
2,
36238,
30578,
9237,
2806,
6122,
13,
198,
2,
8558,
32847,
13,
198,
198,
6738,
31733,
13,
30281,
13,
2411,
323,
1330,
1635,
198,
6738,
31733,
13,
30281,
13,
48183,
1330,
1635,
198
] | 3.363636 | 33 |
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from measure_mate.models import Template
from measure_mate.tests.factories import TemplateFactory
| [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
50188,
1330,
9575,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
3953,
62,
9830,
13,
27530,
1330,
37350,
198,
6738,
3953,
62,
983... | 4.333333 | 51 |
# Generated by Django 4.0 on 2021-12-29 11:36
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33448,
12,
1065,
12,
1959,
1367,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import torch
import torch.nn as nn
from lib.util import normal_log_density
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
9195,
13,
22602,
1330,
3487,
62,
6404,
62,
43337,
628
] | 3.454545 | 22 |
import importlib
import unittest
solution = importlib.import_module('2020_04_2')
| [
11748,
1330,
8019,
198,
11748,
555,
715,
395,
198,
198,
82,
2122,
796,
1330,
8019,
13,
11748,
62,
21412,
10786,
42334,
62,
3023,
62,
17,
11537,
198
] | 3.037037 | 27 |
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
2,
15069,
2864,
10766,
28478,
21852,
15302,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351... | 3.195736 | 516 |
from __future__ import print_function
from cineapp import app, db, lm
from flask_login import login_required
from flask import jsonify, session, g, url_for, request
from pywebpush import webpush, WebPushException
from cineapp.models import PushNotification
import json, traceback, sys, datetime, time
from cineapp.auth i... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
269,
500,
1324,
1330,
598,
11,
20613,
11,
300,
76,
198,
6738,
42903,
62,
38235,
1330,
17594,
62,
35827,
198,
6738,
42903,
1330,
33918,
1958,
11,
6246,
11,
308,
11,
19016,
62,
... | 3.655914 | 93 |
# generated by datamodel-codegen:
# filename: openapi.yaml
# timestamp: 2021-12-31T02:50:50+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Annotated, Any, List, Optional
from pydantic import BaseModel, Extra, Field
... | [
2,
7560,
416,
4818,
321,
375,
417,
12,
8189,
5235,
25,
198,
2,
220,
220,
29472,
25,
220,
1280,
15042,
13,
88,
43695,
198,
2,
220,
220,
41033,
25,
33448,
12,
1065,
12,
3132,
51,
2999,
25,
1120,
25,
1120,
10,
405,
25,
405,
198,
... | 2.483568 | 213 |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 25 15:48:52 2015
@author: Sofia
"""
import csv
import json
import os
sourceEncoding = "iso-8859-1"
targetEncoding = "utf-8"
# encode files to utf8 (source: http://stackoverflow.com/questions/191359/how-to-convert-a-file-to-utf-8-in-python)
csvfile = open('..\Data\AMFI.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
2365,
1679,
1315,
25,
2780,
25,
4309,
1853,
198,
198,
31,
9800,
25,
41427,
544,
198,
37811,
198,
198,
11748,
269,
21370,
198,
11748,
33918,... | 2.239237 | 2,044 |
import datetime
import os
import unittest
from io import StringIO
from tempfile import mkdtemp
from unittest.mock import patch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command as real_call_command
from django.core.management.base i... | [
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
33245,
1330,
10903,
9399,
198,
6738,
20218,
7753,
1330,
33480,
67,
29510,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
42625,
14208,
13,
... | 3.794118 | 170 |
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs
from cowpy import cow
import json
import sys
if __name__ == '__main__':
run_forever()
| [
6738,
2638,
13,
15388,
1330,
38288,
18497,
11,
7308,
40717,
18453,
25060,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
11,
21136,
62,
48382,
198,
6738,
9875,
9078,
1330,
9875,
198,
11748,
33918,
198,
11748,
25064,
628,
628,
... | 3.193548 | 62 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 00:58:34 2018
@author: jeff
"""
'''*************************************
#1. Import libraries and key varable values
'''
import os
import quandl
import pandas as pd
import numpy as np
import keras
from PIL import Image
#folder path
folder_path =... | [
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,
2556,
1542,
3571,
25,
3365,
25,
2682,
2864,
198,
198,
31,
9800,
25,
11223,
487,
19... | 1.995365 | 3,452 |
# -*- coding: utf-8 -*-
from lichee import plugin
from .field_parser_base import BaseFieldParser
import os
from PIL import Image
from torchvision import transforms
import torch
from lichee.utils import storage
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
3476,
21067,
1330,
13877,
198,
6738,
764,
3245,
62,
48610,
62,
8692,
1330,
7308,
15878,
46677,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
28034,... | 3.637931 | 58 |
import torch
from torch import nn
import torch.nn.functional as F
import torchvision
from torchvision.models.inception import BasicConv2d, InceptionAux
import pretrainedmodels
from common import num_class
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
28034,
10178,
198,
6738,
28034,
10178,
13,
27530,
13,
924,
1159,
1330,
14392,
3103,
85,
17,
67,
11,
554,
4516,
32,
2821,
198... | 3.714286 | 56 |
name = "Saeed"
cordinates = (10.0, 20.0)
names = ["Saeed", "Bob", "Mousa"] | [
3672,
796,
366,
33890,
2308,
1,
198,
66,
585,
17540,
796,
357,
940,
13,
15,
11,
1160,
13,
15,
8,
198,
14933,
796,
14631,
33890,
2308,
1600,
366,
18861,
1600,
366,
44,
516,
64,
8973
] | 2.114286 | 35 |
#!/usr/bin/python
##############################################
###Python template
###Author: Elizabeth Lee
###Date: 9/2/14
###Function: mean peak-based retro zOR metric vs. total attack rate
###Import data: SQL_export/OR_allweeks_outpatient.csv, SQL_export/OR_allweeks.csv
###Command Line: python Supp_zOR_totalAR.... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
29113,
7804,
4242,
2235,
198,
21017,
37906,
11055,
198,
21017,
13838,
25,
10674,
5741,
198,
21017,
10430,
25,
860,
14,
17,
14,
1415,
198,
21017,
22203,
25,
1612,
9103,
12,
3106,
12175,
1... | 2.568071 | 1,021 |
"""This is the solution to Problem 1 of Project Euler."""
"""Copyright 2021 Dimitris Mantas"""
import time
def compute_all_multiples(of_number, below_number):
"""Compute all natural numbers, which are multiples of a natural number below a predefined number."""
# Register the list of said multiple... | [
37811,
1212,
318,
262,
4610,
284,
20647,
352,
286,
4935,
412,
18173,
526,
15931,
201,
198,
37811,
15269,
33448,
14048,
270,
2442,
36987,
292,
37811,
201,
198,
201,
198,
201,
198,
11748,
640,
201,
198,
201,
198,
201,
198,
4299,
24061,
... | 2.813636 | 440 |
#!/usr/bin/env python
# coding: utf-8
# # Colecciones - Listas
# In[1]:
l = [22, True, "una lista", [1, 2]]
mi_var = l[0] # mi_var vale 22
mi_var1 = l[3] # mi_var1 vale [1, 2]
print (mi_var)
print (mi_var1)
# In[50]:
# Si queremos acceder a un elemento de una lista incluida dentro de otra lista tendremos que
#... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
11768,
535,
295,
274,
532,
7343,
292,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
75,
796,
685,
1828,
11,
6407,
11,
366,
9613,
... | 2.463642 | 1,499 |
import pytest
from itertools import product
import torch
from torch import nn
from torch.nn.utils import parameters_to_vector
from torch.utils.data import DataLoader, TensorDataset
from torchvision.models import wide_resnet50_2
from laplace import Laplace, SubnetLaplace, FullSubnetLaplace, DiagSubnetLaplace
from lapl... | [
11748,
12972,
9288,
198,
6738,
340,
861,
10141,
1330,
1720,
198,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
13,
26791,
1330,
10007,
62,
1462,
62,
31364,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
... | 2.656398 | 422 |
"""
rylog
Logging happening in a 3-dimensional Cartesian product of:
1. The logging level: [debug, info, warn, error]
2. The logging category: e.g. software event, action, output
3. The detected function/method: e.g. my_class.class_method or foo
"""
from .misc import *
from .server import *
from .clie... | [
37811,
198,
220,
374,
2645,
519,
628,
220,
5972,
2667,
5836,
287,
257,
513,
12,
19577,
13690,
35610,
1720,
286,
25,
198,
220,
220,
220,
352,
13,
383,
18931,
1241,
25,
685,
24442,
11,
7508,
11,
9828,
11,
4049,
60,
198,
220,
220,
22... | 3.102804 | 107 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import timeit
import numpy as np
import sys
import random as rand
if __name__ == '__main__':
# 1.
# queue=Queue_array(8)
# string_list=['a','b','c','d','e','f','g','h']
#
# for ele in string_list:
# queue.enqueue(ele)
#
# print(queue... | [
198,
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
640,
270,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
25064,
198,
11748,
4738,
355,
43720,
628,
628,
19... | 2.169265 | 449 |
import numpy as np
from matplotlib import pyplot as plt
import math
MAX_SPEED = 2
ACCELERATION = 0.5
DRAG = 0.3
TURN_SPEED=5
IMAGE = np.array([
[0,0,0,1,0,0,0],
[0,0,1,1,1,0,0],
[0,1,1,1,1,1,0],
[1,1,1,1,1,1,1],
[0,1,1,1,1,1,0],
[0,0,1,1,1,0,0],
[0,0,0,1,0,0,0]])
if __name__ == "__main__":
main() | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
11748,
10688,
198,
22921,
62,
4303,
41841,
796,
362,
198,
26861,
3698,
1137,
6234,
796,
657,
13,
20,
198,
35,
33202,
796,
657,
13,
18,... | 1.602094 | 191 |
# coding: utf-8
# n a1a2...an(i,ai)
# n i(i,ai) (i, 0)
# x
#
# LeetCode
# https://leetcode-cn.com/problems/container-with-most-water
list = [1,8,6,2,5,4,8,3,7]
print Solution().maxArea(list)
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
220,
299,
220,
257,
16,
64,
17,
986,
272,
7,
72,
11,
1872,
8,
220,
198,
2,
220,
299,
220,
1312,
7,
72,
11,
1872,
8,
220,
357,
72,
11,
657,
8,
198,
2,
2124,
198,
2,
198,
2,
1... | 1.869159 | 107 |
# Generated by Django 2.1.3 on 2018-12-06 10:42
from django.db import migrations, models
import system.models.system_settings
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
18,
319,
2864,
12,
1065,
12,
3312,
838,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
1080,
13,
27530,
13,
10057,
62,
33692,
628
] | 3.121951 | 41 |
from __future__ import division, print_function
from .trajgroup import TrajectoryGroup
from .hypath import HyPath
from .hygroup import HyGroup
def print_clusterprocedure():
"""Print clustering guide."""
print("""
In ``PySPLIT``
1. Create ``TrajectoryGroup`` with desired set of trajectorie... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
764,
9535,
73,
8094,
1330,
4759,
752,
652,
13247,
198,
6738,
764,
36362,
776,
1330,
6707,
15235,
198,
6738,
764,
12114,
8094,
1330,
6707,
13247,
628,
198,
4299,
... | 2.507375 | 339 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import re
import requests
import sys
sys.path.append(os.path.join(sys.path[0], "../", "lib"))
import lkft_squad_client # noqa: E402
def get_branch_from_make_kernelversion(make_kernelversion):
"""
IN: "4.4.118"
OUT: "4.4"
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
7007,
198,
11748,
25064,
198,
198,
17597,
... | 2.349231 | 650 |
from math import ceil, sqrt
if __name__ == "__main__":
input = 325489
print(part_one(input))
print(part_two(input))
| [
6738,
10688,
1330,
2906,
346,
11,
19862,
17034,
628,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
5128,
796,
29524,
35890,
198,
220,
220,
220,
3601,
7,
3911,
62,
505,
7,
15414... | 2.403509 | 57 |
#022: Crie um programa que leia o nome completo de uma pessoa e mostre:
# - O nome com todas as letras maisculas e minsculas.
# - Quantas letras ao tdo (sem considerar espaos).
# - Quantas letras tem o primeiro nome.
nome = input("Qual o seu nome? ")
print(">>",nome.upper())
print(">>",nome.lower())
jnome = nome.stri... | [
2,
44087,
25,
327,
5034,
23781,
1430,
64,
8358,
443,
544,
267,
299,
462,
1224,
1462,
390,
334,
2611,
279,
408,
12162,
304,
749,
260,
25,
198,
2,
532,
440,
299,
462,
401,
284,
67,
292,
355,
1309,
8847,
17266,
2304,
25283,
304,
949,... | 2.421965 | 173 |
from typing import Optional
from pysqldump.domain.formatters import (
CSVFormatter,
DictFormatter,
JsonFormatter,
ConsoleFormatter,
)
from pysqldump.settings.base import get_config
config = get_config()
def __to_console(self, pprint: bool = False):
if pprint:
return ConsoleF... | [
6738,
19720,
1330,
32233,
198,
198,
6738,
279,
893,
80,
335,
931,
13,
27830,
13,
18982,
1010,
1330,
357,
198,
220,
220,
220,
44189,
8479,
1436,
11,
198,
220,
220,
220,
360,
713,
8479,
1436,
11,
198,
220,
220,
220,
449,
1559,
8479,
... | 2.260784 | 510 |
"""**Mortgage Calculator** -
Calculate the monthly payments of a fixed term mortgage
over given Nth terms at a given interest rate. Also figure
out how long it will take the user to pay back the loan."""
months = int(input("Enter mortgage term (in months): "))
rate = float(input("Enter interest rate (in %): ... | [
37811,
1174,
44,
419,
10502,
43597,
1174,
532,
201,
198,
201,
198,
9771,
3129,
378,
262,
9651,
7524,
286,
257,
5969,
3381,
13682,
220,
201,
198,
2502,
1813,
399,
400,
2846,
379,
257,
1813,
1393,
2494,
13,
4418,
3785,
220,
201,
198,
... | 3.025 | 200 |
import numpy as np | [
11748,
299,
32152,
355,
45941
] | 3.6 | 5 |
import cv2
| [
11748,
269,
85,
17,
628,
628
] | 2.333333 | 6 |
from brnolm.runtime.tensor_reorganization import TensorReorganizer
import torch
from torch.autograd import Variable
from .common import TestCase
| [
6738,
865,
77,
349,
76,
13,
43282,
13,
83,
22854,
62,
260,
9971,
1634,
1330,
309,
22854,
3041,
9971,
7509,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
764,
11321,
1330,
6208,
20448,
628,
628,... | 3.488372 | 43 |
jobname="BachelorThesis"
| [
21858,
3672,
2625,
33,
19335,
464,
13429,
1,
198
] | 2.777778 | 9 |
from eventsourcing.infrastructure.event_sourced_repo import EventSourcedRepository
from quantdsl.domain.model.contract_specification import ContractSpecification, ContractSpecificationRepository
| [
6738,
2995,
29985,
13,
10745,
6410,
13,
15596,
62,
82,
30555,
62,
260,
7501,
1330,
8558,
50,
30555,
6207,
13264,
198,
6738,
5554,
67,
6649,
13,
27830,
13,
19849,
13,
28484,
62,
16684,
2649,
1330,
17453,
22882,
2649,
11,
17453,
22882,
... | 4.304348 | 46 |
from requests_html import HTMLSession
import os
import sys
writeFileName = "courseLinks.out"
writeFileStream = open(writeFileName,'w',encoding='utf-8')
session = HTMLSession()
url = 'https://www.ji.sjtu.edu.cn/academics/courses/courses-by-number/'
r = session.get(url)
for i in range(2,100):
sel = '... | [
6738,
7007,
62,
6494,
1330,
11532,
36044,
201,
198,
11748,
28686,
201,
198,
11748,
25064,
201,
198,
201,
198,
13564,
8979,
5376,
796,
366,
17319,
31815,
13,
448,
1,
201,
198,
13564,
8979,
12124,
796,
1280,
7,
13564,
8979,
5376,
4032,
... | 2.283737 | 289 |
import logging
import discord
from datetime import datetime
from discord.ext import tasks, commands
from discord.ext.commands import Cog
from cogs.utils.utils import json_io_dump, json_io_load
log = logging.getLogger(__name__)
STATUS = 'status'
TIME_STARTED = 'time_started'
NAME = 'name'
GAMES = 'games'
NONE = 'none'... | [
11748,
18931,
198,
11748,
36446,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
36446,
13,
2302,
1330,
8861,
11,
9729,
198,
6738,
36446,
13,
2302,
13,
9503,
1746,
1330,
327,
519,
198,
6738,
269,
18463,
13,
26791,
13,
26791,
1330,
... | 2.242647 | 680 |
import numpy as np
from .converter import TransformConverter
from .. import linear
| [
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1102,
332,
353,
1330,
26981,
3103,
332,
353,
198,
6738,
11485,
1330,
14174,
628
] | 3.818182 | 22 |
from pyqt.utils import time
| [
6738,
12972,
39568,
13,
26791,
1330,
640,
198
] | 3.5 | 8 |
import os
def readAnn(textfolder="../data/SemEval2017Task10/"):
'''
Read .ann files and look up corresponding spans in .txt files
Args:
textfolder:
'''
flist = os.listdir(textfolder)
for f in flist:
if not f.endswith(".ann"):
continue
f_anno = open(os... | [
11748,
28686,
628,
198,
4299,
1100,
18858,
7,
5239,
43551,
2625,
40720,
7890,
14,
13900,
36,
2100,
5539,
25714,
940,
30487,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
4149,
764,
1236,
3696,
290,
804,
510,
11188,
32727,
2... | 2.064662 | 665 |
from collections import namedtuple
import os
import sympy
import numpy as np
from means.core.model import Model
_Reaction = namedtuple('_REACTION', ['id', 'reactants', 'products', 'propensity', 'parameters'])
def read_sbml(filename):
"""
Read the model from a SBML file.
:param filename: SBML filename to... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
28686,
198,
11748,
10558,
88,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1724,
13,
7295,
13,
19849,
1330,
9104,
198,
198,
62,
3041,
2673,
796,
3706,
83,
29291,
10786,
62,
2200,
44710,
... | 2.73572 | 1,173 |
import pytest
import clrenv
| [
11748,
12972,
9288,
198,
198,
11748,
537,
918,
85,
628,
628,
198
] | 2.75 | 12 |
import random
import pandas as pd
import numpy as np
import json
from tqdm import *
# Convert the QA file json to output dictionary containing premise and hypothesis
# Create the output json dictionary from the input json, premise and hypothesis statement
if __name__ == "__main__":
convert_to_codah_statemen... | [
11748,
4738,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
1635,
628,
628,
198,
2,
38240,
262,
1195,
32,
2393,
33918,
284,
5072,
22155,
7268,
18659,
290,
... | 3 | 225 |
'''
pip install Scrapy
pip install selenium
In a folder:
scrapy startproject imgt
when running:
scrapy crawl new_imgt -o out.json
when using scrapy shell:
scrapy shell 'url'
in Ipython, you can use response.xpath or response.css to try out
object:
1. selectorlist if css('a') and there are ... | [
7061,
6,
198,
79,
541,
2721,
1446,
2416,
88,
198,
79,
541,
2721,
384,
11925,
1505,
198,
198,
818,
257,
9483,
25,
198,
220,
220,
220,
15881,
88,
923,
16302,
545,
13655,
198,
12518,
2491,
25,
198,
220,
220,
220,
15881,
88,
27318,
64... | 3.013761 | 436 |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
33160,
1058,
33,
6532,
12,
22405,
12,
12041,
25,
19935,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
4943,
198,
2,
345,
743,... | 3.545045 | 222 |
#!/usr/bin/python3
# (c) Robert Muth - see LICENSE for more info
from typing import List, Dict
import enum
from Util import cgen
# maximum number of operands in an instruction
MAX_OPERANDS = 5
# maximum number of function parameters (or results)
MAX_PARAMETERS = 64
#################################################... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
357,
66,
8,
5199,
337,
1071,
532,
766,
38559,
24290,
329,
517,
7508,
198,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
198,
198,
11748,
33829,
198,
6738,
7273,
346,
1330,
269,
5235,
... | 1.985238 | 13,548 |
# Generated by Django 3.2.7 on 2021-10-27 09:40
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
940,
12,
1983,
7769,
25,
1821,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: LAMARCK_ML/data_util/TypeShape.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
406,
2390,
25793,
42,
62,
5805,
14,
7890,
62,
22602,
14,
6030,
33383,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13,... | 2.370702 | 1,454 |
from flask import Flask, render_template, request, session, redirect, url_for
import pymysql.cursors
import datetime
from pyecharts import options as opts
from pyecharts.charts import Pie,Bar
from appdef import *
#Get the airline the staff member works for
#Make sure that the user is actually staff before performing... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
6246,
11,
18941,
11,
19016,
62,
1640,
198,
11748,
279,
4948,
893,
13976,
13,
66,
1834,
669,
198,
11748,
4818,
8079,
198,
6738,
12972,
3055,
5889,
1330,
3689,
355,
2172,
82,
... | 3.818182 | 88 |
from fastapi import FastAPI
try:
from routes import analytics,templates,auth
except:
from .routes import analytics,templates,auth
app = FastAPI()
app.include_router(analytics.router)
app.include_router(templates.router)
app.include_router(auth.authr) | [
6738,
3049,
15042,
1330,
12549,
17614,
198,
28311,
25,
198,
220,
220,
220,
422,
11926,
1330,
23696,
11,
11498,
17041,
11,
18439,
198,
16341,
25,
198,
220,
220,
220,
422,
764,
81,
448,
274,
1330,
23696,
11,
11498,
17041,
11,
18439,
628... | 2.9 | 90 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import str
from future import standard_library
standard_library.install_aliases()
import query_releases
import unittest
if __name__ == "__main__":
u... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
3170,
1040,
1330,
... | 3.526316 | 95 |
# simplePendulum.py
# Model of a simple pendulum
import math
def simplePendulum(length = 1, angle = math.pi/4, angular_velocity = 0, DT = 0.0001, simLength = 12):
numIterations = int(simLength/DT) + 1
g = 9.81
angle_change = angular_velocity
angular_acceleration = -g... | [
2,
2829,
47,
437,
14452,
13,
9078,
201,
2,
9104,
286,
257,
2829,
44017,
14452,
201,
201,
11748,
10688,
201,
201,
4299,
2829,
47,
437,
14452,
7,
13664,
796,
352,
11,
9848,
796,
10688,
13,
14415,
14,
19,
11,
32558,
62,
626,
11683,
7... | 1.919176 | 631 |