content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
#!/usr/bin/env python
# Copyright (c) 2016 Sten Linnarsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# li... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
1584,
520,
268,
406,
3732,
283,
16528,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
... | 3.385375 | 506 |
import logging
import tcp_log_socket
logging_socket = tcp_log_socket.local_logging_socket(__name__)
logger = logging_socket.logger
#Test method simulating a method with required arguments; division is used to test exception handling
#Test method simulating a method with no required arguments
#Test method ... | [
11748,
18931,
201,
198,
11748,
48265,
62,
6404,
62,
44971,
201,
198,
201,
198,
6404,
2667,
62,
44971,
796,
48265,
62,
6404,
62,
44971,
13,
12001,
62,
6404,
2667,
62,
44971,
7,
834,
3672,
834,
8,
201,
198,
6404,
1362,
796,
18931,
62,... | 3.708738 | 103 |
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm
#####################################################################
from django.http import HttpResponse
fr... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
6738,
764,
23914,
133... | 3.843137 | 204 |
import os
import unittest
from vext.install import DEFAULT_PTH_CONTENT
if __name__ == "__main__":
unittest.main()
| [
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
1569,
742,
13,
17350,
1330,
5550,
38865,
62,
47,
4221,
62,
37815,
3525,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
3... | 2.595745 | 47 |
import argparse
from pprint import pformat
import txaio
txaio.use_twisted()
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-d',
'--debug',
action='store_... | [
11748,
1822,
29572,
198,
6738,
279,
4798,
1330,
279,
18982,
198,
198,
11748,
27765,
64,
952,
198,
17602,
64,
952,
13,
1904,
62,
4246,
6347,
3419,
198,
198,
6738,
1960,
672,
15386,
13,
4246,
6347,
13,
86,
696,
1330,
15678,
36044,
11,
... | 1.998165 | 545 |
#!/usr/bin/env python2.7
# Version date : Aug 21, 2018
#
# --> very minor correction compared to previous version. As keywords may change in files through time, when we delete
# a keyword, we first check if the keyword is preseent rather than "blindly" deleting it
# --> also corrected integer vs float divisions in ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
10628,
3128,
1058,
2447,
2310,
11,
2864,
198,
2,
198,
2,
14610,
845,
4159,
17137,
3688,
284,
2180,
2196,
13,
1081,
26286,
743,
1487,
287,
3696,
832,
640,
11,
618,
35... | 2.723804 | 8,780 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.course_list, name='course_list'),
path('<course_slug>/', views.session_list, name='session_list'),
path('<course_slug>/<session_slug>/', views.session_detail, name='session_detail'),
path('<course_slug>/<session_slug>/<pas... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
17319,
62,
4868,
11,
1438,
11639,
17319,
62,
4868,
33809,
198,
220,
220,
... | 2.69863 | 146 |
from api import app, BAD_PARAM, STATUS_OK, BAD_REQUEST
from flask import request, jsonify, abort, make_response,render_template, json
import sys
from lung_cancer.connection_settings import get_connection_string, TABLE_SCAN_IMAGES, TABLE_GIF, TABLE_MODEL, TABLE_FEATURES, LIGHTGBM_MODEL_NAME, DATABASE_NAME,NUMBER_PATIEN... | [
6738,
40391,
1330,
598,
11,
33934,
62,
27082,
2390,
11,
15486,
2937,
62,
11380,
11,
33934,
62,
2200,
35780,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
11,
15614,
11,
787,
62,
26209,
11,
13287,
62,
28243,
11,
33918,
220,
198,
11748... | 2.568761 | 589 |
import bloodFunctions as blood
import time
try:
samples = []
blood.initSpiAdc()
start = time.time()
while (time.time() - start) < 60:
samples.append(blood.getAdc())
finish = time.time()
blood.deinitSpiAdc()
blood.save(samples, start, finish)
finally:
print("Blood measure sc... | [
11748,
2910,
24629,
2733,
355,
2910,
198,
11748,
640,
198,
198,
28311,
25,
198,
220,
220,
220,
8405,
796,
17635,
628,
220,
220,
220,
2910,
13,
15003,
4561,
72,
2782,
66,
3419,
198,
220,
220,
220,
923,
796,
640,
13,
2435,
3419,
628,
... | 2.576923 | 130 |
import logging
import re
from typing import Literal, Optional
import discord
from discord.ext import commands
from emoji import UNICODE_EMOJI_ENGLISH, is_emoji
from bot.bot import Bot
from bot.constants import Colours, Roles
from bot.utils.decorators import whitelist_override
from bot.utils.extensions import invoke_h... | [
11748,
18931,
198,
11748,
302,
198,
6738,
19720,
1330,
25659,
1691,
11,
32233,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
44805,
1330,
4725,
2149,
16820,
62,
3620,
46,
41,
40,
62,
1677,
8763,
18422,
11,
... | 2.655303 | 264 |
# WAP to accept a filename from user and print all words starting with capital letters.
if __name__ == "__main__":
main() | [
2,
370,
2969,
284,
2453,
257,
29472,
422,
2836,
290,
3601,
477,
2456,
3599,
351,
3139,
7475,
13,
198,
220,
220,
220,
220,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 3.195122 | 41 |
# This is automatically-generated code.
# Uses the jinja2 library for templating.
import cvxpy as cp
import numpy as np
import scipy as sp
# setup
problemID = "least_abs_dev_0"
prob = None
opt_val = None
# Variable declarations
import scipy.sparse as sps
np.random.seed(0)
m = 5000
n = 200
A = np.random.rand... | [
2,
770,
318,
6338,
12,
27568,
2438,
13,
198,
198,
2,
36965,
262,
474,
259,
6592,
17,
5888,
329,
2169,
489,
803,
13,
628,
198,
11748,
269,
85,
87,
9078,
355,
31396,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,... | 2.350254 | 394 |
from __future__ import print_function
import os
import sys
import time
import gdal
import numpy as np
# -------------------------------------------------------------------------
# Files to process
# -------------------------------------------------------------------------
fileNames = [
'tasmax_day_BCSD_rcp85_r1i... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
308,
31748,
198,
11748,
299,
32152,
355,
45941,
628,
198,
2,
16529,
45537,
198,
2,
13283,
284,
1429,
198,
2,
16529,
45537,... | 2.698391 | 746 |
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.205882 | 238 |
"""
Ivoire is an RSpec-like testing framework for Python.
Globals defined in this module:
current_result: Should be set by a runner to an object that has the same
interface as unittest.TestResult. It will be used by every
example that is instantiated to record test results d... | [
37811,
198,
40,
13038,
557,
318,
281,
371,
22882,
12,
2339,
4856,
9355,
329,
11361,
13,
198,
198,
9861,
672,
874,
5447,
287,
428,
8265,
25,
198,
220,
220,
220,
1459,
62,
20274,
25,
10358,
307,
900,
416,
257,
17490,
284,
281,
2134,
... | 3.095436 | 241 |
# Blair Johnson 2021
from facenet_pytorch import InceptionResnetV1, MTCNN
import numpy as np
def create_embeddings(images):
'''
Take an iterable of image candidates and return an iterable of image embeddings.
'''
if type(images) != list:
images = [images]
extractor = MTCNN()
encoder ... | [
2,
18520,
5030,
33448,
198,
198,
6738,
1777,
268,
316,
62,
9078,
13165,
354,
1330,
554,
4516,
4965,
3262,
53,
16,
11,
337,
4825,
6144,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
2251,
62,
20521,
67,
654,
7,
17566,
2599,
198... | 2.455202 | 692 |
from IPython import embed as shell
import itertools
import numpy as np
import random
# SEED = 1234
NUM_PROBS = 1
NUM_CLOTH = 4
filename = "probs/base_prob.prob"
GOAL = "(RobotAt baxter robot_end_pose)"
# init Baxter pose
BAXTER_INIT_POSE = [0, 0, 0]
BAXTER_END_POSE = [0, 0, 0]
R_ARM_INIT = [0, 0, 0, 0, 0, 0, 0] # [... | [
6738,
6101,
7535,
1330,
11525,
355,
7582,
198,
11748,
340,
861,
10141,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
628,
198,
2,
7946,
1961,
796,
1105,
2682,
198,
41359,
62,
31190,
4462,
796,
352,
198,
41359,
62,
5097,
26946,
... | 1.872414 | 580 |
import pytest
from colorviews import AlphaColor
def test_vals_getter():
vals = (0.75, 0.45, 0.29, 0.79)
color = AlphaColor.from_hsva(0.75, 0.45, 0.29, 0.79)
assert [round(val, 4) for val in color.hsva.vals] == list(vals)
| [
11748,
12972,
9288,
198,
198,
6738,
3124,
33571,
1330,
12995,
10258,
628,
628,
628,
198,
4299,
1332,
62,
12786,
62,
1136,
353,
33529,
198,
220,
220,
220,
410,
874,
796,
357,
15,
13,
2425,
11,
657,
13,
2231,
11,
657,
13,
1959,
11,
... | 2.285714 | 105 |
import random, logging
from collections import Counter
from flask import Flask, session, request, render_template, jsonify
from app.util import unflatten
from app.fiftycents import FiftyCentsGame
from app.fiftycents import Card
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
app = Flask(... | [
11748,
4738,
11,
18931,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
201,
198,
6738,
42903,
1330,
46947,
11,
6246,
11,
2581,
11,
8543,
62,
28243,
11,
33918,
1958,
201,
198,
201,
198,
6738,
598,
13,
22602,
1330,
42880,
41769,
201,
198... | 2.931298 | 131 |
import time
import logging
import pickle
import json
import consolemenu
from generic_lib import georeverse, geolookup
from bluvo_main import BlueLink
from tools.stamps import postOffice
from params import * # p_parameters are read
logging.basicConfig(format='%(asctime)s - %(levelname)-8s - %(filename)-18s - %(messag... | [
11748,
640,
198,
11748,
18931,
198,
11748,
2298,
293,
198,
11748,
33918,
198,
11748,
8624,
26272,
198,
6738,
14276,
62,
8019,
1330,
4903,
382,
4399,
11,
4903,
349,
566,
929,
198,
6738,
48208,
13038,
62,
12417,
1330,
4518,
11280,
198,
67... | 2.135394 | 2,297 |
#!/usr/bin/env python3
"""
Author : kai
Date : 2019-06-26
Purpose: Rock the Casbah
"""
import argparse
import sys
import re
import csv
# --------------------------------------------------
def get_args():
"""get command-line arguments"""
parser = argparse.ArgumentParser(
description='Argparse Python ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
13838,
1058,
479,
1872,
198,
10430,
220,
220,
1058,
13130,
12,
3312,
12,
2075,
198,
30026,
3455,
25,
4631,
262,
11294,
47041,
198,
37811,
198,
198,
11748,
1822,
29572,
... | 2.207154 | 1,342 |
from django.urls import path
from users import views
app_name = 'users'
urlpatterns = [
path('create/',views.CreateUserView.as_view(),name='create'),
path('token/',views.CreateTokenView.as_view(),name='token'),
path('me/', views.ManageUserView.as_view(),name='me'),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
201,
198,
201,
198,
6738,
2985,
1330,
5009,
201,
198,
201,
198,
1324,
62,
3672,
796,
705,
18417,
6,
201,
198,
201,
198,
6371,
33279,
82,
796,
685,
201,
198,
220,
220,
220,
3108,
10786,
... | 2.607143 | 112 |
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
def draw_graph(edgeWeights,plotName='network_graph.png'):
"""
INPUT: this function takes in a dictionary of each edge names and the weight corresponding to that edge name
"""
edgeDict = {"t1e1":("T... | [
11748,
2603,
29487,
8019,
355,
285,
489,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
3127,
87,
355,
299,
87,
198,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
4299,
3197,
62,
34960,
7,
14907,
1135,
2... | 1.983546 | 1,884 |
# -*- coding: utf-8 -*-
# Copyright (c) 2021, BS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.nestedset import get_descendants_of
from frappe.utils import flt
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
33448,
11,
24218,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,... | 3.375 | 88 |
# Generated by Django 3.0.4 on 2020-03-14 15:30
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
19,
319,
12131,
12,
3070,
12,
1415,
1315,
25,
1270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from torch import Tensor
from torchvision import transforms
| [
6738,
28034,
1330,
309,
22854,
198,
6738,
28034,
10178,
1330,
31408,
628,
198
] | 4.769231 | 13 |
#!/home/rakeshmistry/bin/Python-3.4.3/bin/python3
# @author: rakesh mistry - 'inspire'
# @date: 2015-08-06
import sys
import re
import os
import math
# Function: parseSmt2File
# Function: main
if __name__ == "__main__":
main(sys.argv)
| [
2,
48443,
11195,
14,
17716,
5069,
76,
4592,
14,
8800,
14,
37906,
12,
18,
13,
19,
13,
18,
14,
8800,
14,
29412,
18,
198,
198,
2,
2488,
9800,
25,
374,
1124,
71,
4020,
563,
532,
705,
1040,
5111,
6,
198,
2,
2488,
4475,
25,
1853,
12... | 2.411765 | 102 |
#!/usr/bin/python
#coding=utf-8
import json, re, logging, time, io, os
import sys
from simplified_scrapy.core.config_helper import Configs
from simplified_scrapy.core.sqlite_cookiestore import SqliteCookieStore
from simplified_scrapy.core.request_helper import requestPost, requestGet, getResponseStr, extractHtml
from s... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
11748,
33918,
11,
302,
11,
18931,
11,
640,
11,
33245,
11,
28686,
198,
11748,
25064,
198,
6738,
27009,
62,
1416,
2416,
88,
13,
7295,
13,
11250,
62,
297... | 3.206897 | 203 |
#!/usr/bin/evn python
#--coding:utf-8--*--
#Name:10
#Refer:http://www.wooyun.org/bugs/wooyun-2015-0120852/
#Author:xq17
if __name__ == '__main__':
from dummy import *
audit(assign('tianrui_lib','http://218.92.71.5:1085/trebook/')[1]) | [
2,
48443,
14629,
14,
8800,
14,
1990,
77,
21015,
220,
201,
198,
2,
438,
66,
7656,
25,
40477,
12,
23,
438,
9,
438,
201,
198,
2,
5376,
25,
940,
220,
201,
198,
2,
46238,
25,
4023,
1378,
2503,
13,
21638,
726,
403,
13,
2398,
14,
329... | 2.03252 | 123 |
# -*- coding: utf-8 -*-
"A"
symbolsA = UnicodeMap()
_update = symbolsA.update
# Area A1
_update({
0xA140: 0xA140, # 1()
0xA141: 0xA141, # 2()
0xA142: 0xA142, # 3()
0xA143: 0xA143, # 4()
0xA144: 0xA144, # 5()
0xA145: 0xA145, # 6()
0xA146: 0xA146, # 7()
0xA147: 0xA147, # 8()
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
628,
198,
1,
32,
1,
198,
1837,
2022,
10220,
32,
796,
34371,
13912,
3419,
198,
62,
19119,
796,
14354,
32,
13,
19119,
198,
198,
2,
9498,
317,
16,
198,
62,
19119,
15090... | 1.356794 | 31,144 |
from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass
from typing import Callable, TypeVar
from pymon import Future, Pipe, cmap, creducel, hof_2, this_async
from pymon.core import returns_future
from moona.lifespan import LifespanContext
LifespanFunc = Callable[[LifespanCont... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4889,
540,
11,
5994,
19852,
198,
198,
6738,
12972,
2144,
1330,
10898,
11,
36039,
... | 2.596698 | 1,272 |
import discord
from discord.ext import commands
import json
import os
import psycopg2
import pytz
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
17331,
22163,
70,
17,
198,
11748,
12972,
22877,
198
] | 3.666667 | 27 |
#sub processes to scrape using the normal Google scraper
#include libs
import sys
sys.path.insert(0, '..')
from include import *
process1 = threading.Thread(target=scraper)
process2 = threading.Thread(target=save_sources)
process3 = threading.Thread(target=reset_scraper)
process4 = threading.Thread(target=reset_sourc... | [
2,
7266,
7767,
284,
42778,
1262,
262,
3487,
3012,
19320,
525,
198,
198,
2,
17256,
9195,
82,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
705,
492,
11537,
198,
6738,
2291,
1330,
1635,
198,
198,
14681,
16,
796,
4704,... | 3.119048 | 126 |
# producer to stream data into kafka
from boto.s3.connection import S3Connection
import datetime
import json
import bz2
from kafka import KafkaProducer
from kafka.errors import KafkaError
import time
import pytz
conn = S3Connection()
key = conn.get_bucket('aspk-reddit-posts').get_key('comments/RC_2017-11.bz2')
produc... | [
2,
9920,
284,
4269,
1366,
656,
479,
1878,
4914,
198,
6738,
275,
2069,
13,
82,
18,
13,
38659,
1330,
311,
18,
32048,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
275,
89,
17,
198,
6738,
479,
1878,
4914,
1330,
46906,
11547,
2... | 2.189189 | 740 |
#from pydantic import BaseModel as Model
# This gives us backwards compatible API calls
from fastapi_camelcase import CamelModel as Model
from typing import Optional, List
from datetime import date, datetime
| [
2,
6738,
279,
5173,
5109,
1330,
7308,
17633,
355,
9104,
198,
2,
770,
3607,
514,
16196,
11670,
7824,
3848,
198,
6738,
3049,
15042,
62,
66,
17983,
7442,
1330,
43281,
17633,
355,
9104,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
6738,
... | 3.864407 | 59 |
##################################################
# Import Own Assets
##################################################
from hyperparameter_hunter.data.data_core import BaseDataChunk, BaseDataset, NullDataChunk
##################################################
# Import Miscellaneous Assets
#########################... | [
29113,
14468,
2235,
198,
2,
17267,
11744,
41059,
198,
29113,
14468,
2235,
198,
6738,
8718,
17143,
2357,
62,
37488,
13,
7890,
13,
7890,
62,
7295,
1330,
7308,
6601,
1925,
2954,
11,
7308,
27354,
292,
316,
11,
35886,
6601,
1925,
2954,
198,
... | 2.946809 | 658 |
from getthat import getthat
# from sna.search import Sna
Sna = getthat("sna.search", "Sna")
sna = Sna()
| [
6738,
651,
5562,
1330,
651,
5562,
628,
198,
2,
422,
264,
2616,
13,
12947,
1330,
311,
2616,
198,
50,
2616,
796,
651,
5562,
7203,
82,
2616,
13,
12947,
1600,
366,
50,
2616,
4943,
628,
198,
82,
2616,
796,
311,
2616,
3419,
198
] | 2.571429 | 42 |
import os
import torch
from tqdm import tqdm
import numpy as np
import clip.clip as clip
import src.templates as templates
import src.datasets as datasets
from src.args import parse_arguments
from src.models.modeling import ClassificationHead, ImageEncoder, ImageClassifier
from src.models.eval import evaluate
... | [
11748,
28686,
198,
198,
11748,
28034,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
10651,
13,
15036,
355,
10651,
198,
198,
11748,
12351,
13,
11498,
17041,
355,
24019,
198,
11... | 3.277311 | 119 |
from flask import Blueprint
bp = Blueprint('main', __name__)
from app.main import routes # noqa: F401 | [
6738,
42903,
1330,
39932,
201,
198,
201,
198,
46583,
796,
39932,
10786,
12417,
3256,
11593,
3672,
834,
8,
201,
198,
201,
198,
201,
198,
201,
198,
6738,
598,
13,
12417,
1330,
11926,
220,
1303,
645,
20402,
25,
376,
21844
] | 2.871795 | 39 |
from django.db import models
from django.contrib.auth.models import User
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
628,
628,
197,
198
] | 3.25 | 24 |
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as st
import statsmodels.api as sm
import math
import numpy as np
__all__ = ["deming", "passingbablok", "linear"]
def deming(method1, method2,
vr=None, sdr=None, bootstrap=1000,
x_label='Method 1', y_label='Method 2', title... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
13,
34242,
355,
336,
198,
11748,
9756,
27530,
13,
15042,
355,
895,
198,
11748,
10688,
198,
11748,
299,
32152,
355... | 2.553708 | 3,789 |
#! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
setup.py
Desscription:
Install the maclib package.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
from setuptool... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
6530,
25,
198,
220,
220,
220,
220,
220,
220,
220,
9058,
13,
9078,
198,
220,
220,
220,
360,
408... | 2.314961 | 635 |
# Playing with pattern matching in python 3.10
# Add lambda to parse commands into command and corresponding units
parse_command = lambda x, y: (x, int(y))
# Read puzzle input
with open ('day2.txt') as fp:
commands = [parse_command(*x.strip().split(' ')) for x in fp.readlines()]
horizontal_position = 0
depth = 0... | [
2,
23911,
351,
3912,
12336,
287,
21015,
513,
13,
940,
198,
198,
2,
3060,
37456,
284,
21136,
9729,
656,
3141,
290,
11188,
4991,
198,
29572,
62,
21812,
796,
37456,
2124,
11,
331,
25,
357,
87,
11,
493,
7,
88,
4008,
198,
198,
2,
4149,... | 2.624679 | 389 |
#!/bin/env python3
from argparse import ArgumentParser
import csv
import os
from pathlib import Path
import subprocess
import sys
this_directory = Path(__file__).parent.resolve()
vector_script_path = this_directory / 'prepare_vector.sh'
if __name__ == '__main__':
parser = ArgumentParser(description='Converts al... | [
2,
48443,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
5661,
62,
34945,
... | 3.361233 | 227 |
from django.db import models
from django.contrib.auth.models import User
from django.core.validators import MinLengthValidator
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
1855,
24539,
47139,
1352,
198,
198,
2,
13610,
534,
4981,
994,... | 3.627907 | 43 |
import stable.modalities.dir_dataset as dataset
import os.path
| [
11748,
8245,
13,
4666,
27969,
13,
15908,
62,
19608,
292,
316,
355,
27039,
198,
11748,
28686,
13,
6978,
628
] | 3.368421 | 19 |
import logging
import jsonschema
from flask import Flask, jsonify
from flask import make_response
from flasgger import Swagger
from sample.config import Config
app = Flask(__name__)
app.config.update(Config or {})
init_logging(app)
Swagger(app)
from sample.api import api
app.register_blueprint(api, url_prefix='/... | [
11748,
18931,
198,
198,
11748,
44804,
684,
2395,
2611,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
198,
6738,
42903,
1330,
787,
62,
26209,
198,
198,
6738,
781,
292,
26679,
1330,
2451,
7928,
198,
6738,
6291,
13,
11250,
1330,
17056,
6... | 3.02439 | 123 |
import numpy as np
from .cnn import CNN
from .kviews import KViews
from .. import const
| [
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
66,
20471,
1330,
8100,
198,
6738,
764,
74,
33571,
1330,
509,
7680,
82,
198,
6738,
11485,
1330,
1500,
628
] | 3.137931 | 29 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import os
os.system('python function_18351015.py > log.txt')
| [
11748,
28686,
198,
418,
13,
10057,
10786,
29412,
2163,
62,
1507,
2327,
8784,
20,
13,
9078,
1875,
2604,
13,
14116,
11537,
198
] | 2.772727 | 22 |
import sys, os
import upandas as upd
# Run a single Python script
# For many simple, single file projects, you may find it inconvenient
# to write a complete Dockerfile. In such cases, you can run a Python
# script by using the Python Docker image directly:
#versions to consider: 3 (600+ MB), slim (150 MB) alpine (90... | [
11748,
25064,
11,
28686,
198,
11748,
510,
392,
292,
355,
2325,
198,
198,
2,
5660,
257,
2060,
11361,
4226,
198,
2,
1114,
867,
2829,
11,
2060,
2393,
4493,
11,
345,
743,
1064,
340,
37513,
198,
2,
284,
3551,
257,
1844,
25716,
7753,
13,
... | 2.525253 | 594 |
from __future__ import annotations
from typing import Literal
from prettyqt import constants, core, gui, widgets
from prettyqt.qt import QtCore, QtWidgets
from prettyqt.utils import InvalidParamError, bidict
ECHO_MODE = bidict(
normal=QtWidgets.QLineEdit.EchoMode.Normal,
no_echo=QtWidgets.QLineEdit.EchoMode... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
25659,
1691,
198,
198,
6738,
2495,
39568,
1330,
38491,
11,
4755,
11,
11774,
11,
40803,
198,
6738,
2495,
39568,
13,
39568,
1330,
33734,
14055,
11,
33734,
54,
312,
11407,
... | 2.639908 | 436 |
# ------------------------------------
# CODE BOOLA 2015 PYTHON WORKSHOP
# Mike Wu, Jonathan Chang, Kevin Tan
# Puzzle Challenges Number 8
# ------------------------------------
# INSTRUCTIONS:
# Write a function that takes an integer
# as its argument and converts it to a
# string. Return the first character of
... | [
2,
20368,
650,
220,
198,
2,
42714,
16494,
3535,
32,
1853,
350,
56,
4221,
1340,
30936,
9693,
3185,
198,
2,
4995,
18027,
11,
11232,
22597,
11,
7939,
11818,
198,
2,
23966,
44495,
7913,
807,
198,
2,
20368,
650,
220,
198,
198,
2,
3268,
... | 3.35443 | 158 |
import matplotlib.pyplot as plt
"""
A chi square (X2) statistic is used to investigate whether distributions
of categorical variables differ from one another. Here we consider 3 degrees
of freedom for our system. Plotted against 95% line"""
lidar_nis = []
with open('NISvals_laser.txt') as f:
for line in f:
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
37811,
198,
32,
33166,
6616,
357,
55,
17,
8,
24696,
318,
973,
284,
9161,
1771,
24570,
198,
1659,
4253,
12409,
9633,
13238,
422,
530,
1194,
13,
3423,
356,
2074,
513,
... | 2.555294 | 425 |
import torch
from offlinerl.utils.exp import select_free_cuda
task = "Hopper-v3"
task_data_type = "low"
task_train_num = 99
seed = 42
device = 'cuda'+":"+str(select_free_cuda()) if torch.cuda.is_available() else 'cpu'
obs_shape = None
act_shape = None
max_action = None
hidden_features = 256
hidden_layers = 2
atoms ... | [
11748,
28034,
198,
6738,
572,
24683,
75,
13,
26791,
13,
11201,
1330,
2922,
62,
5787,
62,
66,
15339,
198,
198,
35943,
796,
366,
28900,
2848,
12,
85,
18,
1,
198,
35943,
62,
7890,
62,
4906,
796,
366,
9319,
1,
198,
35943,
62,
27432,
6... | 2.380137 | 292 |
from django.contrib.admin.options import get_content_type_for_model
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.urls import reverse
from django.u... | [
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
25811,
1330,
651,
62,
11299,
62,
4906,
62,
1640,
62,
19849,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
25747,
1330,
42044,
33616,
9218,
198,
6738,
42625,
14208,
13,
... | 2.730094 | 741 |
import unittest
import torch
from torch.nn.functional import binary_cross_entropy as bce, l1_loss
from mlx.od.ssd.utils import (
ObjectDetectionGrid, BoxList, compute_intersection, compute_iou, F1)
if __name__ == '__main__':
unittest.main() | [
11748,
555,
715,
395,
198,
11748,
28034,
198,
6738,
28034,
13,
20471,
13,
45124,
1330,
13934,
62,
19692,
62,
298,
28338,
355,
275,
344,
11,
300,
16,
62,
22462,
198,
198,
6738,
25962,
87,
13,
375,
13,
824,
67,
13,
26791,
1330,
357,
... | 2.788889 | 90 |
'''
AUTOR: Javier Carracedo
Date: 08/10/2020
Auxiliar class to test methods from WilliamHillURLs.py
'''
import WilliamHillURLs
if __name__ == "__main__":
myVariable = WilliamHillURLs.WilliamHillURLs()
# Print all matches played actually.
for item in myVariable.GetAllMatchsPlayedActually(m... | [
7061,
6,
628,
220,
220,
220,
47044,
1581,
25,
44492,
20765,
2286,
78,
198,
220,
220,
220,
7536,
25,
8487,
14,
940,
14,
42334,
220,
628,
220,
220,
220,
47105,
4797,
1398,
284,
1332,
5050,
422,
3977,
36369,
21886,
82,
13,
9078,
198,
... | 2.029578 | 1,589 |
import glob
import os
import shutil
import sys
import tarfile
from tempfile import TemporaryDirectory
from ..utils import ERROR
from ..utils import Spinner
from ..utils import add_jobs_argument
from ..utils import add_no_ccache_argument
from ..utils import add_verbose_argument
from ..utils import box_print
from ..util... | [
11748,
15095,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
11748,
13422,
7753,
198,
6738,
20218,
7753,
1330,
46042,
43055,
198,
198,
6738,
11485,
26791,
1330,
33854,
198,
6738,
11485,
26791,
1330,
1338,
5083,
198,
6738,... | 3.854701 | 117 |
"""
A model class for Sale
"""
# local imports
from app.api.common.utils import dt
from app.api.v2.db_config import conn
from app.api.v2.models.cart import Cart
# cursor to perform database operations
cur = conn.cursor()
| [
37811,
198,
32,
2746,
1398,
329,
16467,
198,
37811,
198,
198,
2,
1957,
17944,
198,
6738,
598,
13,
15042,
13,
11321,
13,
26791,
1330,
288,
83,
198,
6738,
598,
13,
15042,
13,
85,
17,
13,
9945,
62,
11250,
1330,
48260,
198,
6738,
598,
... | 3.169014 | 71 |
import aiohttp
from bs4 import BeautifulSoup
import asyncio
from dembones.webpage import WebPage
import dembones.urltools as ut
import logging
log = logging.getLogger(__name__)
| [
11748,
257,
952,
4023,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
30351,
952,
198,
6738,
1357,
35095,
13,
12384,
7700,
1330,
5313,
9876,
198,
11748,
1357,
35095,
13,
333,
2528,
10141,
355,
3384,
198,
198,
11748,
18931,
... | 3.254545 | 55 |
from ..factory import Type
| [
6738,
11485,
69,
9548,
1330,
5994,
628
] | 4 | 7 |
import argparse
import train_args
def get_arg_parser() -> argparse.ArgumentParser:
'''
A set of parameters for evaluation
'''
parser = train_args.get_arg_parser()
parser.add_argument('--load_path', type=str, help='the path of the model to test')
parser.add_argument('--eval_train', action='store... | [
11748,
1822,
29572,
198,
11748,
4512,
62,
22046,
198,
198,
4299,
651,
62,
853,
62,
48610,
3419,
4613,
1822,
29572,
13,
28100,
1713,
46677,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
317,
900,
286,
10007,
329,
12660,
198,
... | 3.155556 | 225 |
"""
Creates a fidelity estimator for any pure state, using randomized Pauli measurement strategy.
Author: Akshay Seshadri
"""
import warnings
import numpy as np
import scipy as sp
from scipy import optimize
import project_root # noqa
from src.optimization.proximal_gradient import minimize_proximal_gradi... | [
37811,
198,
220,
220,
220,
7921,
274,
257,
37744,
3959,
1352,
329,
597,
5899,
1181,
11,
1262,
23925,
3362,
72,
15558,
4811,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
6434,
25,
317,
50133,
323,
311,
5069,
324,
380,
198,
37811,... | 2.600393 | 8,646 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 10:29:52 2018
@author: lin
"""
import numpy as np
import matplotlib.pyplot as plt
data1 = np.load("datasets/breast-cancer.npz")
data2 = np.load("datasets/diabetes.npz")
data3 = np.load("datasets/digit.npz")
data4 = np.load("datasets/iris.npz")
... | [
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,
3300,
3158,
2579,
838,
25,
1959,
25,
4309,
2864,
198,
198,
31,
9800,
25,
9493,
198,
37811... | 2.337662 | 154 |
# dumpfreeze
# Create MySQL dumps and backup to Amazon Glacier
import os
import logging
import datetime
import click
import uuid
import sqlalchemy as sa
from dumpfreeze import backup as bak
from dumpfreeze import aws
from dumpfreeze import inventorydb
from dumpfreeze import __version__
logger = logging.getLogger(__na... | [
2,
10285,
5787,
2736,
198,
2,
13610,
33476,
45514,
290,
11559,
284,
6186,
49120,
198,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
4818,
8079,
198,
11748,
3904,
198,
11748,
334,
27112,
198,
11748,
44161,
282,
26599,
355,
473,
198,
... | 3.315436 | 149 |
import csv
FLAGS = None
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='make coordinate.csv for data')
parser.add_argument('--width', '-w', type=int,
required=False,
help='input width')
parser.add_argument('... | [
11748,
269,
21370,
198,
198,
38948,
50,
796,
6045,
198,
220,
220,
220,
220,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
1822,
29572,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
2... | 2.051724 | 232 |
"""
Script to create dataframe from serpent bumat files
including all the nuclides.
Zsolt Elter 2019
"""
import json
import os
with open ('nuclides.json') as json_file:
nuclidesDict = json.load(json_file)
#final name of the file
dataFrame='PWR_UOX-MOX_BigDataFrame-SF-GSRC-noReactorType.csv'
def readInventory... | [
37811,
198,
7391,
284,
2251,
1366,
14535,
422,
33727,
275,
27798,
3696,
198,
8201,
477,
262,
14364,
565,
1460,
13,
198,
198,
57,
82,
5978,
2574,
353,
13130,
198,
198,
37811,
198,
11748,
33918,
198,
11748,
28686,
198,
4480,
220,
1280,
... | 2.134859 | 1,661 |
from mongoengine import disconnect
from waitress import serve
from todolist_backend.server import app, get_configs
from .database import panic_init
from .info import MONGOENGINE_ALIAS
| [
6738,
285,
25162,
18392,
1330,
22837,
198,
6738,
44511,
1330,
4691,
198,
6738,
284,
67,
349,
396,
62,
1891,
437,
13,
15388,
1330,
598,
11,
651,
62,
11250,
82,
198,
6738,
764,
48806,
1330,
13619,
62,
15003,
198,
6738,
764,
10951,
1330,... | 3.647059 | 51 |
a = int(input("a = "))
b = int(input("b = "))
print("{} + {} = {}".format(a, b, a+b)) | [
64,
796,
493,
7,
15414,
7203,
64,
796,
366,
4008,
198,
65,
796,
493,
7,
15414,
7203,
65,
796,
366,
4008,
198,
198,
4798,
7203,
90,
92,
1343,
23884,
796,
23884,
1911,
18982,
7,
64,
11,
275,
11,
257,
10,
65,
4008
] | 2.047619 | 42 |
# File: archer_views.py
#
# Copyright (c) 2016-2022 Splunk 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 appli... | [
2,
9220,
25,
610,
2044,
62,
33571,
13,
9078,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
12,
1238,
1828,
13341,
2954,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
19... | 3.668675 | 166 |
import re
import sys
from collections import defaultdict
from types import TracebackType
from typing import (
Callable,
DefaultDict,
Dict,
Generator,
List,
Optional,
Tuple,
Type,
Union,
)
# This is a mapping of plugin_name -> PluginError instances
# all PluginErrors get added to thi... | [
11748,
302,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
3858,
1330,
34912,
1891,
6030,
198,
6738,
19720,
1330,
357,
198,
220,
220,
220,
4889,
540,
11,
198,
220,
220,
220,
15161,
35,
713,
11,
198,
220,
220,
220,
... | 2.54446 | 2,103 |
import uvicorn
from gql import gql, reference_resolver, query
from stargql import GraphQL
from helper import get_user_by_id, users
type_defs = gql("""
type Query {
me: User
}
type User @key(fields: "id") {
id: ID!
name: String
username: String
}
""")
app = GraphQL(type_defs=type_defs, fe... | [
11748,
334,
25531,
1211,
198,
198,
6738,
308,
13976,
1330,
308,
13976,
11,
4941,
62,
411,
14375,
11,
12405,
198,
6738,
336,
853,
13976,
1330,
29681,
9711,
198,
198,
6738,
31904,
1330,
651,
62,
7220,
62,
1525,
62,
312,
11,
2985,
198,
... | 2.453416 | 161 |
from __future__ import absolute_import, division, print_function
import stripe
import pytest
pytestmark = pytest.mark.asyncio
TEST_RESOURCE_ID = "fee_123"
TEST_FEEREFUND_ID = "fr_123"
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
39858,
198,
198,
11748,
12972,
9288,
628,
198,
9078,
9288,
4102,
796,
12972,
9288,
13,
4102,
13,
292,
13361,
952,
198,
198,
51,
6465,
62,
... | 2.728571 | 70 |
busyschedule() | [
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
10885,
893,
2395,
5950,
3419
] | 1.6 | 15 |
#!/usr/bin/env python
from unittest import TestCase
from fundamentals.backtracking.path_through_grid import PathThroughGrid
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
33099,
13,
1891,
36280,
13,
6978,
62,
9579,
62,
25928,
1330,
10644,
15046,
41339,
198
] | 3.676471 | 34 |
import sqlite3
import Sources.Parser
conn = sqlite3.connect("Database/vitg.db")
cursor = conn.cursor()
cursor.execute("SELECT * FROM Locations")
results = cursor.fetchall()
print(results)
conn.close()
parser = Sources.Parser.Parser()
words = [u"", u""]
for word in words:
command = parser.getCommand(word)
pr... | [
11748,
44161,
578,
18,
198,
11748,
26406,
13,
46677,
198,
198,
37043,
796,
44161,
578,
18,
13,
8443,
7203,
38105,
14,
85,
270,
70,
13,
9945,
4943,
198,
198,
66,
21471,
796,
48260,
13,
66,
21471,
3419,
198,
66,
21471,
13,
41049,
7203... | 2.87069 | 116 |
import numpy as np
import pandas as pd
import sys
import string
import time
import subprocess
from collections import Counter
import string
import random
#First argument is the gene score distribution that you want to draw from, the second is the type of clusters to generate
#If 'large' only clusters with a large nu... | [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
25064,
198,
11748,
4731,
198,
11748,
640,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
15034,
198,
11748,
4731,
198,
11748,
4738,
198,
198,
2,... | 3.858696 | 184 |
"""Convenience functions for dictionary access and YAML"""
from sklearn.utils import Bunch
from collections import OrderedDict
from collections.abc import Mapping
import copy
import yaml
# ----------------------------------------------------------------------------
def deep_convert_list_dict(d, skip_list_level=0):
... | [
37811,
3103,
574,
1240,
5499,
329,
22155,
1895,
290,
575,
2390,
43,
37811,
198,
198,
6738,
1341,
35720,
13,
26791,
1330,
347,
3316,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
17268,
13,
39305,
1330,
337,
5912,
198,
11748,
... | 2.674249 | 2,462 |
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2016 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not... | [
29113,
29113,
7804,
2235,
201,
198,
2,
1002,
407,
5081,
4306,
287,
428,
2393,
393,
428,
7515,
338,
10483,
4541,
13,
14116,
201,
198,
2,
2393,
262,
1708,
6634,
290,
16625,
4174,
25,
201,
198,
2,
201,
198,
2,
15069,
1584,
31475,
42,
... | 3.068213 | 2,155 |
import logging
import yaml
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
11748,
331,
43695,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 2.913043 | 23 |
#!/usr/bin/env python3
# -*- coding: iso-8859-15 -*-
# 2017, Samantha Klasfeld, the Wagner Lab
# the Perelman School of Medicine, the University of Pennsylvania
# Samantha Klasfeld, 12-21-2017
import argparse
import sys
import pandas as pd
import numpy as np
parser = argparse.ArgumentParser(description="this scrip... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
532,
9,
12,
19617,
25,
47279,
12,
3459,
3270,
12,
1314,
532,
9,
12,
198,
2,
2177,
11,
34778,
14770,
292,
16265,
11,
262,
26451,
3498,
198,
2,
262,
17229,
75,
805,
396... | 2.745577 | 3,109 |
# parse the input
with open("6-input.txt") as f:
fish = [int(n) for n in f.readline().split(",")]
startcounts = dict(zip(range(0, 9), [0 for x in range(9)]))
for f in fish:
startcounts[f] += 1
counts = startcounts
for day in range(80):
print(day, [counts[v] for v in range(9)])
counts = updatedcounts... | [
2,
21136,
262,
5128,
198,
4480,
1280,
7203,
21,
12,
15414,
13,
14116,
4943,
355,
277,
25,
198,
220,
220,
220,
5916,
796,
685,
600,
7,
77,
8,
329,
299,
287,
277,
13,
961,
1370,
22446,
35312,
7,
2430,
15437,
198,
198,
9688,
9127,
... | 2.36087 | 230 |
#!/usr/bin/env python
#
#
standalone = True
import os, numpy as np
os.environ['MCVINE_MPI_BINDING'] = 'NONE'
import unittestX as unittest
if __name__ == "__main__": unittest.main()
# End of file
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
628,
198,
1481,
17749,
796,
6407,
198,
198,
11748,
28686,
11,
299,
32152,
355,
45941,
198,
418,
13,
268,
2268,
17816,
9655,
53,
8881,
62,
7378,
40,
62,
33,
12115,
2751,
... | 2.252632 | 95 |
from ZeroKnowledge import primality
import random
if __name__ == "__main__":
owp = bbs()
print(owp(70203203))
print(owp(12389))
| [
6738,
12169,
23812,
2965,
1330,
2684,
1483,
198,
11748,
4738,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
12334,
79,
796,
275,
1443,
3419,
198,
220,
220,
220,
3601,
7,
322,
79,
7,
2154,
123... | 2.389831 | 59 |
#!/usr/bin/env python
#
###############################################################################
# Author: Greg Zynda
# Last Modified: 12/11/2019
###############################################################################
# BSD 3-Clause License
#
# Copyright (c) 2019, Greg Zynda
# All rights reserved.
#
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
6434,
25,
8547,
40905,
45658,
198,
2,
4586,
40499,
25,
1105,
14,
1157,
14,
23344,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
347,
... | 3.34443 | 781 |
#!/usr/bin/python3
DOC="""plotCurve
plotCurve is used to create vertical profiles of different lateral ylabel statistics of FEOTS output.
Usage:
plotCurve plot <file> [--out=<out>] [--opts=<opts>] [--scalex=<scalex>] [--xlabel=<xlabel>] [--ylabel=<ylabel>]
Commands:
plot Create a vertical profile p... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
38715,
2625,
15931,
29487,
26628,
303,
198,
198,
29487,
26628,
303,
318,
973,
284,
2251,
11723,
16545,
286,
1180,
25653,
331,
18242,
7869,
286,
18630,
33472,
5072,
13,
198,
198,
28350,
25,
... | 2.621103 | 417 |
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | [
29113,
29113,
14468,
198,
2,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
220,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
220,
9387,
351,
428,
670,
329,
3224,
1321,
198,
... | 2.750421 | 2,376 |
#import pcap
#import dpkt
#import dnet
from collections import defaultdict
from scapy.all import *
from scapy.all import send as ssend
import netifaces
import getopt
import datetime
conf.sniff_promisc=True
pcap_specified = False
detection_map = defaultdict(list)
if __name__ == "__main__":
main()
| [
2,
11748,
279,
11128,
198,
2,
11748,
288,
79,
21841,
198,
2,
11748,
288,
3262,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
629,
12826,
13,
439,
1330,
1635,
198,
6738,
629,
12826,
13,
439,
1330,
3758,
355,
264,
21280,
198,
11748,
... | 3.040404 | 99 |
"""Detail Yeti's Malware object structure."""
from .entity import Entity
Entity.datatypes[Malware.type] = Malware
| [
37811,
11242,
603,
6430,
72,
338,
4434,
1574,
2134,
4645,
526,
15931,
198,
198,
6738,
764,
26858,
1330,
20885,
198,
198,
32398,
13,
19608,
265,
9497,
58,
15029,
1574,
13,
4906,
60,
796,
4434,
1574,
198
] | 3.222222 | 36 |
from dsbox.template.template import DSBoxTemplate
from d3m.metadata.problem import TaskKeyword
from dsbox.template.template_steps import TemplateSteps
from dsbox.schema import SpecializedProblem
import typing
import numpy as np # type: ignore
| [
6738,
288,
82,
3524,
13,
28243,
13,
28243,
1330,
17400,
14253,
30800,
220,
198,
6738,
288,
18,
76,
13,
38993,
13,
45573,
1330,
15941,
9218,
4775,
220,
198,
6738,
288,
82,
3524,
13,
28243,
13,
28243,
62,
20214,
1330,
37350,
8600,
82,
... | 3.405405 | 74 |
time = eval(input())
qtdtime = [3600, 60, 1]
result = []
for i in qtdtime:
qtd = time // i
result.append(str(qtd))
time -= qtd * i
print(f'{result[0]}:{result[1]}:{result[2]}')
| [
2435,
796,
5418,
7,
15414,
28955,
198,
80,
8671,
2435,
796,
685,
2623,
405,
11,
3126,
11,
352,
60,
198,
20274,
796,
17635,
198,
198,
1640,
1312,
287,
10662,
8671,
2435,
25,
198,
220,
220,
220,
10662,
8671,
796,
640,
3373,
1312,
198,... | 2.181818 | 88 |
from collections import Counter | [
6738,
17268,
1330,
15034
] | 7.75 | 4 |
import threading
import functools
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
"""
Once an engine is created is is not destroyed until the program itself exits.
Engines are used to produce a new session when a context is entered.
When a context is exited, the... | [
11748,
4704,
278,
198,
11748,
1257,
310,
10141,
198,
198,
11748,
44161,
282,
26599,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
628,
198,
14881,
796,
2377,
283,
876,
62,
8692,
3419,
628... | 2.260309 | 1,164 |
import numpy as np
from rover_sates import *
from state_machine import *
# This is where you can build a decision tree for determining throttle, brake and steer
# commands based on the output of the perception_step() function
| [
11748,
299,
32152,
355,
45941,
198,
6738,
35761,
62,
82,
689,
1330,
1635,
198,
6738,
1181,
62,
30243,
1330,
1635,
628,
198,
198,
2,
770,
318,
810,
345,
460,
1382,
257,
2551,
5509,
329,
13213,
29976,
11,
20439,
290,
27401,
198,
2,
97... | 4.163636 | 55 |
import sys
from loguru import logger
logger.remove()
logger.add(
sys.stdout,
format='{level.icon} {time:YYYY-MM-DD HH:mm:ss} <lvl>{level}\t{message}</lvl>',
colorize=True,
)
| [
11748,
25064,
198,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6404,
1362,
13,
28956,
3419,
198,
6404,
1362,
13,
2860,
7,
198,
220,
220,
220,
25064,
13,
19282,
448,
11,
198,
220,
220,
220,
5794,
11639,
90,
5715,
13,
4749,
92,
139... | 2.26506 | 83 |
"""
Copyright 2013 Rackspace
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
dist... | [
37811,
198,
15269,
2211,
37927,
13200,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7... | 3.93662 | 142 |
import os
from dash import dcc, html
URL_PATH_SEP = '/'
URL_BASE_PATHNAME = os.getenv('REPORT_URL_BASE', URL_PATH_SEP)
if URL_BASE_PATHNAME[-1] != URL_PATH_SEP:
URL_BASE_PATHNAME += URL_PATH_SEP
def make_dash_table(df):
"""Return a dash definition of an HTML table for a Pandas dataframe"""
table = []
... | [
11748,
28686,
198,
6738,
14470,
1330,
288,
535,
11,
27711,
198,
198,
21886,
62,
34219,
62,
5188,
47,
796,
31051,
6,
198,
21886,
62,
33,
11159,
62,
34219,
20608,
796,
28686,
13,
1136,
24330,
10786,
2200,
15490,
62,
21886,
62,
33,
11159... | 2.257642 | 229 |
from social_core.backends.ubuntu import UbuntuOpenId
| [
6738,
1919,
62,
7295,
13,
1891,
2412,
13,
32230,
1330,
14949,
11505,
7390,
198
] | 3.785714 | 14 |
# -*- coding: utf-8 -*-
'''
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
'''
# pylint: disable=3rd-party-module-not-gated
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import tempfile
import shutil
# Import Salt Testing Libs
from tests.support.mixins import Lo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
220,
220,
220,
1058,
8189,
9800,
25,
9180,
5069,
509,
2743,
3972,
1279,
33708,
5069,
74,
31,
82,
2501,
25558,
13,
785,
29,
198,
7061,
6,
198,
2,
279,
... | 2.743243 | 222 |