max_stars_repo_path
stringlengths
4
237
max_stars_repo_name
stringlengths
6
117
max_stars_count
int64
0
95.2k
id
stringlengths
1
7
content
stringlengths
12
593k
input_ids
listlengths
7
549k
gtil_influx.py
jirisrba/gtil2-wifi
1
122518
<filename>gtil_influx.py #!/usr/bin/env python3 """ read data from GTIL2 Wifi module and send it to influxdb server """ # # crontab # # */5 * * * * /usr/bin/python3 /home/pi/gtil_influx.py # import requests from requests.auth import HTTPBasicAuth from influxdb import InfluxDBClient # GTIL invertor WiFi IP gtil_...
[ 1, 529, 9507, 29958, 29887, 1376, 29918, 13453, 1314, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 15945, 29908, 1303, 848, 515, 21342, 6227, 29906, 399, 6832, 3883, 13, 1678, 322, 3638, 372, 304, ...
miping/training/noGloveValueError.py
mclgoerg/MiningPersonalityInGerman
1
161830
<gh_stars>1-10 class NoGloveValueError(Exception): """ Raised if no value can be found in GloVe for a user's text. """ pass
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 1990, 1939, 29954, 417, 345, 1917, 2392, 29898, 2451, 1125, 13, 1678, 9995, 13, 1678, 390, 1759, 287, 565, 694, 995, 508, 367, 1476, 297, 21806, 29963, 29872, 363, ...
cir_project/cirp_user/scripts/camera_user.py
sprkrd/UPC-MAI-CIR
1
32631
#!/usr/bin/env python import rospy from std_msgs.msg import String from peyetribe import EyeTribe import time from cir_user.srv import UserAction, UserActionResponse TH1 = 1280*(1.0/3) TH2 = 1280*(2.0/3) IP = "192.168.101.72" class CameraUserServer: def __init__(self): rospy.init_node("talker") ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 696, 1028, 29891, 13, 3166, 3659, 29918, 1516, 3174, 29889, 7645, 1053, 1714, 13, 13, 3166, 282, 1032, 300, 374, 915, 1053, 382, 4099, 29565, 915, 13, 5215, 931, 13, 13, ...
Scripts/Maperipy/CreateOruxMapLite.py
cojalvo/Map
2
129462
<reponame>cojalvo/Map import os, os.path, datetime, string, errno from maperipy import * import GenIsraelHikingTilesLite # http://stackoverflow.com/questions/749711/how-to-get-the-python-exe-location-programmatically MaperitiveDir = os.path.dirname(os.path.dirname(os.path.normpath(os.__file__))) # App.log('MaperitiveD...
[ 1, 529, 276, 1112, 420, 29958, 1111, 12429, 1365, 29914, 3388, 13, 5215, 2897, 29892, 2897, 29889, 2084, 29892, 12865, 29892, 1347, 29892, 4589, 1217, 13, 3166, 2910, 261, 666, 29891, 1053, 334, 13, 5215, 5739, 3624, 9058, 29950, 638, 2...
concat_csv.py
jweckman/vim
0
22607
import pandas as pd from pathlib import Path import sys ''' Concatenates all csv files in the folder passed to stdin ''' path = Path(sys.argv[1]) def get_csv_paths(path): return [p for p in path.iterdir() if p.suffix == '.csv'] def ask_details(): print('Please specify the following:') encod...
[ 1, 1053, 11701, 408, 10518, 30004, 13, 3166, 2224, 1982, 1053, 10802, 30004, 13, 5215, 10876, 30004, 13, 30004, 13, 12008, 23924, 2579, 1078, 599, 11799, 2066, 297, 278, 4138, 4502, 304, 3659, 262, 14550, 30004, 13, 30004, 13, 2084, 353...
tests/test_fasttext_embeddings.py
CLARIN-PL/embeddings
33
156341
<gh_stars>10-100 from typing import Type import pytest import torch from flair.data import Sentence from flair.embeddings import FastTextEmbeddings, StackedEmbeddings from torch.testing import assert_close as assert_close from embeddings.embedding.flair_embedding import FlairDocumentPoolEmbedding from embeddings.embe...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 19229, 1053, 5167, 13, 13, 5215, 11451, 1688, 13, 5215, 4842, 305, 13, 3166, 17422, 381, 29889, 1272, 1053, 28048, 663, 13, 3166, 17422, 381, 29...
validation.py
QCMM/dynqmprop
0
97035
<gh_stars>0 import sys from dynqmprop import DynQMProp top_file = sys.argv[1] coords_file = sys.argv[2] def main(): # creating objects for validation # standard parameters: # radius: 10 # sampling: 25 # n_charge_updates: 3 radius_param = DynQMProp(top_file, coords_file, qm_charge=+1, l...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 10876, 13, 13, 3166, 270, 948, 29939, 29885, 7728, 1053, 360, 948, 29984, 29924, 20420, 13, 13, 3332, 29918, 1445, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 1111, 4339, 2...
dev/tasks/run.py
MasonData/dev
12
1611918
<gh_stars>10-100 from typing import Any, Optional from schema import Optional as SchemaOptional from schema import Or, Schema from dev.exceptions import NonZeroReturnCodeError from dev.helpers import run_command from dev.task import Task class Run(Task): __schema__ = Schema( Or( # - run: dat...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 19229, 1053, 3139, 29892, 28379, 13, 13, 3166, 10938, 1053, 28379, 408, 1102, 2603, 27636, 13, 3166, 10938, 1053, 1394, 29892, 1102, 2603, 13, 13,...
tinyforum/models.py
matthiask/django-tinyforum
0
52883
from ckeditor.fields import RichTextField from django.conf import settings from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.html import strip_tags from django.utils.text import Truncator from django.utils.translation import gettext_lazy as _ from html_sani...
[ 1, 515, 274, 29895, 15204, 29889, 9621, 1053, 4385, 15778, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 3166, 9557, 29889, 13239, 1053, 29431, 13, 3166, ...
tests/test_basic.py
WSULib/combine
24
24382
<reponame>WSULib/combine import django import os import pytest import shutil import sys import time import uuid # logging import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # init django settings file to retrieve settings os.environ['DJANGO_SETTINGS_MODULE'] = 'combine.settings' sys.p...
[ 1, 529, 276, 1112, 420, 29958, 7811, 13309, 747, 29914, 17743, 457, 13, 5215, 9557, 13, 5215, 2897, 13, 5215, 11451, 1688, 13, 5215, 528, 4422, 13, 5215, 10876, 13, 5215, 931, 13, 5215, 318, 5416, 13, 13, 29937, 12183, 13, 5215, 121...
gcp-cli/client/util/util_dpm.py
lacework/csp-integrations
1
48359
<filename>gcp-cli/client/util/util_dpm.py from __future__ import print_function from __future__ import absolute_import from builtins import input from builtins import str import logging from .util_base import UtilBase from . import util_template HTTP_GET_METHOD = "GET" HTTP_POST_METHOD = "POST" HTTP_DELETE_METHOD = "D...
[ 1, 529, 9507, 29958, 29887, 6814, 29899, 11303, 29914, 4645, 29914, 4422, 29914, 4422, 29918, 29881, 3358, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, ...
Software_Engineering/ObjectOrientedProgramming/IdeFiles/5_exercise_upload_to_pypi/setup.py
surily/Udacity-Data-Science
0
43665
<reponame>surily/Udacity-Data-Science from setuptools import setup setup(name='gaussian_bionary_dist_prob', version='0.1', description='Gaussian and Binomial distributions', packages=['gaussian_bionary_dist_prob'], author = '<NAME>', author_email = '<EMAIL>', zip_safe=False)
[ 1, 529, 276, 1112, 420, 29958, 7610, 2354, 29914, 29965, 29881, 5946, 29899, 1469, 29899, 29903, 15277, 13, 3166, 731, 21245, 8789, 1053, 6230, 13, 13, 14669, 29898, 978, 2433, 29887, 17019, 29918, 29890, 291, 653, 29918, 5721, 29918, 227...
examples/exp_configs/rl/singleagent/singleagent_ring_attack.py
cwang717/flow
0
69596
<filename>examples/exp_configs/rl/singleagent/singleagent_ring_attack.py """Ring road example. Trains a single autonomous vehicle to stabilize the flow of 21 human-driven vehicles in a variable length ring road. """ from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams from flow.core.params impo...
[ 1, 529, 9507, 29958, 19057, 29914, 4548, 29918, 2917, 29879, 29914, 2096, 29914, 14369, 14748, 29914, 14369, 14748, 29918, 5393, 29918, 1131, 547, 29889, 2272, 13, 15945, 29908, 29934, 292, 6520, 1342, 29889, 13, 13, 5323, 1144, 263, 2323, ...
python/Unimeta/clinica/Trabalho_3/trabalho3.py
alifoliveira/rep-estudos
0
156444
<reponame>alifoliveira/rep-estudos<filename>python/Unimeta/clinica/Trabalho_3/trabalho3.py #coding=utf-8 from tkinter import * from tkinter import messagebox as ms import sqlite3 cont = 0 cont2 = 2 cadt = None listr = None empr = None loged = None photo2 = None logo2 = None def verify(): global loged global...
[ 1, 529, 276, 1112, 420, 29958, 284, 361, 324, 573, 3055, 29914, 3445, 29899, 342, 566, 359, 29966, 9507, 29958, 4691, 29914, 2525, 326, 1187, 29914, 695, 262, 983, 29914, 29911, 4201, 284, 1251, 29918, 29941, 29914, 3018, 5521, 1251, 29...
tests/basic_stages/test_freq_drop.py
DavidKatz-il/pdpipe
438
182234
"""Testing basic pipeline stages.""" import pandas as pd from pdpipe.basic_stages import FreqDrop DF1 = pd.DataFrame([[1, 4], [4, 5], [1, 11]], [1, 2, 3], ['a', 'b']) def test_freqdrop_basic(): """Testing the FreqDrop pipeline stage.""" res_df = FreqDrop(2, 'a').apply(DF1) assert 1 in res_df.index ...
[ 1, 9995, 3057, 292, 6996, 16439, 22950, 1213, 15945, 13, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 10518, 17760, 29889, 16121, 29918, 303, 1179, 1053, 3878, 29939, 15063, 13, 13, 13, 4037, 29896, 353, 10518, 29889, 17271, 4197, 29961, ...
src/clophfit/old/dil_correction.py
darosio/ClopHfit
0
44403
#!/usr/bin/python # import argparse import os import pandas as pd corr = {'pH': [1, 1.02, 1.04, 1.06, 1.08, 1.1, 1.12], 'cl': [1.000000, 1.017857, 1.035714, 1.053571, 1.071429, 1.089286, 1.107143, 1.160714, 1.196429]} corr = {'pH': [1, 1.02, 1.04, 1.06, 1.08, 1.1], 'cl': [1.000000, 1....
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 13, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 5215, 11701, 408, 10518, 13, 13, 13, 29725, 353, 11117, 29886, 29950, 2396, 518, 29896, 29892, 29871, 29896, 29889, 29900, 29906, 29892, ...
api/api.py
dartm05/Shape-Prediction
0
80425
import numpy as np import io from PIL import Image import tensorflow as tf from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import img_to_array import matplotlib.pyplot as plt from flask import Flask,render_template,redirect,url_for,request import urllib3 from tensorflow.keras.p...
[ 1, 29871, 13, 5215, 12655, 408, 7442, 13, 5215, 12013, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 26110, 408, 15886, 13, 3166, 26110, 29889, 3946, 294, 29889, 9794, 1053, 2254, 29918, 4299, 13, 3166, 26110, 29889, 3946, 294, 29889, 1457...
API/client.py
Ray1993TW/Kn-Pressure_Test
0
100967
<reponame>Ray1993TW/Kn-Pressure_Test import requests, json, cv2 url1 = '' content_type = 'image/jpeg' headers = {'content-type': content_type} class useAPI: def __init__(self, frame): h,w,c = frame.shape if(h<=0): h=w elif(w<=0): w=h else: self._state_, self.img_encoded = cv2.imencode('.jpg', frame...
[ 1, 529, 276, 1112, 420, 29958, 29934, 388, 29896, 29929, 29929, 29941, 16240, 29914, 29968, 29876, 29899, 10923, 545, 29918, 3057, 13, 5215, 7274, 29892, 4390, 29892, 13850, 29906, 13, 13, 2271, 29896, 353, 6629, 13, 13, 3051, 29918, 1853...
AlgorithmsAndDataStructures/mod2/Heap.py
BootyAss/bmstu
0
4734
<gh_stars>0 class Heap: def __init__(self): self.items = dict() # key - (value, index) self.indexes = [] # index - key // to know indexes # Usefull functions def swap(self, i, j): x = self.indexes[i] # key of 1 item y = self.indexes[j] # key of 2 item ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 1990, 940, 481, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 7076, 353, 9657, 580, 268, 396, 1820, 448, 313, 1767, 29892, 2380, 29897, 13, 4706, 1583, 2...
xbox/constants.py
tomwhross/wishlist
0
180733
<filename>xbox/constants.py<gh_stars>0 SEED_URLS = [ "https://www.microsoft.com/en-ca/p/immortals-fenyx-rising/c07kjzrh0l7s?activetab=pivot:overviewtab", "https://www.microsoft.com/en-ca/p/grand-theft-auto-v-premium-edition/C496CLVXMJP8?wa=wsignin1.0&lc=4105&activetab=pivot:overviewtab", "https://www.micros...
[ 1, 529, 9507, 29958, 29916, 1884, 29914, 3075, 1934, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 1660, 3352, 29918, 4219, 29903, 353, 518, 13, 1678, 376, 991, 597, 1636, 29889, 4994, 29889, 510, 29914, 264, 29899, 1113,...
core/management/commands/init_envs.py
klebed/esdc-ce
97
124107
from ._base import DanubeCloudCommand, CommandError class Command(DanubeCloudCommand): help = 'Initialize the virtual environments.' def handle(self, *args, **options): raise CommandError('Use ctl.sh directly')
[ 1, 515, 869, 29918, 3188, 1053, 3951, 4003, 20442, 6255, 29892, 10516, 2392, 13, 13, 13, 1990, 10516, 29898, 18529, 4003, 20442, 6255, 1125, 13, 1678, 1371, 353, 525, 6644, 6646, 278, 6901, 23136, 6169, 13, 13, 1678, 822, 4386, 29898, ...
app/profiles_api/urls.py
ijhajj/Django-basicRESTAPI
0
168960
from django.conf.urls import url from django.conf.urls import include from django.urls import path from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset') #In case of ModelSerializer, no need to pass ...
[ 1, 515, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3160, 13, 3166, 9557, 29889, 26045, 1053, 2224, 13, 3166, 1791, 29918, 4468, 29889, 27537, 2153, 1053, 13109, 23971, 13, 3166, 869, 1053...
raiden/tests/integration/test_blockchainservice.py
nicksavers/raiden
2
79524
# -*- coding: utf-8 -*- from __future__ import division import os import pytest from ethereum import _solidity from ethereum._solidity import compile_file from ethereum.utils import denoms from pyethapp.rpc_client import JSONRPCClient from pyethapp.jsonrpc import default_gasprice from raiden.network.rpc.client impor...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 13, 5215, 2897, 13, 13, 5215, 11451, 1688, 13, 3166, 11314, 406, 398, 1053, 903, 2929, 333, 537, 13, 3...
Translator.py
aj-naik/City-Sentiment-Detector-BERT
2
197723
import requests class Translator: def __init__(self, api_key: str): self.api_key = api_key class GoogleTranslate(Translator): api_endpoint = 'https://translation.googleapis.com/language/translate/v2' def __init__(self, api_key: str): Translator.__init__(self, api_key=api_key) d...
[ 1, 1053, 7274, 13, 13, 1990, 4103, 29880, 1061, 29901, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 7882, 29918, 1989, 29901, 851, 1125, 13, 4706, 1583, 29889, 2754, 29918, 1989, 353, 7882, 29918, 1989, 13, 13, 1990, 5087, ...
run.py
OSPgrp8/OSP
0
181523
<gh_stars>0 from app import app import mongoengine as ming from osp.classes.address import Address if __name__ == "__main__": obj = Address(residence_number="a@b", street="str", locality="loc", state="state", city="city") print(obj.pincode) app.run(debug = True,port = 8000)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 623, 1053, 623, 13, 5215, 19476, 10599, 408, 286, 292, 13, 3166, 288, 1028, 29889, 13203, 29889, 7328, 1053, 16428, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 11...
district42_exp_types/sdict/_rollout.py
nikitanovosibirsk/district42-exp-types
0
1611343
<reponame>nikitanovosibirsk/district42-exp-types from typing import Any, Dict, Union from district42 import optional from district42.utils import is_ellipsis __all__ = ("rollout",) KeysType = Dict[Union[str, optional], Any] def rollout(keys: KeysType, separator: str = ".") -> KeysType: updated: KeysType = {} ...
[ 1, 529, 276, 1112, 420, 29958, 5585, 8929, 586, 359, 747, 381, 808, 29914, 29881, 6801, 29946, 29906, 29899, 4548, 29899, 8768, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 7761, 13, 13, 3166, 6474, 29946, 29906, 1053, 13136, 13...
aio_geojson_nsw_transport_incidents/__init__.py
Fred-Ch/python-aio-geojson-nsw-transport-incidents-master
0
166152
"""NSW Transport Service Incidents library.""" from .feed import NswTransportServiceIncidentsFeed # noqa from .feed_manager import NswTransportServiceIncidentsFeedManager # noqa
[ 1, 9995, 3059, 29956, 15710, 6692, 9266, 16719, 3489, 1213, 15945, 30004, 13, 3166, 869, 18798, 1053, 405, 2774, 27395, 3170, 797, 29883, 16719, 29737, 29871, 396, 694, 25621, 30004, 13, 3166, 869, 18798, 29918, 12847, 1053, 405, 2774, 27...
tests/test_soda.py
Adam-Lechnos/SocrataPython
0
110576
<reponame>Adam-Lechnos/SocrataPython from sodapy import Socrata from sodapy.constants import DEFAULT_API_PREFIX, OLD_API_PREFIX import requests import requests_mock import os.path import inspect import json PREFIX = "https://" DOMAIN = "fakedomain.com" DATASET_IDENTIFIER = "songs" APPTOKEN = "FakeAppToken" USERNAME ...
[ 1, 529, 276, 1112, 420, 29958, 3253, 314, 29899, 3226, 3049, 359, 29914, 29903, 8415, 532, 11980, 13, 3166, 20892, 27580, 1053, 317, 8415, 532, 13, 3166, 20892, 27580, 29889, 3075, 1934, 1053, 22236, 29918, 8787, 29918, 15094, 25634, 2989...
src/vmshepherd/healthcheck/dummy_healthcheck.py
DreamLab/VmShepherd
10
137372
from .abstract import AbstractHealthcheck class DummyHealthcheck(AbstractHealthcheck): status = True def __init__(self, config=None): pass async def is_healthy(self, vm): return self.status def set_status(self, healthy): self.status = healthy
[ 1, 515, 869, 16595, 1053, 25513, 3868, 4298, 3198, 13, 13, 13, 1990, 360, 11770, 3868, 4298, 3198, 29898, 9118, 3868, 4298, 3198, 1125, 13, 1678, 4660, 353, 5852, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2295, 29922, 8516, 1...
darkweb/views/main.py
robopt/Capstone
5
191120
""" main.py Handles all accessible URI's for flask """ from flask import Flask, render_template, request, g from darkweb.modules.base.crawlerconfig import CrawlerConfig from darkweb.modules.irc.irc import IRC from darkweb.modules.web.WebCrawler import WebCrawler from darkweb.modules.parser.search import search from dar...
[ 1, 9995, 13, 3396, 29889, 2272, 13, 3481, 793, 599, 15579, 23539, 29915, 29879, 363, 29784, 13, 15945, 29908, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 2009, 29892, 330, 13, 3166, 6501, 2676, 29889, 7576, 29889, ...
scripts/list_ports.py
nnarain/ftl
0
182395
import os import serial def get_serial_port_iterator(): try: if os.name == 'nt': from serial.tools.list_ports_windows import comports return comports elif os.name == 'posix': from serial.tools.list_ports_posix import comports return comports e...
[ 1, 1053, 2897, 13, 5215, 7797, 13, 13, 1753, 679, 29918, 15550, 29918, 637, 29918, 17609, 7295, 13, 1678, 1018, 29901, 13, 4706, 565, 2897, 29889, 978, 1275, 525, 593, 2396, 13, 9651, 515, 7797, 29889, 8504, 29889, 1761, 29918, 4011, ...
testproject/settings.py
Instawork/django-log-request-id
1
84421
<filename>testproject/settings.py from django.conf import global_settings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, } DEBUG = True SECRET_KEY = 'secret' ROOT_URLCONF = "testproject.urls" INSTALLED_APPS = ["log_request_id"] MIDDLEWARE_CLASSES ...
[ 1, 529, 9507, 29958, 1688, 4836, 29914, 11027, 29889, 2272, 13, 3166, 9557, 29889, 5527, 1053, 5534, 29918, 11027, 13, 13, 25832, 27982, 29903, 353, 426, 13, 1678, 525, 4381, 2396, 426, 13, 4706, 525, 1430, 29954, 8895, 2396, 525, 14095...
Findclone/aiofindclone.py
vypivshiy/Findclone_api
5
13538
from aiohttp import ClientSession, FormData from Findclone import __version__ from .models import Account, Profiles, Histories, get_builder from .utils import random_string, paint_boxes from .exceptions import a_error_handler, FindcloneError from io import BufferedReader, BytesIO class FindcloneAsync: """async f...
[ 1, 515, 263, 601, 1124, 1053, 12477, 7317, 29892, 3812, 1469, 13, 13, 3166, 10987, 16513, 1053, 4770, 3259, 1649, 13, 3166, 869, 9794, 1053, 16535, 29892, 1019, 5325, 29892, 4731, 583, 29892, 679, 29918, 16409, 13, 3166, 869, 13239, 105...
pwtools/test/test_is_seq.py
elcorto/pwtools
41
60794
import os import numpy as np from pwtools.common import is_seq, file_write from .testenv import testdir def test_is_seq(): fn = os.path.join(testdir, 'is_seq_test_file') file_write(fn, 'lala') fd = open(fn , 'r') for xx in ([1,2,3], (1,2,3), np.array([1,2,3])): print(type(xx)) assert is...
[ 1, 1053, 2897, 13, 5215, 12655, 408, 7442, 13, 3166, 282, 29893, 8504, 29889, 9435, 1053, 338, 29918, 11762, 29892, 934, 29918, 3539, 13, 3166, 869, 1688, 6272, 1053, 1243, 3972, 13, 13, 1753, 1243, 29918, 275, 29918, 11762, 7295, 13, ...
py-question/lv1-01.py
fos777/MarbleChocolate
0
88329
# Q:编写一个程序,它将找到所有这些数字,可被7整除,但不是5的倍数,2000年至3200年(包括在内)。得到的数字应按逗号分隔的顺序打印在一行上。 # HINT:考虑使用range(#begin, #end)方法 l = [] for i in range(2000,3201): if (i%7==0) and (i%5!=0): l.append(str(i)) print (l)
[ 1, 396, 660, 29901, 31795, 31479, 30287, 30502, 31101, 31463, 30214, 232, 177, 134, 30998, 233, 140, 193, 30780, 30744, 30417, 30810, 31959, 30354, 30578, 30214, 30682, 31407, 29955, 233, 152, 183, 31152, 30214, 231, 192, 137, 30413, 30392,...
output/models/nist_data/atomic/unsigned_byte/schema_instance/nistschema_sv_iv_atomic_unsigned_byte_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
1
69558
<gh_stars>1-10 from output.models.nist_data.atomic.unsigned_byte.schema_instance.nistschema_sv_iv_atomic_unsigned_byte_pattern_1_xsd.nistschema_sv_iv_atomic_unsigned_byte_pattern_1 import NistschemaSvIvAtomicUnsignedBytePattern1 __all__ = [ "NistschemaSvIvAtomicUnsignedBytePattern1", ]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 1962, 29889, 9794, 29889, 29876, 391, 29918, 1272, 29889, 21641, 29889, 15395, 29918, 10389, 29889, 11010, 29918, 8758, 29889, 29876, 391, 11010, 29918, 4501, 29918...
Programmers/10. Graph/02. Rank.py
Minoolian/Coding_Test
0
83719
# 순위 # # https://programmers.co.kr/learn/courses/30/lessons/49191 def solution(n, results): answer=0 adj=[[0 for _ in range(n+1)] for _ in range(n+1)] for w,l in results: adj[w][l]=2 adj[l][w]=1 # for i in range(n+1): # for j in range(n+1): # if adj[i][j]==1: ...
[ 1, 396, 29871, 239, 139, 159, 31724, 13, 13, 29937, 29871, 13, 29937, 2045, 597, 8860, 13269, 29889, 1111, 29889, 12748, 29914, 19668, 29914, 29883, 29781, 29914, 29941, 29900, 29914, 2222, 787, 29914, 29946, 29929, 29896, 29929, 29896, 13,...
mkdocs_swagger_ui_plugin/plugin.py
byrnereese/mkdocs-swagger-ui
3
1611666
<gh_stars>1-10 import os import sys import fnmatch from timeit import default_timer as timer from datetime import datetime, timedelta from mkdocs import utils as mkdocs_utils from mkdocs.config import config_options, Config from mkdocs.plugins import BasePlugin import mkdocs.structure.files import yaml import json im...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 7876, 4352, 13, 3166, 931, 277, 1053, 2322, 29918, 20404, 408, 12237, 13, 3166, 12865, 1053, 12865, 29892, 5335, 287, 2554, 1...
ahc_tools/test/test_utils.py
rdo-management/ahc-tools
0
183597
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
[ 1, 396, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 11...
plot/Spectrogram.py
varunss123/WaveCLI
0
179398
<gh_stars>0 #!/usr/bin/env python3 # ============================================================================= # Developer : <NAME>(<EMAIL>) # License : MIT License # Year : 2019 # ============================================================================= # ======================================================...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 25512, 13, 29937, 10682, 261, 584, 529, 5813, 5961, 29966, 26862, 6227, 12948...
home/migrations/0013_merge_20190507_1221.py
nurpeiis/RED
0
102223
<reponame>nurpeiis/RED # Generated by Django 2.1.3 on 2019-05-07 08:21 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('home', '0008_auto_20190421_1129'), ('home', '0012_team_title'), ] operations = [ ]
[ 1, 529, 276, 1112, 420, 29958, 29876, 332, 412, 29875, 275, 29914, 19386, 13, 29937, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 29889, 29941, 373, 29871, 29906, 29900, 29896, 29929, 29899, 29900, 29945, 29899, 29900, 29955, 29871, 2...
backend/app/rooms/models.py
vpaliy/react-chat
1
93228
# -*- coding: future_fstrings -*- from app.database import Model, Column, SurrogatePK, db, relationship import datetime as dt import hashlib class Room(SurrogatePK, Model): __tablename__ = 'rooms' name = Column(db.String(80), unique=True, nullable=False) description = Column(db.String(300), unique=True, nullab...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 5434, 29918, 29888, 19651, 448, 29930, 29899, 13, 3166, 623, 29889, 9803, 1053, 8125, 29892, 12481, 29892, 6298, 9102, 403, 21738, 29892, 4833, 29892, 9443, 13, 5215, 12865, 408, 11636, 13, 5215, 6...
pkgpanda/actions.py
zhe-sun/dcos
0
84781
<reponame>zhe-sun/dcos<filename>pkgpanda/actions.py import collections import logging import os import sys from functools import partial from subprocess import CalledProcessError, check_call from pkgpanda import PackageId, requests_fetcher from pkgpanda.constants import (DCOS_SERVICE_CONFIGURATION_PATH, ...
[ 1, 529, 276, 1112, 420, 29958, 29920, 354, 29899, 11445, 29914, 29881, 3944, 29966, 9507, 29958, 15865, 29886, 5863, 29914, 7387, 29889, 2272, 13, 5215, 16250, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 10876, 13, 3166, 2090, 312, 8789, ...
hivemind/client/__init__.py
Vsevolod-pl/hivemind
11
123088
from hivemind.client.expert import RemoteExpert from hivemind.client.moe import RemoteMixtureOfExperts from hivemind.client.switch_moe import RemoteSwitchMixtureOfExperts from hivemind.client.averaging import DecentralizedAverager from hivemind.client.averaging.training import TrainingAverager
[ 1, 515, 298, 440, 331, 513, 29889, 4645, 29889, 735, 10700, 1053, 5240, 866, 1252, 10700, 13, 3166, 298, 440, 331, 513, 29889, 4645, 29889, 4346, 29872, 1053, 5240, 866, 29924, 29875, 15546, 2776, 1252, 546, 1372, 13, 3166, 298, 440, ...
algorithms/acm/sort.py
MarkWh1te/Gate-of-Babylon
2
185870
"""Sorting Algorithms In Python """ """ Dutch national flag problem https://en.wikipedia.org/wiki/Dutch_national_flag_problem """ def sort_colors(nums: [int], pivot: int)->[int]: small = 0 current = 1 big = len(nums)-1 while current < big: if nums[current] == pivot: current += 1 ...
[ 1, 9995, 13685, 292, 11545, 12404, 512, 5132, 13, 15945, 29908, 13, 13, 15945, 29908, 13, 29928, 10519, 4797, 7353, 1108, 13, 991, 597, 264, 29889, 6011, 29889, 990, 29914, 4594, 29914, 29928, 10519, 29918, 29876, 1288, 29918, 15581, 2991...
pypospack/potential/threebody.py
eragasa/pypospack
4
99153
<reponame>eragasa/pypospack<filename>pypospack/potential/threebody.py from collections import OrderedDict from pypospack.potential import Potential class ThreeBodyPotential(Potential): def _init_parameter_names(self): # TODO: This is only written for a single element potential for i in range(len(s...
[ 1, 529, 276, 1112, 420, 29958, 261, 351, 11290, 29914, 2272, 1066, 4058, 29966, 9507, 29958, 2272, 1066, 4058, 29914, 17765, 2556, 29914, 386, 276, 774, 1486, 29889, 2272, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 11451, 1066, ...
tests/unit/test_placeholder.py
djpugh/docserver-client
1
167803
<filename>tests/unit/test_placeholder.py<gh_stars>1-10 import unittest class PlaceholderTestCase(unittest.TestCase): def test_x(self): self.assertEqual(1, 1)
[ 1, 529, 9507, 29958, 21150, 29914, 5441, 29914, 1688, 29918, 27074, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 443, 27958, 13, 13, 1990, 15484, 7694, 3057, 8259, 29898, 348, 27958, 29889, 3057,...
OPTICS2.py
k-kapp/Clustering-Algos
0
27363
# -*- coding: utf-8 -*- """ Created on Mon Nov 30 21:25:24 2015 @author: Konrad """ import copy import numpy as np import matplotlib.pyplot as plt import scipy.special as sc_p def gen_clusters(means, num_each): tup = (); for m in means: tup = tup + (np.random.multivariate_normal(m, np....
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 15945, 19451, 13, 20399, 373, 2598, 2864, 29871, 29941, 29900, 29871, 29906, 29896, 29901, 29906, 29945, 29901, 29906, 29946, 29871, 29906, 29900, 298...
model_utils.py
PreferredAI/vista-net
75
70693
<filename>model_utils.py import tensorflow as tf import numpy as np import os def get_shape(tensor): static_shape = tensor.shape.as_list() dynamic_shape = tf.unstack(tf.shape(tensor)) dims = [s[1] if s[0] is None else s[0] for s in zip(static_shape, dynamic_shape)] return dims def make_dirs(dir): ...
[ 1, 529, 9507, 29958, 4299, 29918, 13239, 29889, 2272, 13, 5215, 26110, 408, 15886, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 13, 1753, 679, 29918, 12181, 29898, 20158, 1125, 13, 29871, 2294, 29918, 12181, 353, 12489, 29889, 12181, ...
Students/Zephyr/Exercise 1.py
MikelShifrin/Python1
3
33943
<filename>Students/Zephyr/Exercise 1.py name = input('Please enter your name:\n') age = int(input("Please enter your age:\n")) color = input('Enter your favorite color:\n') animal = input('Enter your favorite animal:\n') print('Hello my name is' , name , '.') print('I am' , age , 'years old.') print('My favorite co...
[ 1, 529, 9507, 29958, 855, 566, 1237, 29914, 24625, 561, 4316, 29914, 1252, 6269, 895, 29871, 29896, 29889, 2272, 13, 978, 353, 1881, 877, 12148, 3896, 596, 1024, 3583, 29876, 1495, 13, 13, 482, 353, 938, 29898, 2080, 703, 12148, 3896, ...
plasmapy/examples/plot_distribution.py
techieashish/PlasmaPy
1
30683
<reponame>techieashish/PlasmaPy<gh_stars>1-10 """ 1D Maxwellian distribution function =================================== We import the usual modules, and the hero of this notebook, the Maxwellian 1D distribution: """ import numpy as np from astropy import units as u import matplotlib.pyplot as plt from astropy.cons...
[ 1, 529, 276, 1112, 420, 29958, 11345, 347, 1161, 728, 29914, 3247, 25392, 19737, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 29896, 29928, 5918, 29893, 5481, 273, 4978, 740, 13, 9166, 9166, 255...
babybuddy/migrations/0002_add_settings.py
Gitoffomalawn/babybuddy
922
118771
<reponame>Gitoffomalawn/babybuddy # -*- coding: utf-8 -*- from django.db import migrations def add_settings(apps, schema_editor): Settings = apps.get_model("babybuddy", "Settings") User = apps.get_model("auth", "User") for user in User.objects.all(): if Settings.objects.filter(user=user).count() =...
[ 1, 529, 276, 1112, 420, 29958, 29954, 2049, 600, 290, 2883, 1233, 29914, 29890, 10798, 15841, 4518, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 13, 13, ...
chemdataextractor/scrape/__init__.py
edbeard/chemdataextractor-uvvis2018
6
66749
# -*- coding: utf-8 -*- """ chemdataextractor.scrape ~~~~~~~~~~~~~~~~~~~~~~~~ Declarative scraping framework for extracting structured data from HTML and XML documents. :copyright: Copyright 2016 by <NAME>. :license: MIT, see LICENSE file for more details. """ from __future__ import absolute_import from __future__ i...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 14969, 1272, 21111, 272, 29889, 1557, 336, 412, 13, 26594, 26594, 26594, 13, 13, 6185, 4675, 1230, 885, 2390, 292, 6890, 363, 6597, 2...
application/siteApp/urls.py
Marcelotsvaz/vaz-projects
0
859
# # VAZ Projects # # # Author: <NAME> <<EMAIL>> from django.urls import path from . import views app_name = 'siteApp' urlpatterns = [ path( '', views.Home.as_view(), name = 'home' ), path( 'about-me', views.About_me.as_view(), name = 'about_me' ), path( 'search', views.Search.as_view(), na...
[ 1, 396, 29871, 13, 29937, 478, 29909, 29999, 8010, 29879, 13, 29937, 29871, 13, 29937, 29871, 13, 29937, 13361, 29901, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 13, 13, 13, 3166, 9557, 29889, 26045, 1053, 2224, 13, 13, 3166, 869, ...
examples/poverty-detection-keras/pred_cong_pd.py
rpitonak/eo-learn
1
101937
<filename>examples/poverty-detection-keras/pred_cong_pd.py """ Note: After we have the tf-serving image running, we don't actually need following script. pred_config.py List some configuration parameters for prediction """ import os from os import path as op preds_dir = op.join(os.getcwd(), "preds") plot_dir = op.jo...
[ 1, 529, 9507, 29958, 19057, 29914, 29886, 957, 1017, 29899, 29881, 2650, 428, 29899, 3946, 294, 29914, 11965, 29918, 21015, 29918, 15926, 29889, 2272, 13, 13, 15945, 29908, 13, 9842, 29901, 2860, 591, 505, 278, 15886, 29899, 643, 1747, 19...
msl/qt/exceptions.py
rebeccahawke/msl-qt
0
43114
""" Exception handling used by **MSL-Qt**. """ import logging import traceback from . import QtWidgets, Qt, application logger = logging.getLogger(__name__) def excepthook(exc_type, exc_obj, exc_traceback): """Displays unhandled exceptions in a :class:`QtWidgets.QMessageBox`. See :func:`sys.excepthook` for...
[ 1, 9995, 13, 2451, 11415, 1304, 491, 3579, 4345, 29931, 29899, 17303, 1068, 29889, 13, 15945, 29908, 13, 5215, 12183, 13, 5215, 9637, 1627, 13, 13, 3166, 869, 1053, 14705, 8801, 29879, 29892, 14705, 29892, 2280, 13, 13, 21707, 353, 1218...
Data Structures/Heap/JesseAndCookies.py
aibenStunner/HackerRank
2
37149
#!/bin/python3 import os import sys class minHeap: def __init__(self): self.items = [] self.size = len(self.items) def getLeftChildIndex(self, parentIndex): return 2 * parentIndex + 1 def getRightChildIndex(self, parentIndex): return 2 * parentIndex + 2 def g...
[ 1, 18787, 2109, 29914, 4691, 29941, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 1990, 1375, 3868, 481, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 7076, 353, 5159, 13, 4706, 1583, 29889, 2311, 353, 743...
sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py
rsdoherty/azure-sdk-for-python
2,728
1607590
<reponame>rsdoherty/azure-sdk-for-python<filename>sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # lice...
[ 1, 529, 276, 1112, 420, 29958, 2288, 29881, 1148, 814, 29891, 29914, 17688, 29899, 15348, 29899, 1454, 29899, 4691, 29966, 9507, 29958, 15348, 29914, 3696, 29882, 431, 29914, 17688, 29899, 3696, 29882, 431, 29914, 21150, 29914, 3696, 29882, ...
rnn/chatbot/chatbot.py
llichengtong/yx4
128
21467
# coding=utf8 import logging import os import random import re import numpy as np import tensorflow as tf from seq2seq_conversation_model import seq2seq_model from seq2seq_conversation_model import data_utils from seq2seq_conversation_model import tokenizer from seq2seq_conversation_model.seq2seq_conversation_model imp...
[ 1, 396, 14137, 29922, 9420, 29947, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 4036, 13, 5215, 337, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 3166, 19359, 29906, 11762, 29918, 535, 874, 362, 29918, 4299, 1053, 19359, ...
sfymca/feed/urls.py
streeter/sf-ymca-pools
0
95030
<reponame>streeter/sf-ymca-pools from django.urls import path from sfymca.feed import views urlpatterns = [ path("", views.index, name="index"), path("<branch_name>.ics", views.branch_calendar, name="branch_calendar"), path("<branch_name>/", views.branch, name="branch"), ]
[ 1, 529, 276, 1112, 420, 29958, 13045, 1308, 29914, 4668, 29899, 962, 1113, 29899, 1129, 3775, 13, 3166, 9557, 29889, 26045, 1053, 2224, 13, 13, 3166, 18668, 962, 1113, 29889, 18798, 1053, 8386, 13, 13, 2271, 11037, 29879, 353, 518, 13, ...
app/__init__.py
HK-Zhang/FlaskAADB2C
0
175366
<filename>app/__init__.py from flask import Flask,url_for from flask_session import Session # https://pythonhosted.org/Flask-Session from flask_cors import CORS from config import appinsightKey,apiversion,load_config from opencensus.ext.azure.trace_exporter import AzureExporter from opencensus.ext.azure.log_exporter i...
[ 1, 529, 9507, 29958, 932, 29914, 1649, 2344, 26914, 2272, 13, 3166, 29784, 1053, 2379, 1278, 29892, 2271, 29918, 1454, 13, 3166, 29784, 29918, 7924, 1053, 16441, 29871, 396, 2045, 597, 4691, 3069, 287, 29889, 990, 29914, 8754, 1278, 29899...
ironic_inspector/cmd/dbsync.py
namnx228/ironic-inspector
31
10566
<gh_stars>10-100 # Copyright 2015 Cisco Systems # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29945, 315, 275, 1111, 23985, 13, 29937, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 2114...
test/LHS_test.py
misantam/GAparsimony
0
125895
# -*- coding: utf-8 -*- from GAparsimony.lhs.util import isValidLHS, isValidLHS_int from GAparsimony.lhs import geneticLHS, improvedLHS, maximinLHS, optimumLHS, randomLHS, randomLHS_int import pytest @pytest.mark.parametrize("shape", [ (2, 2), (6, 6), (3, 8) ]) def test_randomLHS_int(shape): assert i...
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 402, 29909, 862, 3601, 2592, 29889, 29880, 9499, 29889, 4422, 1053, 338, 7211, 29931, 14851, 29892, 338, 7211, 29931, 14851, 29918, 524, 13, 31...
model_analyzer/config/run/run_search.py
MarkMoTrin/model_analyzer
115
68183
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29896, 405, 13044, 10764, 315, 1955, 29925, 1955, 8098, 669, 23844, 3738, 5265, 1299, 2890, 29889, 2178, 10462, 21676, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278,...
nibabies/workflows/brain_extraction.py
oesteban/nibabies
0
90097
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Nipype translation of ANTs' workflows.""" import numpy as np # general purpose from pkg_resources import resource_filename as pkgr_fn # nipype from nipype.pipeline import engine as pe from nipype.interf...
[ 1, 396, 953, 16815, 29901, 448, 29930, 29899, 4464, 29901, 3017, 29936, 11451, 29899, 12860, 29899, 10289, 29901, 29871, 29946, 29936, 29536, 29899, 21175, 29899, 8513, 29901, 4263, 448, 29930, 29899, 13, 29937, 3516, 29901, 731, 11791, 29922...
packages/w3af/w3af/core/controllers/tests/core_test_suite/test_exception_handler.py
ZooAtmosphereGroup/HelloPackages
3
92709
<gh_stars>1-10 """ test_exception_handling.py Copyright 2011 <NAME> This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distribut...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 1688, 29918, 11739, 29918, 3179, 1847, 29889, 2272, 13, 13, 11882, 1266, 29871, 29906, 29900, 29896, 29896, 529, 5813, 29958, 13, 13, 4013, 934, 338...
imports.py
MarcusTL12/PyCalc
0
119831
import sys sys.path.append('./PyScr/') import numpy as np import matplotlib.pyplot as plt import cmath import math import copy import pfprint import primefac from scipy.special import comb as choose _ = None def ppprint(arg): global _ pfprint.pfprint(arg) _ = arg def frac(): pfprint.frac = not pfprint.frac retu...
[ 1, 1053, 10876, 13, 9675, 29889, 2084, 29889, 4397, 877, 6904, 19737, 4421, 29878, 29914, 1495, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 274, 755, 13, 5215, 5844, 13, 5215, 3509, 13, 5215, ...
trompace/mutations/__init__.py
trompamusic/ce-queries-template
1
8306
MUTATION = '''mutation {{ {mutation} }}''' def _verify_additional_type(additionaltype): """Check that the input to additionaltype is a list of strings. If it is empty, raise ValueError If it is a string, convert it to a list of strings.""" if additionaltype is None: return None if isins...
[ 1, 341, 2692, 8098, 353, 14550, 6149, 362, 8620, 13, 29871, 426, 6149, 362, 29913, 13, 930, 12008, 13, 13, 13, 1753, 903, 27902, 29918, 1202, 3245, 29918, 1853, 29898, 1202, 3245, 1853, 1125, 13, 1678, 9995, 5596, 393, 278, 1881, 304,...
nodux_stock_one/config/nodux_stock_one.py
tatiqm25/nodux_stock_one
0
89714
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Reporte Stock"), "icon": "fa fa-star", "items": [ { "type": "report", "name": "Stock", "doctype": "Stock One", "is_query_report": True } ] } ]
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 3166, 5227, 4798, 1053, 903, 13, 13, 1753, 679, 29918, 1272, 7295, 13, 12, 2457, 518, 13, 12, 12, 29912, 13, 12, 12, 12, 29908, 1643, 1115, 903, 703, 5612, 10069,...
ai_haste/loss/log_squared_loss.py
aidotse/Team-Haste
0
107857
<reponame>aidotse/Team-Haste import torch import torch.nn as nn import torch.nn.functional as F class LogSquaredLoss(nn.Module): def __init__(self,): super(LogSquaredLoss, self).__init__() self.l1 = nn.L1Loss() self.eps = 1e-8 def forward(self, output, target): # output = torc...
[ 1, 529, 276, 1112, 420, 29958, 29874, 333, 327, 344, 29914, 19409, 29899, 29950, 4350, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 13, 13,...
pymf6/tests/test_bool.py
hydrocomputing/pymf6
4
171382
#!/usr/bin/env python """Simple callback test """ from pymf6.callback import Func from pymf6 import mf6 class MyFunc(Func): # pylint: disable=too-few-public-methods """ Callback """ def __init__(self, stop=2, verbose=False): super().__init__(verbose=verbose) self.stop = stop ...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 15945, 29908, 15427, 6939, 1243, 13, 15945, 29908, 13, 13, 13, 3166, 282, 962, 29888, 29953, 29889, 14035, 1053, 383, 4661, 13, 3166, 282, 962, 29888, 29953, 1053, 286, 29888, 2995...
src/main/resources/pytz/zoneinfo/America/Panama.py
TheEin/swagger-maven-plugin
65
60898
'''tzinfo timezone information for America/Panama.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Panama(DstTzInfo): '''America/Panama timezone definition. See datetime.tzinfo for details''' zone = 'America/Panama' ...
[ 1, 14550, 17559, 3888, 29431, 2472, 363, 6813, 29914, 23684, 3304, 29889, 12008, 13, 3166, 282, 3637, 29920, 29889, 17559, 3888, 1053, 360, 303, 29911, 29920, 3401, 13, 3166, 282, 3637, 29920, 29889, 17559, 3888, 1053, 26959, 1891, 29918, ...
python/generated/swaggeraem/apis/__init__.py
mbloch1986/swagger-aem
0
104970
from __future__ import absolute_import # import apis into api package from .console_api import ConsoleApi from .cq_api import CqApi from .crx_api import CrxApi from .custom_api import CustomApi from .sling_api import SlingApi
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 29937, 1053, 3095, 275, 964, 7882, 3577, 13, 3166, 869, 11058, 29918, 2754, 1053, 9405, 11713, 13, 3166, 869, 29883, 29939, 29918, 2754, 1053, 315, 29939, 11713, 13, 3166...
setup.py
edyatl/passchek
5
163446
#!/usr/bin/env python3 import setuptools from passchek.passchek import __version__ with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="passchek", version=__version__, license="MIT", author="<NAME>", author_email="<EMAIL>", description="Passchek is a sim...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 5215, 731, 21245, 8789, 13, 13, 3166, 1209, 1173, 29895, 29889, 3364, 1173, 29895, 1053, 4770, 3259, 1649, 13, 13, 2541, 1722, 703, 16310, 2303, 29889, 3487, 613, 376, 29878, 11...
conftest.py
Casecommons/sentry
0
1608557
<gh_stars>0 from django.conf import settings import mock import os import os.path def pytest_configure(config): import warnings warnings.filterwarnings('error', '', Warning, r'(sentry|raven)') if not settings.configured: os.environ['DJANGO_SETTINGS_MODULE'] = 'sentry.conf.server' test_db = o...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 5215, 11187, 13, 5215, 2897, 13, 5215, 2897, 29889, 2084, 13, 13, 13, 1753, 11451, 1688, 29918, 17591, 29898, 2917, 1125, 13, 1678, 1053, 18116,...
tensorflow_hub/saved_model_module.py
hrishikeshmane/hub
2
1615221
# Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 450, 323, 6073, 17907, 14533, 13189, 943, 29889, 2178, 26863, 2538, 9841, 29889, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, ...
modules/sensor_heatmap/controllers.py
srcc-msu/job_statistics
0
122799
from flask import Blueprint, render_template, current_app, Response from application.database import global_db from application.helpers import requires_auth from core.monitoring.models import SENSOR_CLASS_MAP sensor_heatmap_pages = Blueprint('sensor_heatmap', __name__ , template_folder='templates', static_folder='st...
[ 1, 515, 29784, 1053, 10924, 2158, 29892, 4050, 29918, 6886, 29892, 1857, 29918, 932, 29892, 13291, 13, 3166, 2280, 29889, 9803, 1053, 5534, 29918, 2585, 13, 13, 3166, 2280, 29889, 3952, 6774, 1053, 6858, 29918, 5150, 13, 3166, 7136, 29889...
python_test.py
jackKiZhu/mypython
0
8114
<gh_stars>0 from flask import Flask, render_template, request from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://root:mysql@127.0.0.1:3306/python_github" app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True db = SQLAlchemy(app) class User(db.Model): id = ...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 2009, 13, 3166, 29784, 29918, 2850, 284, 305, 6764, 1053, 3758, 2499, 305, 6764, 13, 932, 353, 2379, 1278, 22168, 978, 16...
tests.py
HeyIamJames/CarCompare
0
137833
<gh_stars>0 import unittest from selenium import webdriver from selenium.webdriver.common.keys import Keys class PythonOrgSearch(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() def test_search_in_python_org(self): driver = self.driver("/chromedriver.exe" self.ass...
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 3166, 18866, 1053, 1856, 9465, 13, 3166, 18866, 29889, 29813, 29889, 9435, 29889, 8149, 1053, 4813, 952, 13, 13, 1990, 5132, 2816, 29887, 7974, 29898, 348, 27958, ...
Audio_CrisNet_spec_mel_log.py
BioSIP/countcrowd_TFG
0
71797
<filename>Audio_CrisNet_spec_mel_log.py<gh_stars>0 from losses import LogCoshLoss import os from scipy.io import loadmat from torch.utils.data import DataLoader from torch.utils.data import Dataset import torch import torchaudio import torch.nn as nn from torch import optim import torch.nn.functional as F import numpy ...
[ 1, 529, 9507, 29958, 17111, 29918, 29907, 3780, 6779, 29918, 6550, 29918, 12873, 29918, 1188, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 28495, 1053, 4522, 29907, 10578, 29931, 2209, 13, 5215, 2897, 13, 3166, 4560,...
signin/tests.py
pptnz/swa_team2
0
1343
<reponame>pptnz/swa_team2 import json from django.test import TestCase from django.contrib.auth.models import User from .models import CustomUser from django.apps import apps from .apps import SigninConfig class SignInTest(TestCase): def setUp(self): self.django_user = User.objects.create_user(username='...
[ 1, 529, 276, 1112, 420, 29958, 407, 6277, 29920, 29914, 29879, 2766, 29918, 14318, 29906, 13, 5215, 4390, 13, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 8...
mutagene/cli/motif_menu.py
neksa/pymutagene
3
116108
<filename>mutagene/cli/motif_menu.py import argparse import sys import logging from mutagene.io.context_window import read_MAF_with_context_window, read_VCF_with_context_window from mutagene.motifs import identify_motifs from mutagene.io.motifs import write_motif_matches, get_known_motifs logger = logging.getLogger(...
[ 1, 529, 9507, 29958, 6149, 351, 1600, 29914, 11303, 29914, 14817, 361, 29918, 6510, 29889, 2272, 13, 5215, 1852, 5510, 13, 5215, 10876, 13, 5215, 12183, 13, 13, 3166, 5478, 351, 1600, 29889, 601, 29889, 4703, 29918, 7165, 1053, 1303, 29...
leetcode/319-Bulb-Switcher/BulbSwitcher_001_TLE.py
cc13ny/all-in
1
175640
class Solution(object): def bulbSwitch(self, n): """ :type n: int :rtype: int """ num_of_facs = [1 for i in range(n)] for j in range(2, n + 1): for k in range(1, n / j + 1): num_of_facs[j * k - 1] += 1 res = 0 for num in nu...
[ 1, 770, 24380, 29898, 3318, 1125, 13, 1678, 822, 8227, 29890, 24995, 29898, 1311, 29892, 302, 1125, 13, 4706, 9995, 13, 4706, 584, 1853, 302, 29901, 938, 13, 4706, 584, 29878, 1853, 29901, 938, 13, 4706, 9995, 13, 4706, 954, 29918, 97...
main.py
fogcitymarathoner/gae_p27_dj17
0
1615694
import os,sys os.environ['DJANGO_SETTINGS_MODULE'] = 'p27_d17_prj.settings' # Force Django to reload its settings. from django.conf import settings settings._target = None import django.core.handlers.wsgi import django.core.signals import django.db import django.dispatch # Log errors. #import logging #def log_except...
[ 1, 1053, 2897, 29892, 9675, 13, 359, 29889, 21813, 1839, 29928, 29967, 2190, 17080, 29918, 10490, 29911, 4214, 29903, 29918, 6720, 14849, 1307, 2033, 353, 525, 29886, 29906, 29955, 29918, 29881, 29896, 29955, 29918, 558, 29926, 29889, 11027, ...
conllu/conllu.py
spyysalo/conllu.py
13
53528
#!/usr/bin/env python # CoNLL-U format support import re import codecs import brat from itertools import groupby # feature name-value separator FSEP = '=' # dependency head-rel separator DSEP = ':' # Free-form text annotation type in brat export COMMENT_TYPE = 'AnnotatorNotes' class FormatError(Exception): d...
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 29937, 3189, 29940, 2208, 29899, 29965, 3402, 2304, 13, 13, 5215, 337, 13, 5215, 775, 2395, 13, 13, 5215, 1506, 271, 13, 13, 3166, 4256, 8504, 1053, 2318, 1609, 13, 13, 29937, ...
src/riotwatcher/__version__.py
mikeread-dev/Riot-Watcher
0
54996
__version__ = "3.1.2" __author__ = "pseudonym117" __title__ = "RiotWatcher"
[ 1, 4770, 3259, 1649, 353, 376, 29941, 29889, 29896, 29889, 29906, 29908, 13, 1649, 8921, 1649, 353, 376, 27358, 566, 4735, 29896, 29896, 29955, 29908, 13, 1649, 3257, 1649, 353, 376, 29934, 24414, 24709, 261, 29908, 13, 2 ]
practices/practice_2.2/src/database/manage/__init__.py
JoelHernandez343/networking-administration
0
1616295
from database import models from database.database import engine from database.manage import interface from database.manage import vlan def drop_db(): models.Base.metadata.drop_all(bind=engine) def create_db(): models.Base.metadata.create_all(bind=engine) def recreate_db(): drop_db() create_db()
[ 1, 515, 2566, 1053, 4733, 13, 3166, 2566, 29889, 9803, 1053, 6012, 13, 13, 3166, 2566, 29889, 1171, 482, 1053, 5067, 13, 3166, 2566, 29889, 1171, 482, 1053, 325, 6468, 13, 13, 13, 1753, 5768, 29918, 2585, 7295, 13, 1678, 4733, 29889, ...
plugins/modules/channel_policy.py
m-g-k/ansible-collection
1
64331
#!/usr/bin/python # # SPDX-License-Identifier: Apache-2.0 # from __future__ import absolute_import, division, print_function __metaclass__ = type from ..module_utils.dict_utils import equal_dicts, merge_dicts, copy_dict from ..module_utils.module import BlockchainModule from ..module_utils.proto_utils import proto_to...
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 29937, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 13380, 29899, 29906, 29889, 29900, 13, 29937, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215,...
Diena_1_4_thonny/d2_u2_d11.py
edzya/Python_RTU_08_20
8
34881
<filename>Diena_1_4_thonny/d2_u2_d11.py try: width=float(input("Ieraksti savas istabas platumu (metros): ")) height=float(input("Ieraksti savas istabas augstumu (metros): ")) length=float(input("Ieraksti savas istabas garumu (metros): ")) capacity=round(width*height*length, 2) print(f"Tavas istabas ...
[ 1, 529, 9507, 29958, 29928, 819, 29874, 29918, 29896, 29918, 29946, 29918, 386, 265, 1460, 29914, 29881, 29906, 29918, 29884, 29906, 29918, 29881, 29896, 29896, 29889, 2272, 13, 2202, 29901, 13, 1678, 2920, 29922, 7411, 29898, 2080, 703, 29...
my_app/templates/model.py
varshaholsambre/Whats-For-Dinner
0
113164
from my_app import db class Fact(db.Model): id = db.Column(db.Integer, primary_keys = True) name = db.Column(db.String(100)) value = db.Column(db.String(100))
[ 1, 515, 590, 29918, 932, 1053, 4833, 30004, 13, 30004, 13, 1990, 26748, 29898, 2585, 29889, 3195, 1125, 30004, 13, 12, 333, 353, 4833, 29889, 4409, 29898, 2585, 29889, 7798, 29892, 7601, 29918, 8149, 353, 5852, 8443, 13, 12, 978, 353, ...
test/propagation_warn_only_test.py
lechat/jenkinsflow
0
21075
# Copyright (c) 2012 - 2015 <NAME>, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from pytest import raises from jenkinsflow.flow import serial, parallel, FailedChildJobException, FailedChildJobsException, Propagation, BuildResult from .framework import api_select from .framewo...
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29906, 448, 29871, 29906, 29900, 29896, 29945, 529, 5813, 10202, 379, 786, 10612, 29873, 13315, 13, 29937, 2178, 10462, 21676, 29889, 910, 664, 338, 1090, 263, 350, 7230, ...
plugins/modules/system_certificate_info.py
steinzi/ansible-ise
0
1612480
<reponame>steinzi/ansible-ise<filename>plugins/modules/system_certificate_info.py #!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021, Cisco Systems # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r""" --- module: system_certificate_info short_de...
[ 1, 529, 276, 1112, 420, 29958, 5465, 2526, 29914, 550, 1821, 29899, 895, 29966, 9507, 29958, 12800, 29914, 7576, 29914, 5205, 29918, 6327, 8021, 29918, 3888, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 29937, 448, 2...
get-mensa-data/get_mensa_data.py
ProjectPepperHSB/Backend-Services
0
90616
<reponame>ProjectPepperHSB/Backend-Services<filename>get-mensa-data/get_mensa_data.py #pip install pdf2image #-- poppler -- #https://github.com/oschwartz10612/poppler-windows/releases/ #env: "C:\path\to\poppler-xx\bin" import requests import urllib.request import json import re import traceback from bs4 impo...
[ 1, 529, 276, 1112, 420, 29958, 7653, 15666, 2496, 29950, 1744, 29914, 5841, 355, 29899, 13779, 29966, 9507, 29958, 657, 29899, 29885, 14535, 29899, 1272, 29914, 657, 29918, 29885, 14535, 29918, 1272, 29889, 2272, 13, 29937, 13096, 2601, 135...
points/migrations/0004_spend_receipt.py
JXIong15/fetch-points
0
58797
# Generated by Django 4.0.1 on 2022-01-12 23:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('points', '0003_spend_alter_transaction_timestamp'), ] operations = [ migrations.AddField( model_name='spend', name='...
[ 1, 396, 3251, 630, 491, 15337, 29871, 29946, 29889, 29900, 29889, 29896, 373, 29871, 29906, 29900, 29906, 29906, 29899, 29900, 29896, 29899, 29896, 29906, 29871, 29906, 29941, 29901, 29946, 29946, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, ...
django_walletpass/__init__.py
Develatio/django-passbook
7
63589
<reponame>Develatio/django-passbook # pylint: disable=invalid-name VERSION = '1.0' default_app_config = 'django_walletpass.apps.DjangoWalletpassConfig'
[ 1, 529, 276, 1112, 420, 29958, 2772, 955, 20819, 29914, 14095, 29899, 3364, 2909, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 20965, 29899, 978, 13, 16358, 353, 525, 29896, 29889, 29900, 29915, 13, 13, 4381, 29918, 932, 29918, 2917, ...
etc/metadataParsers/ngrams/writeNgrams.py
organisciak/HTRC-BookwormDB
0
93549
<filename>etc/metadataParsers/ngrams/writeNgrams.py<gh_stars>0 #!/usr/bin/python import os import re filenames = [filename for filename in os.listdir("../../../texts/raw") if not (re.search('zip',filename) or re.search('3gram',filename))] for filename in filenames: towrite = dict() print filename reading =...
[ 1, 529, 9507, 29958, 7070, 29914, 19635, 29925, 1503, 414, 29914, 29876, 1393, 29879, 29914, 3539, 29940, 1393, 29879, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215...
json.py
AbhijithGanesh/Flask-HTTP-Server
0
18858
import json ''' READ THE DATABASE README before operating ''' File = r'''YOUR FILE''' with open(File,'a') as fileObj: data = json.load() ''' YOUR DATA LOGIC GOES IN HERE Once the data is changed, to write it to your JSON file use the following command. ''' json.dump(object,File)
[ 1, 1053, 4390, 13, 12008, 13, 16310, 6093, 27640, 27982, 5195, 3035, 2303, 1434, 13598, 13, 12008, 13, 2283, 353, 364, 12008, 29979, 22970, 24080, 12008, 13, 2541, 1722, 29898, 2283, 5501, 29874, 1495, 408, 934, 9930, 29901, 13, 1678, 8...
tests/test_code.py
MattDMo/PythonImproved
83
120746
from . import foo from .. import bar from ... import baz import ...snurp def blah(...): pass class Foo(tuple): @staticmethod def __new__(cls, initialValue=(0,0)): return tuple.__new__(cls, initialValue) class Bar(tuple): def __init__(self, initialValue=(0,0)): super(tuple, self)._...
[ 1, 515, 869, 1053, 7953, 13, 3166, 6317, 1053, 2594, 13, 3166, 2023, 1053, 12741, 13, 13, 5215, 2023, 16586, 332, 29886, 13, 13, 1753, 29268, 19327, 1125, 13, 1678, 1209, 13, 13, 13, 13, 1990, 13679, 29898, 23583, 1125, 13, 1678, 73...
test/test_stdio.py
razor-1/apns-clerk
0
57747
# Author <NAME> # Based on apns-client implementation by <NAME> # # 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 applicabl...
[ 1, 396, 13361, 529, 5813, 29958, 13, 29937, 16564, 373, 3095, 1983, 29899, 4645, 5314, 491, 529, 5813, 29958, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 29...
tensorflow_in_action/nlp/2_ptb_gen_idword.py
wdxtub/deep-learning-note
37
31273
import codecs import sys RAW_DATA = "../data/ptb/ptb.train.txt" VOCAB = "data/ptb.vocab" OUTPUT_DATA = "data/ptb.train" # 读取词汇表并建立映射 with codecs.open(VOCAB, "r", "utf-8") as f_vocab: vocab = [w.strip() for w in f_vocab.readlines()] word_to_id = {k: v for (k, v) in zip(vocab, range(len(vocab)))} # 如果出现了被删除的低频词,替换...
[ 1, 1053, 775, 2395, 13, 5215, 10876, 13, 13, 4717, 29956, 29918, 14573, 353, 376, 6995, 1272, 29914, 415, 29890, 29914, 415, 29890, 29889, 14968, 29889, 3945, 29908, 13, 29963, 20166, 2882, 353, 376, 1272, 29914, 415, 29890, 29889, 29894,...