content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/3/8 8:25 下午
# @Author : xinming
# @File : 62_uniq_paths.py
if __name__=='__main__':
out = Solution().uniquePaths(3, 7)
print(out) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
33160,
14,
18,
14,
23,
807,
25,
1495,
220,
10310,
233,
39355,
230,
198,
2,
2488... | 1.971429 | 105 |
from rest_framework.response import Response
from rest_framework.views import APIView
from .serializers import SponsorSerializer, HackerSerializer
| [
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
198,
6738,
764,
46911,
11341,
1330,
23389,
32634,
7509,
11,
34399,
32634,
7509,
628
] | 4.382353 | 34 |
import os
config_options = {
'development':DevConfig,
'production':ProdConfig
} | [
11748,
28686,
198,
220,
220,
220,
220,
628,
198,
11250,
62,
25811,
796,
1391,
198,
1549,
68,
1091,
434,
10354,
13603,
16934,
11,
198,
6,
25493,
10354,
2964,
67,
16934,
198,
92
] | 2.6875 | 32 |
import collections
import datetime
import json
from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, Callable, NamedTuple, Set
from django.db.models import Sum
from django.urls import reverse
from django.utils.html import format_html
from django.utils.http import urlencode
from django... | [
11748,
17268,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
360,
713,
11,
4889,
540,
11,
34441,
51,
29291,
11,
5345,
... | 2.738701 | 708 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from flask import Blueprint
from ggrc import settings
from ggrc.app import app
... | [
2,
15069,
357,
34,
8,
1853,
3012,
3457,
1539,
7035,
11,
290,
20420,
1279,
3826,
37195,
20673,
2393,
29,
198,
2,
49962,
739,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
1279,
3826,
385... | 3.123348 | 908 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
Basis Pursuit DeNoising
=======================
This example demonstrates the use of class :class:`.admm.bpdn.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
770,
2393,
318,
636,
286,
262,
6226,
1581,
8220,
5301,
13,
14890,
286,
262,
6634,
198,
2,
290,
2836,
5964,
460,
... | 2.780728 | 1,318 |
from os import path, listdir, remove
import platform
import io
from datetime import datetime, timedelta
import time
import json
import pandas as pd
from tinymongo import TinyMongoClient
import pytest
from flask import url_for
import publicAPI.exceptions as exceptions
import publicAPI.config as api_utils
import helper... | [
6738,
28686,
1330,
3108,
11,
1351,
15908,
11,
4781,
198,
11748,
3859,
198,
11748,
33245,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
700... | 1.962032 | 7,480 |
"""
Licensed under the Unlicense License;
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://unlicense.org
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BAS... | [
37811,
201,
198,
49962,
739,
262,
791,
43085,
13789,
26,
201,
198,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
201,
198,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
201,
198,
201,
198,
220,
220,
220,
... | 3.558559 | 222 |
import requests, json
from getpass import getpass
from urllib3 import disable_warnings
from urllib3.exceptions import InsecureRequestWarning
import pprint
disable_warnings(category=InsecureRequestWarning)
# Username and password
user = "admin"
password = getpass("Enter your Infoblox password: ")
# Setup pretty print... | [
11748,
7007,
11,
33918,
198,
6738,
651,
6603,
1330,
651,
6603,
198,
6738,
2956,
297,
571,
18,
1330,
15560,
62,
40539,
654,
198,
6738,
2956,
297,
571,
18,
13,
1069,
11755,
1330,
554,
22390,
18453,
20361,
198,
11748,
279,
4798,
198,
198... | 3.142857 | 301 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © Manoel Vilela
#
# @project: Memory Analysis Report Footprint
# @author: Manoel Vilela
# @email: manoel_vilela@engineer.com
#
from tqdm import tqdm
import pandas as pd
import mar
__version__ = '0.1.1'
__date__ = '2016'
__author__ = 'Manoel ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
220,
220,
15069,
10673,
1869,
78,
417,
569,
576,
5031,
198,
2,
198,
2,
220,
220,
220,
2488,
1... | 2.230769 | 208 |
from __future__ import absolute_import, division, print_function
from mock import MagicMock, patch
from ....tests.helpers import requires_ipython_ge_012, IPYTHON_GE_012_INSTALLED
if IPYTHON_GE_012_INSTALLED:
from ..terminal import glue_terminal
@requires_ipython_ge_012
if __name__ == "__main__":
import p... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
15290,
1330,
6139,
44,
735,
11,
8529,
198,
198,
6738,
19424,
41989,
13,
16794,
364,
1330,
4433,
62,
541,
7535,
62,
469,
62,
30206,
11,
610... | 2.787402 | 127 |
'''
This code is used to run pong-v0 using konda actor critic.
Note that you can use linear fully connected network or CNN, please check pongv0_konda.py.
and uncomment.
Also note that for critic input_dims argument put 320, if you are using CNN arcitecture
If you are using fully connected layers then input critic_inpu... | [
7061,
6,
198,
1212,
2438,
318,
973,
284,
1057,
279,
506,
12,
85,
15,
1262,
479,
13533,
8674,
4014,
13,
198,
6425,
326,
345,
460,
779,
14174,
3938,
5884,
3127,
393,
8100,
11,
3387,
2198,
279,
506,
85,
15,
62,
74,
13533,
13,
9078,
... | 2.266175 | 2,983 |
from scipy import special
import numpy as np
from pykrige.ok import OrdinaryKriging
def bore_to_fraction(interval_len, bore_dict):
"""
convert a single bore hole log to clay fraction. the interval length in depth can be customized
:param interval_len: length for a single interval
:param bore_dict : a d... | [
6738,
629,
541,
88,
1330,
2041,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12972,
74,
4359,
68,
13,
482,
1330,
14230,
3219,
42,
4359,
278,
198,
198,
4299,
18631,
62,
1462,
62,
69,
7861,
7,
3849,
2100,
62,
11925,
11,
18631,
62,
... | 2.570299 | 2,276 |
# ------------------------------
# 133. Clone Graph
#
# Description:
# Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
# OJ's undirected graph serialization:
# Nodes are labeled uniquely.
#
# We use # as a separator for each node, and , as a separator for node label and... | [
2,
34400,
26171,
198,
2,
22169,
13,
30698,
29681,
198,
2,
220,
198,
2,
12489,
25,
198,
2,
30698,
281,
3318,
1060,
276,
4823,
13,
5501,
10139,
287,
262,
4823,
4909,
257,
6167,
290,
257,
1351,
286,
663,
12020,
13,
198,
2,
440,
41,
... | 2.938429 | 471 |
#!/usr/bin/python
#_*_ coding:UTF-8 _*_
#
# Copyright by Larify. All Rights Reserved.
import json
import urllib
import urllib2
import sys
import time
import re
from workflow import Workflow3
from i18n import lang
reload(sys)
sys.setdefaultencoding('utf-8')
if __name__ == '__main__':
wf = Workflow3()
DEFAUL... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
62,
9,
62,
19617,
25,
48504,
12,
23,
4808,
9,
62,
198,
2,
198,
2,
15069,
416,
25577,
1958,
13,
1439,
6923,
33876,
13,
198,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
11748,
... | 2.531034 | 145 |
# Copyright (c) Charl P. Botha, TU Delft
# All rights reserved.
# See COPYRIGHT for details.
# had to disable this one due to stupid itkLevelSetNode non-wrapping
# in ITK-2-4-1
# isn't wrapped anymore, no idea why.
#class gvfgac:
# kits = ['itk_kit']
# cats = ['Insight']
# will fix when I rework the regist... | [
2,
15069,
357,
66,
8,
6258,
350,
13,
5747,
64,
11,
309,
52,
4216,
701,
198,
2,
1439,
2489,
10395,
13,
198,
2,
4091,
27975,
38162,
9947,
329,
3307,
13,
628,
198,
198,
2,
550,
284,
15560,
428,
530,
2233,
284,
8531,
340,
74,
4971,
... | 2.819964 | 561 |
import requests,os,time
SITE_URL=""
SLEEP_SEC=300 #5 mins
while True:
response=requests.get(SITE_URL)
print(response)
if response.status_code!=200:
os.system('notify-send "Website Down" "'+SITE_URL+'is down"')
break
time.sleep(SLEEP_SEC) | [
11748,
7007,
11,
418,
11,
2435,
198,
198,
50,
12709,
62,
21886,
33151,
198,
50,
2538,
8905,
62,
23683,
28,
6200,
1303,
20,
23550,
198,
4514,
6407,
25,
198,
220,
220,
220,
2882,
28,
8897,
3558,
13,
1136,
7,
50,
12709,
62,
21886,
8,... | 2.192 | 125 |
import logging
import asyncio
import os
import time
from pprint import pprint
from opencensus_prometheus import OpenCensusPrometheus
from traffic_generator import TrafficGenerator
if __name__ == "__main__":
Main.main()
| [
11748,
18931,
198,
11748,
30351,
952,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
6738,
1280,
66,
7314,
62,
16963,
36916,
1330,
4946,
34,
7314,
24129,
36916,
198,
6738,
4979,
62,
8612,
1352,
1330... | 3.439394 | 66 |
from django import forms
from .models import Teacher, Salary, EmployeeAttendance, Schedual
from django.contrib.auth.forms import UserCreationForm
from django.utils import timezone
class SchedualForm(forms.ModelForm):
"""
docstring
"""
| [
6738,
42625,
14208,
1330,
5107,
201,
198,
6738,
764,
27530,
1330,
32019,
11,
46860,
11,
36824,
8086,
437,
590,
11,
10011,
646,
282,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
11787,
12443,
341,
8479,
201,
... | 2.921348 | 89 |
#! /usr/bin/env python3
import argparse, os, subprocess, sys
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..')))
import script.common as common
import script.revision as revision
if __name__ == '__main__':
sys.exit(main()) | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
11,
28686,
11,
850,
14681,
11,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
27237,
6978,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
... | 2.747368 | 95 |
# Copyright 2020 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 to... | [
2,
15069,
12131,
43208,
21852,
1766,
1539,
12052,
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.725061 | 1,644 |
from .db_connection import SqliteDBConnection, MongoDBConnection
from .kg_connection import ASERKGConnection, ASERConceptConnection
| [
6738,
764,
9945,
62,
38659,
1330,
311,
13976,
578,
35,
2749,
261,
1606,
295,
11,
42591,
35,
2749,
261,
1606,
295,
198,
6738,
764,
10025,
62,
38659,
1330,
7054,
1137,
42,
38,
32048,
11,
7054,
1137,
3103,
984,
32048,
198
] | 3.3 | 40 |
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
| [
6738,
1366,
62,
320,
1819,
1010,
13,
27604,
13,
9503,
1746,
1330,
7308,
55,
8439,
11522,
17818,
42350,
34,
21370,
3546,
26634,
628
] | 3.608696 | 23 |
# ----- Import Zone -----
from Aforca import util
# ----- Loop Zone -----
util.gamestart()
input('Enter to exit')
| [
2,
37404,
17267,
13035,
37404,
198,
6738,
317,
1640,
6888,
1330,
7736,
198,
198,
2,
37404,
26304,
13035,
37404,
198,
22602,
13,
28483,
395,
433,
3419,
198,
198,
15414,
10786,
17469,
284,
8420,
11537,
198
] | 3.314286 | 35 |
import Cimpl
def blue_channel(img: Cimpl.Image) -> Cimpl.Image:
"""
Author: Zakaria Ismail
RETURNS an ImageObject whose
channels except for blue, have
been zeroed, after being
PASSED an Cimpl.Image object
>>> Cimpl.show(blue_channel('p2-original.png'))
-> An a blue filtered image wil... | [
11748,
327,
23928,
628,
198,
4299,
4171,
62,
17620,
7,
9600,
25,
327,
23928,
13,
5159,
8,
4613,
327,
23928,
13,
5159,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6434,
25,
32605,
10312,
1148,
4529,
628,
220,
220,
220,
30826,
... | 2.536406 | 1,085 |
enc = open("enc.txt", "r")
enc_read = enc.readlines()
enc.close()
replaced_enc_lst = []
for line in enc_read:
replaced_enc_lst += [(((((line.replace("' &&", "")).replace("\n", "")).replace(" password.charAt(", "")).replace(")", "")).replace(" ", "")).replace("'", "")]
place = []
flag_chr = []
for sho... | [
12685,
796,
1280,
7203,
12685,
13,
14116,
1600,
366,
81,
4943,
198,
12685,
62,
961,
796,
2207,
13,
961,
6615,
3419,
198,
12685,
13,
19836,
3419,
198,
198,
260,
21820,
62,
12685,
62,
75,
301,
796,
17635,
198,
198,
1640,
1627,
287,
22... | 2.410156 | 256 |
import glob
import json
import re
import os
GREEN = "\033[0;32;40m "
YELLOW = "\033[1;33;40m "
RED = "\033[1;31;40m "
RESET = "\033[0;37;40m "
def getPackagesList():
"""
Retrieves the list of packages as declared in the "workspaces" property of
package.json
:return: Object whose keys represent the pa... | [
11748,
15095,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
28686,
198,
198,
43016,
796,
37082,
44427,
58,
15,
26,
2624,
26,
1821,
76,
366,
198,
56,
23304,
3913,
796,
37082,
44427,
58,
16,
26,
2091,
26,
1821,
76,
366,
198,
22083,
... | 2.660027 | 753 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
2,
46424,
347,
43312,
38644,
38559,
24290,
9878,
11290,
46424,
198,
2,
198,
2,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
220,
13096,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
1378... | 3.071739 | 460 |
from embedKB.models.base import GeneralFramework
import tensorflow as tf
from embedKB.utils import debug
| [
6738,
11525,
22764,
13,
27530,
13,
8692,
1330,
3611,
21055,
6433,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11525,
22764,
13,
26791,
1330,
14257,
628
] | 3.925926 | 27 |
#!/usr/bin/env python
# Copyright 2020 KCL-BMEIS - King's College London
# 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 a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
12131,
509,
5097,
12,
33,
11682,
1797,
532,
2677,
338,
5535,
3576,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,... | 2.886657 | 697 |
# Copyright (c) 2016, The Bifrost Authors. 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 list of conditions a... | [
198,
2,
15069,
357,
66,
8,
1584,
11,
383,
347,
361,
23341,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
2... | 3.352144 | 886 |
from . import treelstm
from . import converter
| [
6738,
764,
1330,
2054,
417,
301,
76,
198,
6738,
764,
1330,
38394,
198
] | 3.615385 | 13 |
'''This module contains functions to manage the dot-notated contact information used internally
and transforming it to and from the JSON-based format described in the spec.'''
from base64 import b85encode
import os
import tempfile
from typing import Union
from PIL import Image
from retval import RetVal, ErrOutOfRange... | [
7061,
6,
1212,
8265,
4909,
5499,
284,
6687,
262,
16605,
12,
1662,
515,
2800,
1321,
973,
20947,
220,
198,
392,
25449,
340,
284,
290,
422,
262,
19449,
12,
3106,
5794,
3417,
287,
262,
1020,
2637,
7061,
198,
6738,
2779,
2414,
1330,
275,
... | 2.599718 | 4,262 |
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
2,
15069,
357,
66,
8,
13130,
8180,
10501,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
... | 2.100256 | 3,521 |
# coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
9986,
69,
1041,
7824,
628,
220,
220,
220,
22492,
28578,
770,
318,
257,
6291,
9986,
69,
1041,
4382,
543,
3578,
329,
8748,
1231,
597,
18239,
13,
383,
9986,
69,
104... | 2.588577 | 2,241 |
# Generated by Django 3.0 on 2020-10-27 04:30
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
319,
12131,
12,
940,
12,
1983,
8702,
25,
1270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
"""Helpers to construct a transformation pipeline
A transformer is, broadly speaking, a function that takes a DataFrame as
it's only argument and returns a new DataFrame. Using this fairly simple
definition we can compose together multiple transformations into new
transformations, and we can parameterize the transform... | [
37811,
12621,
19276,
284,
5678,
257,
13389,
11523,
198,
198,
32,
47385,
318,
11,
18633,
5486,
11,
257,
2163,
326,
2753,
257,
6060,
19778,
355,
198,
270,
338,
691,
4578,
290,
5860,
257,
649,
6060,
19778,
13,
8554,
428,
6547,
2829,
198,... | 2.973002 | 5,667 |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import abspath, dirname, join, exists
import pickle
import rdflib
from rdflib import Namespace, Literal
from indra.databases import go_client
rdf_file = join(dirname(abspath(__file__)), '..', 'resource... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
6738,
3170,
1040,
1330,
8633,
11,
965,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
26672,
3672,
11,
4654,
11,
7160,
198,
... | 2.71179 | 229 |
"""
# Nodemaps
When different versions of a TF dataset exist, it makes sense to map the nodes from the
older version to nodes of the newer version.
If we have annotations on the older version
(possibly created with considerable man-machine labor),
we can use such node mappings to transfer the annotations to the newer... | [
37811,
198,
2,
399,
375,
368,
1686,
198,
198,
2215,
1180,
6300,
286,
257,
24958,
27039,
2152,
11,
340,
1838,
2565,
284,
3975,
262,
13760,
422,
262,
198,
19892,
2196,
284,
13760,
286,
262,
15064,
2196,
13,
198,
198,
1532,
356,
423,
3... | 3.432084 | 1,627 |
from __future__ import absolute_import
import json
import os
import pickle
import re
import shutil
import tempfile
import time
from netranger import Vim, util
from netranger.config import file_sz_display_wid
from netranger.enum import Enum
from netranger.shell import Shell
FType = Enum('FileType', 'SOCK, LNK, REG, B... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
302,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
640,
198,
198,
6738,
2010,
81,
2564,
1330,
36... | 3.053097 | 113 |
from typing_extensions import Final # noqa: F401
GRAPHQL_URL = 'https://api.github.com/graphql' # type: Final # noqa: E501
| [
6738,
19720,
62,
2302,
5736,
1330,
8125,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
10761,
31300,
9711,
62,
21886,
796,
705,
5450,
1378,
15042,
13,
12567,
13,
785,
14,
34960,
13976,
6,
220,
1303,
2099,
25,
8125,
220,
1303,
645,
... | 2.702128 | 47 |
import datetime
import pysc2.agents.myAgent.myAgent_6.config.config as config
from pysc2.agents.myAgent.myAgent_6.decisionMaker.DQN import DQN
import pysc2.agents.myAgent.myAgent_6.smart_actions as sa
import pysc2.agents.myAgent.myAgent_6.tools.handcraft_function as handcraft_function
from pysc2.env.environment impor... | [
11748,
4818,
8079,
198,
198,
11748,
279,
28349,
17,
13,
49638,
13,
1820,
36772,
13,
1820,
36772,
62,
21,
13,
11250,
13,
11250,
355,
4566,
198,
6738,
279,
28349,
17,
13,
49638,
13,
1820,
36772,
13,
1820,
36772,
62,
21,
13,
12501,
116... | 2.927419 | 124 |
import re
import time
from django.conf import settings
from django.db.backends.util import logger
from pymongo import ASCENDING
from pymongo.cursor import Cursor
| [
11748,
302,
198,
11748,
640,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
13,
22602,
1330,
49706,
198,
198,
6738,
279,
4948,
25162,
1330,
25400,
10619,
2751,
198,
6738,
279,
494... | 3.269231 | 52 |
"""
This file contains the definition of the DDPDG agent. The DDPG class defines basic construct of the algorigthm
"""
from model import Actor, Critic, ReplayBuffer
from copy import deepcopy
from noise import OUNoise
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
impor... | [
37811,
198,
1212,
2393,
4909,
262,
6770,
286,
262,
20084,
5760,
38,
5797,
13,
383,
360,
6322,
38,
1398,
15738,
4096,
5678,
286,
262,
435,
7053,
328,
400,
76,
198,
37811,
628,
198,
6738,
2746,
1330,
27274,
11,
10056,
291,
11,
23635,
... | 2.394383 | 1,638 |
# Generated by Django 2.0.5 on 2018-12-21 00:34
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
20,
319,
2864,
12,
1065,
12,
2481,
3571,
25,
2682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from datetime import datetime, timedelta
import frappe
from dateutil.relativedelta import relativedelta
import calendar
from empg_erp.utils import get_config_by_name
from empg_erp.modules.common.error_handler import ErrorHandler
from empg_erp.constants.globals import MONTHLY_ATTENDANCE_DATE, ROSTER_STATUS_FLEXIBLE, \
... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
11748,
5306,
27768,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
11748,
11845,
198,
6738,
795,
6024,
62,
263,
79,
13,
26791,
1330,
651,
62,... | 2.86755 | 151 |
import os,sys
| [
11748,
28686,
11,
17597,
628,
197,
198,
197,
197,
197,
198,
197,
198,
197,
628,
198
] | 1.6875 | 16 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-12 17:18
from __future__ import unicode_literals
import logging
from django.db import migrations
from osf.management.commands.migrate_deleted_date import (
FORWARD_BASE_FILE,
FORWARD_ABSTRACT_NODE,
FORWARD_COMMENT,
FORWARD_INSTITUTION,
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1314,
319,
2864,
12,
1157,
12,
1065,
1596,
25,
1507,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,... | 2.366379 | 232 |
"""
LNT based measurements.
"""
from benchbuild.project import Project
from benchbuild.settings import CFG
from benchbuild.utils.compiler import lt_clang, lt_clang_cxx
from benchbuild.utils.downloader import Git, CopyNoFail
from benchbuild.utils.run import run
from benchbuild.utils.wrapping import wrap_dynamic
from p... | [
37811,
198,
43,
11251,
1912,
13871,
13,
198,
198,
37811,
198,
6738,
7624,
11249,
13,
16302,
1330,
4935,
198,
6738,
7624,
11249,
13,
33692,
1330,
18551,
38,
198,
6738,
7624,
11249,
13,
26791,
13,
5589,
5329,
1330,
300,
83,
62,
565,
648... | 2.771218 | 271 |
import numpy as np
import matplotlib.pyplot as plt
from numpyviz import VisualArray
arr = np.random.randint(99, size=8*8*3).reshape((8,8,3))
va = VisualArray(arr)
va.set_colors(argmin_axis2(arr), color='yellow', basecolor='lightblue')
va.vizualize(fixview=True)
va.ax.set_title('argmin on axis=-1')
plt.show()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
299,
32152,
85,
528,
1330,
15612,
19182,
198,
198,
3258,
796,
45941,
13,
25120,
13,
25192,
600,
7,
2079,
11,
2546,
28,
23,
9,
23... | 2.484127 | 126 |
# --------------
# Code starts here
import numpy as np
# Code starts here
# Adjacency matrix
adj_mat = np.array([[0,0,0,0,0,0,1/3,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/3,0],
... | [
2,
220,
26171,
198,
2,
6127,
4940,
994,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
6127,
4940,
994,
198,
198,
2,
1215,
30482,
1387,
17593,
198,
41255,
62,
6759,
796,
45941,
13,
18747,
26933,
58,
15,
11,
15,
11,
15,
11,
... | 1.794142 | 1,229 |
"""
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.
Note: The length of path between two nodes is represented by the number of edges between them.
Example 1:
Input:
5
/ \
4... | [
37811,
198,
15056,
257,
13934,
5509,
11,
1064,
262,
4129,
286,
262,
14069,
3108,
810,
1123,
10139,
287,
262,
3108,
468,
262,
976,
1988,
13,
770,
3108,
743,
393,
743,
407,
1208,
832,
262,
6808,
13,
198,
198,
6425,
25,
383,
4129,
286,... | 2.223496 | 349 |
from random import randint
from collections import Counter
test()
| [
6738,
4738,
1330,
43720,
600,
198,
6738,
17268,
1330,
15034,
198,
198,
9288,
3419,
198
] | 4.466667 | 15 |
"""
.. module: aspen_ssh.ssh.certificates.ssh_certificate_builder
:copyright: (c) 2016 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
"""
import base64
import os
from typing import TYPE_CHECKING
from aspen_ssh.protocol.ssh_protocol import pack_ssh_string, pack_ssh_uint64,... | [
37811,
198,
492,
8265,
25,
355,
3617,
62,
45824,
13,
45824,
13,
22583,
811,
689,
13,
45824,
62,
22583,
22460,
62,
38272,
198,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
1584,
416,
12074,
3457,
1539,
766,
37195,
20673,
329,
51... | 2.839572 | 187 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | [
171,
119,
123,
2,
10097,
45537,
198,
2,
15069,
357,
66,
8,
5413,
13,
220,
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,
42... | 3.036977 | 622 |
"""
# BUCLE WHILE
Estructura de control que itera o repite la ejecucion de una serie de instrucciones
tantas veces como sea necesario hasta que deje de cumplrise la condicion.
codigo:
while $condicion:
bloque de instrucciones
//contador
"""
contador = 1
while contador <= 10:
print(f"Mostrando numero... | [
37811,
198,
2,
347,
9598,
2538,
7655,
41119,
198,
36,
7249,
5330,
390,
1630,
8358,
340,
8607,
267,
1128,
578,
220,
8591,
304,
73,
721,
1229,
295,
390,
555,
64,
1055,
494,
390,
916,
622,
535,
295,
274,
198,
83,
415,
292,
1569,
728,... | 2.482759 | 377 |
from flask import Flask, render_template
from pymongo import MongoClient
import get_data
app = Flask(__name__)
client = MongoClient('localhost',27017)
db = client.mars_data
collection = db.mars_data
new_data = collection.find_one()
@app.route('/')
@app.route('/scrape')
@app.route('/hemisph... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
201,
198,
6738,
279,
4948,
25162,
1330,
42591,
11792,
201,
198,
11748,
651,
62,
7890,
201,
198,
201,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
201,
198,
201,
198,
16366,
796,
42591,
... | 2.433121 | 157 |
import configparser
import os
import sys
from pathlib import Path
import logging
from datetime import datetime
home = str(Path.home())
configFileName = 'PBMConfig.cfg'
PBMDir = '/Documents/PaintByMotors/'
PBMDirPath = home + PBMDir
SQLDirPath = PBMDirPath + 'SQL/'
DefaultDB = 'test.db'
try:
os.mkdir(PBMDirPath + s... | [
11748,
4566,
48610,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11195,
796,
965,
7,
15235,
13,
11195,
28955,
198,
11250,
8979,
5376,
796,
... | 2.680392 | 510 |
from .lenet import LeNet
from .resnet import ResNet
from .segnet import SegNet
from .unet import UNet
from .hrnet import HRNet
__all__ = [
'LeNet',
'ResNet',
'SegNet',
'UNet',
'HRNet'
]
classes = __all__
| [
6738,
764,
11925,
316,
1330,
1004,
7934,
198,
6738,
764,
411,
3262,
1330,
1874,
7934,
198,
6738,
764,
325,
70,
3262,
1330,
31220,
7934,
198,
6738,
764,
403,
316,
1330,
4725,
316,
198,
6738,
764,
11840,
3262,
1330,
15172,
7934,
198,
19... | 2.329897 | 97 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Short description of this Python module.
Longer description of this module.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of t... | [
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,
37811,
10073,
6764,
286,
428,
11361,
8265,
13,
198,
198,
14617,
263,
6764,
286,
428,
8265,
13,
628,
198,
121... | 3.453773 | 941 |
# Generated by Django 3.2.7 on 2021-10-12 00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
22,
319,
33448,
12,
940,
12,
1065,
3571,
25,
405,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
1420... | 3.04918 | 61 |
from functools import reduce
employees = [{
'name': 'Jane',
'salary': 90000,
'job_title': 'developer'
}, {
'name': 'Bill',
'salary': 50000,
'job_title': 'writer'
}, {
'name': 'Kathy',
'salary': 120000,
'job_title': 'executive'
}, {
'name': 'Anna',
'salary': 100000,
'job_... | [
6738,
1257,
310,
10141,
1330,
4646,
198,
198,
7033,
2841,
796,
685,
90,
198,
220,
220,
220,
705,
3672,
10354,
705,
41083,
3256,
198,
220,
220,
220,
705,
21680,
560,
10354,
860,
2388,
11,
198,
220,
220,
220,
705,
21858,
62,
7839,
103... | 2.443595 | 523 |
from shallowflow.api.actor import InputConsumer, OutputProducer
from shallowflow.api.callable import AbstractCallableActor
from shallowflow.api.compatibility import Unknown
STATE_INPUT = "input"
class CallableTransformer(AbstractCallableActor, InputConsumer, OutputProducer):
"""
Executes the referenced trans... | [
6738,
19337,
11125,
13,
15042,
13,
11218,
1330,
23412,
49106,
11,
25235,
11547,
2189,
198,
6738,
19337,
11125,
13,
15042,
13,
13345,
540,
1330,
27741,
14134,
540,
40277,
198,
6738,
19337,
11125,
13,
15042,
13,
5589,
25901,
1330,
16185,
19... | 2.345942 | 1,454 |
# -*- coding: utf-8 -*-
import configparser
import requests
PATH = "./user.conf"
config = configparser.ConfigParser()
config.read(PATH)
options = config['options']
login_way = options['login_way']
account = options['account']
password = options['password']
api_host = options['api_host']
USER_PAGE_URL = "https://mu... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4566,
48610,
198,
11748,
7007,
198,
34219,
796,
366,
19571,
7220,
13,
10414,
1,
198,
198,
11250,
796,
4566,
48610,
13,
16934,
46677,
3419,
198,
11250,
13,
96... | 2.233918 | 684 |
# Simple contours (circles, squares, rectangles, slots, obrounds) below your custom
# max size threshold will be assumed to cut with a single hit from a punch_cost_per_sheet tool. All other contours are assumed
# to be multi-hit features. We provide you the multi-hit cut length to estimate pricing of these operations.
... | [
2,
17427,
542,
4662,
357,
66,
343,
5427,
11,
24438,
11,
13621,
27787,
11,
17314,
11,
909,
744,
82,
8,
2174,
534,
2183,
198,
2,
3509,
2546,
11387,
481,
307,
9672,
284,
2005,
351,
257,
2060,
2277,
422,
257,
10862,
62,
15805,
62,
525... | 3.200249 | 804 |
"""
Copyright (c) 2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | [
37811,
198,
15069,
357,
66,
8,
33160,
8180,
10501,
198,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
921,
743,
7... | 2.613457 | 1,397 |
import os
import time
import matplotlib.pyplot as plt
#from rdkit.Chem import SDMolSupplier, MolFromSmiles, MolToSmiles, Kekulize
include(os.path.join('..', 'rules/all.py'))
include("mod_to_neo4j_exporter.py")
p = GraphPrinter()
p.simpleCarbons = True
p.withColour = True
p.collapseHydrogens = True
# Forbidden subst... | [
11748,
28686,
198,
11748,
640,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
6738,
374,
67,
15813,
13,
41829,
1330,
9834,
44,
349,
15979,
2505,
11,
17958,
4863,
7556,
2915,
11,
17958,
2514,
7556,
2915,
11,... | 2.649864 | 6,983 |
"""
AWS Helpers
Author: Austin Transportation Department, Data and Technology Services
Description: The purpose of this script is to provide helper methods
associated to AWS services.
"""
import subprocess
import boto3
# We need our AWS configuration variables
from .config import ATD_ETL_CONFIG
def aws_credentials_... | [
37811,
198,
12298,
50,
10478,
364,
198,
13838,
25,
9533,
15198,
2732,
11,
6060,
290,
8987,
6168,
198,
198,
11828,
25,
383,
4007,
286,
428,
4226,
318,
284,
2148,
31904,
5050,
198,
32852,
284,
30865,
2594,
13,
198,
37811,
198,
11748,
85... | 2.707914 | 695 |
import sys
import unittest
sys.path.append('../')
from src.channel import Channel
if __name__ == '__main__':
unittest.main()
| [
11748,
25064,
198,
11748,
555,
715,
395,
198,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
11537,
198,
6738,
12351,
13,
17620,
1330,
11102,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
197,
403,
715,
... | 2.804348 | 46 |
import math
from functools import reduce
from dataclasses import dataclass, field
from typing import List
def get_factors(n):
"""
helper function for returning all the factors of `n`
"""
return list(set(reduce(list.__add__,
([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
@datac... | [
11748,
10688,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
7343,
198,
198,
4299,
651,
62,
22584,
669,
7,
77,
2599,
198,
220,
220,
220,
37227,
198,
220,... | 2.90276 | 761 |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | [
37811,
198,
15269,
357,
66,
8,
33160,
43208,
21852,
1766,
1539,
43,
8671,
13,
198,
198,
9654,
35389,
1046,
318,
11971,
739,
17996,
272,
6599,
43,
410,
17,
13,
198,
1639,
460,
779,
428,
3788,
1864,
284,
262,
2846,
290,
3403,
286,
262... | 1.683168 | 606 |
import argparse
import ast
import collections
import sys
import warnings
from typing import Dict
from typing import Generator
from typing import List
from typing import NamedTuple
from typing import Optional
from typing import Sequence
from typing import Set
from typing import Tuple
from tokenize_rt import ESCAPED_NL
... | [
11748,
1822,
29572,
198,
11748,
6468,
198,
11748,
17268,
198,
11748,
25064,
198,
11748,
14601,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
35986,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
34441,
51,
29291,
198,
6... | 3.019157 | 261 |
grade_in = input('Enter your grade between 0.0 and 1.0') | [
9526,
62,
259,
796,
5128,
10786,
17469,
534,
9559,
1022,
657,
13,
15,
290,
352,
13,
15,
11537
] | 3.111111 | 18 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
from typing import Union, Optional, TYPE_CHECKING
from cdm.enums import CdmObjectType
from .cdm_object_ref import CdmObjectReference
if TYPE_CHECKING:
from ... | [
171,
119,
123,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
198,
6738,
19720,
1330,
4479,
11,
32233,... | 3.567797 | 118 |
#!/usr/bin/env python3
import sys
import os
import argparse
import operator
# Uses argparse library to parse command-line arguments; argparse must be imported
#flatmap = 2D dict where key=pop and value=list of sample IDs
#function reads a tab-delimited popmap file and return dictionary of assignments
#Makes a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
10088,
198,
198,
2,
36965,
1822,
29572,
5888,
284,
21136,
3141,
12,
1370,
7159,
26,
1822,
29572,
1276,
307,... | 2.112863 | 2,029 |
# coding=utf-8
"""Maximum length chain of pairs dynamic programming solution Python implementation."""
if __name__ == "__main__":
arr = [[5, 24], [15, 25], [27, 40], [50, 60]]
print(mlcp(arr))
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
40541,
4129,
6333,
286,
14729,
8925,
8300,
4610,
11361,
7822,
526,
15931,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
5240,
796,
16410,
20,
11,
... | 2.873239 | 71 |
import requests, json, os, urllib
from server.user import User
import server.db as db
from urllib.parse import urlparse
from dotenv import load_dotenv
load_dotenv()
API_ENDPOINT = "https://discord.com/api/v8"
CLIENT_ID = os.environ.get("CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
REDIRECT... | [
11748,
7007,
11,
33918,
11,
28686,
11,
2956,
297,
571,
201,
198,
6738,
4382,
13,
7220,
1330,
11787,
201,
198,
11748,
4382,
13,
9945,
355,
20613,
201,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
201,
198,
6738,
16605,
243... | 2.392857 | 224 |
#!/usr/bin/env python3.5
import argparse
import os
import shutil
from mod_xml2mongo import xml2mongo
parser = argparse.ArgumentParser(description='7z -> MongoDB')
parser.add_argument("file_path",help='''Please pass the following as argument
7z file path (OR) directory path where xmls are located
''')
args = parser... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
20,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
198,
6738,
953,
62,
19875,
17,
76,
25162,
1330,
35555,
17,
76,
25162,
198,
198,
48610,
796,
1822,
... | 2.807453 | 161 |
## Yoni Schirris. 06/10/2020
## Exact copy of main.py (now main_unsupervised.py)
## Idea is to keep functionality of both supervised and unsupervised in here, with some switches that change only minor
## things to switch between supervised and unsupervised learning.
## Thus, in the end, we should again have a single "m... | [
2235,
575,
14651,
3059,
343,
2442,
13,
9130,
14,
940,
14,
42334,
198,
2235,
1475,
529,
4866,
286,
1388,
13,
9078,
357,
2197,
1388,
62,
403,
16668,
16149,
13,
9078,
8,
198,
2235,
37560,
318,
284,
1394,
11244,
286,
1111,
28679,
290,
5... | 3.43871 | 310 |
import open3d as o3d
import numpy as np
import python.open3d_tutorial as o3dtut
# http://www.open3d.org/docs/release/tutorial/geometry/mesh_deformation.html
########################################################################################################################
# 1. Mesh deformation
##################... | [
11748,
1280,
18,
67,
355,
267,
18,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
21015,
13,
9654,
18,
67,
62,
83,
44917,
355,
267,
18,
28664,
315,
198,
198,
2,
2638,
1378,
2503,
13,
9654,
18,
67,
13,
2398,
14,
31628,
14,
2... | 3.345103 | 878 |
from .channel import Channel
from .bot import Bot
from .main import main
from .handler import IRCHandler | [
6738,
764,
17620,
1330,
11102,
198,
6738,
764,
13645,
1330,
18579,
198,
6738,
764,
12417,
1330,
1388,
198,
6738,
764,
30281,
1330,
14826,
3398,
392,
1754
] | 4 | 26 |
# Copyright 2021 The Kubric Authors.
#
# 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 w... | [
2,
15069,
33448,
383,
24921,
1173,
46665,
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,
262,
13789,
13,
198,
... | 3.62782 | 266 |
# -*- coding: utf-8 -*-
import os
from dotenv import load_dotenv
from sqlalchemy.engine.url import URL
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
APP_DIR = os.path.join(BASE_DIR, 'api')
DOTENV_PATH = os.path.join(BASE_DIR, '.env')
load_dotenv(DOTENV_PATH)
INSTALLED_APPS = [
'restaurants',
]
DATABAS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
44161,
282,
26599,
13,
18392,
13,
6371,
1330,
10289,
198,
198,
33,
11159,
62,
3... | 2.038938 | 565 |
from django.shortcuts import render
from django.http import Http404
from project_first_app.models import Owner, Car
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from .forms import OwnerForm
from .models import Car
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
198,
6738,
1628,
62,
11085,
62,
1324,
13,
27530,
1330,
23853,
11,
1879,
198,
6738,
42625,
14208,
13,
33571,
13,
4135... | 3.525 | 80 |
# Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# Ji Lin*, Chuang Gan, Song Han
# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu
import logging
import re
import numpy as np
import torch
import torchvision
from ops.basic_ops import ConsensusModule
from ops.temporal_shift ... | [
2,
6127,
329,
366,
4694,
44,
25,
5825,
35738,
15576,
19937,
329,
412,
5632,
7623,
28491,
1,
198,
2,
610,
55,
452,
25,
1507,
1157,
13,
2919,
34741,
198,
2,
29380,
5164,
25666,
25459,
648,
23207,
11,
10940,
9530,
198,
2,
1391,
73,
3... | 3.122699 | 163 |
import pandas as pd
import os, sys, glob, time
import requests, json
import csv
from flask import Flask
# Global Variables
url = "https://rickandmortyapi.com/api/character/?Species=Human&status=alive&origin=earth"
csv_file = "ricknmorty.csv"
app = Flask(__name__)
# Check if a json is valid or not
@app.route('/health... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
28686,
11,
25064,
11,
15095,
11,
640,
198,
11748,
7007,
11,
33918,
198,
11748,
269,
21370,
198,
6738,
42903,
1330,
46947,
198,
198,
2,
8060,
15965,
2977,
198,
6371,
796,
366,
5450,
1378,
55... | 2.789474 | 190 |
import numpy as np
import torch
from torchvision.datasets.mnist import MNIST
from torch.utils.data.dataset import Dataset
from PIL import Image, ImageDraw, ImageOps
import json
from utils import trim_tokens, gen_colors
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
10178,
13,
19608,
292,
1039,
13,
10295,
396,
1330,
29060,
8808,
198,
6738,
28034,
13,
26791,
13,
7890,
13,
19608,
292,
316,
1330,
16092,
292,
316,
198,
6738,
350,
4146,... | 3.185714 | 70 |
#from OpenAttack.OpenAttack2.tags.tags import TAG_Protein
from .base import WordSubstitute
from .chinese_cilin import ChineseCiLinSubstitute
from .chinese_hownet import ChineseHowNetSubstitute
from .chinese_wordnet import ChineseWordNetSubstitute
from .chinese_word2vec import ChineseWord2VecSubstitute
from .protein_blo... | [
2,
6738,
4946,
27732,
13,
11505,
27732,
17,
13,
31499,
13,
31499,
1330,
37801,
62,
47,
35574,
198,
6738,
764,
8692,
1330,
9678,
7004,
301,
3678,
198,
6738,
764,
354,
3762,
62,
2856,
259,
1330,
3999,
34,
72,
14993,
7004,
301,
3678,
1... | 3.329897 | 194 |
with open('input3.txt', 'r') as file:
data = [list(el) for el in file.read().split('\n')]
print(check(3, 1) * check(1, 1) * check(5, 1) * check(7, 1) * check(1, 2)) | [
4480,
1280,
10786,
15414,
18,
13,
14116,
3256,
705,
81,
11537,
355,
2393,
25,
198,
220,
220,
220,
1366,
796,
685,
4868,
7,
417,
8,
329,
1288,
287,
2393,
13,
961,
22446,
35312,
10786,
59,
77,
11537,
60,
628,
220,
220,
220,
220,
220... | 2.119048 | 84 |
from .debug import Debug
from .floppy import Floppy
from .json import Json
from .midi import Midi
__all__ = ['Debug', 'Floppy', 'Json', 'Midi']
| [
6738,
764,
24442,
1330,
31687,
198,
6738,
764,
2704,
26696,
1330,
1610,
26696,
198,
6738,
764,
17752,
1330,
449,
1559,
198,
6738,
764,
13602,
72,
1330,
7215,
72,
198,
198,
834,
439,
834,
796,
37250,
27509,
3256,
705,
33574,
14097,
3256,... | 2.9 | 50 |
# A permutation is the act of rearranging the members of a set into a sequence.
# Example: set_a = {1,2,3} -> (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1)
# Loop throug set
# rearrange set
| [
2,
317,
9943,
7094,
318,
262,
719,
286,
37825,
4924,
262,
1866,
286,
257,
900,
656,
257,
8379,
13,
220,
198,
2,
17934,
25,
900,
62,
64,
796,
1391,
16,
11,
17,
11,
18,
92,
4613,
357,
16,
11,
17,
11,
18,
828,
357,
16,
11,
18,
... | 2.134021 | 97 |
maxint = mymax([1, 3, 5, 7, 4, 6, 9, 2, 0])
maxchar = mymax("Suncana strana ulice")
maxstring = mymax([
"Gle", "malu", "vocku", "poslije", "kise",
"Puna", "je", "kapi", "pa", "ih", "njise"])
D = {'burek':8, 'buhtla':5}
maxfood = mymax(D, lambda x: D[x])
persons = [("Luka", "Giljanović"), ("Mislav", "Has"), ("Darij... | [
198,
9806,
600,
796,
616,
9806,
26933,
16,
11,
513,
11,
642,
11,
767,
11,
604,
11,
718,
11,
860,
11,
362,
11,
657,
12962,
198,
9806,
10641,
796,
616,
9806,
7203,
16012,
66,
2271,
965,
2271,
14856,
501,
4943,
198,
9806,
8841,
796,
... | 2.14486 | 214 |
import logging
import json
import base64
import urllib
import google.appengine.api.urlfetch as urlfetch
from flask import Flask, Response, request
from firebase.wrapper import Firebase
try:
# Apparently not all implementations have SystemRandom defined, so I expect
# this import to fail, if that's the case.
... | [
11748,
18931,
198,
11748,
33918,
198,
11748,
2779,
2414,
198,
11748,
2956,
297,
571,
198,
11748,
23645,
13,
1324,
18392,
13,
15042,
13,
333,
1652,
7569,
355,
2956,
1652,
7569,
198,
198,
6738,
42903,
1330,
46947,
11,
18261,
11,
2581,
198... | 2.925403 | 496 |
from __future__ import absolute_import, division, print_function
import libtbx.load_env, os
cxi_user = libtbx.env.find_in_repositories(
relative_path="cxi_user",
test=os.path.isdir)
if cxi_user is None or not os.path.exists(cxi_user):
print(" Creating cxi_user directory")
sources_root =... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
9195,
83,
65,
87,
13,
2220,
62,
24330,
11,
28686,
198,
66,
29992,
62,
7220,
796,
9195,
83,
65,
87,
13,
24330,
13,
19796,
62,
259,
62,
260,
... | 2.235772 | 369 |
__author__ = """Stephan REichholf"""
__email__ = 'reichi@opendreambox.org'
__version__ = '1.0.2' | [
834,
9800,
834,
796,
37227,
8600,
7637,
4526,
488,
3937,
69,
37811,
198,
834,
12888,
834,
796,
705,
260,
16590,
31,
404,
437,
1476,
3524,
13,
2398,
6,
198,
834,
9641,
834,
796,
705,
16,
13,
15,
13,
17,
6
] | 2.4 | 40 |
# IMPORTATION STANDARD
import os
from datetime import datetime
# IMPORTATION THIRDPARTY
import pandas as pd
import pytest
# IMPORTATION INTERNAL
from gamestonk_terminal.stocks.behavioural_analysis import ba_controller
# pylint: disable=E1101
# pylint: disable=W0603
# pylint: disable=E1111
EMPTY_DF = pd.DataFrame()
... | [
2,
30023,
9863,
6234,
49053,
9795,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
30023,
9863,
6234,
2320,
4663,
6322,
7227,
56,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
198,
2,
300... | 1.59479 | 5,259 |
import abc
| [
11748,
450,
66,
628
] | 3 | 4 |
import seaborn as sns
import matplotlib.pyplot as plt
from presentacion.form_ubicacion.formAUbicacion_designer import FormUbicacionDesigner
sns.set()
| [
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1944,
49443,
13,
687,
62,
549,
291,
49443,
13,
687,
26830,
65,
291,
49443,
62,
26124,
263,
1330,
5178,
36609,
291,
49443,
... | 2.8 | 55 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | [
198,
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
1783,
10541,... | 5.972603 | 73 |
# This test file only runs internally when you test the course with pytest.
# It can be used to ensure that results the course depend on are accurate, e.g.
# when updating to a new version of spaCy. This especially includes predictions
# that some examples assume or depend on.
import spacy
import pytest
@pytest.fixtu... | [
2,
770,
1332,
2393,
691,
4539,
20947,
618,
345,
1332,
262,
1781,
351,
12972,
9288,
13,
198,
2,
632,
460,
307,
973,
284,
4155,
326,
2482,
262,
1781,
4745,
319,
389,
7187,
11,
304,
13,
70,
13,
198,
2,
618,
19698,
284,
257,
649,
21... | 4.012346 | 81 |