seq_id
string
text
string
repo_name
string
sub_path
string
file_name
string
file_ext
string
file_size_in_byte
int64
program_lang
string
lang
string
doc_type
string
stars
int64
dataset
string
pt
string
api
list
144857419
import numpy as np import sympy as sym def newton(xi,fi): n=len(xi) xi=np.array(xi) fi=np.array(fi) n = len(xi) ki = np.arange(0,n,1) tabla = np.concatenate(([ki],[xi],[fi]),axis=0) tabla = np.transpose(tabla) dfinita = np.zeros(shape=(n,n),dtype=float) tabla = np.conc...
null
Methods/M20_Newton_Divided_Difference.py
M20_Newton_Divided_Difference.py
py
1,607
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_numb...
5398807
from __future__ import division import numpy as np import matplotlib.pyplot as plt import sys import glob import matplotlib.gridspec as gridspec from mpl_toolkits.mplot3d import Axes3D import os ##Setup plotting environment plt.style.use('science') h = 10 w = 20 fig = plt.figure(figsize=(w,h)) ax0 = plt.subplot...
null
tools/propagation_delay.py
propagation_delay.py
py
4,252
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 13, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 13, "usage_type": "name" }, { "api_na...
9657555
"""Unit tests for specifications files.""" import os import yaml import json from pytest import mark from requests import get from common.bootstrap import collect_sources from common.utilities import get_fiscal_datapackage from common.config import ( FISCAL_SCHEMA_FILE, OS_TYPES_URL, FISCAL_MODEL_FILE, ...
null
eu-structural-funds/tests/test_specifications.py
test_specifications.py
py
5,838
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.config.FISCAL_MODEL_FILE", "line_number": 24, "usage_type": "name" }, { "api_name": "common.config.FISCAL_SCHEMA_FILE", "line_number": 25, "usage_type": "name" }, { "api_name": "common.config.FISCAL_METADATA_FILE", "line_number": 26, "usage_type": "n...
112607187
# 元注解单例的实践 import os import traceback from configparser import ConfigParser from enum import Enum, unique import redis import pickle # 协程库 gen允许异步代码更直接,而不用链式回调 from tornado.gen import coroutine, Return # AsyncHTTPClient 是HTTP客户端实现 from tornado.httpclient import AsyncHTTPClient # 异步网络库IOLoop from tornado.ioloop import I...
null
mini_db/src/async_request.py
async_request.py
py
4,058
python
en
code
null
code-starcoder2
76
[ { "api_name": "redis.Redis", "line_number": 21, "usage_type": "call" }, { "api_name": "tornado.options.options.redis_host", "line_number": 21, "usage_type": "attribute" }, { "api_name": "tornado.options.options", "line_number": 21, "usage_type": "name" }, { "api_n...
380063484
import json import sys from math import sqrt import argparse import re import os def load_data(filepath): if os.path.exists(filepath): with open(filepath, 'r') as f: return f.read() def enter_coordinates(): try: print("Longitude: ") longitude = int(input()) print(...
null
bars.py
bars.py
py
2,471
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exit", "l...
507891227
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 5 17:01:00 2020 @author: jinlingxing """ from collections import deque class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: if root == None: return [] res = [] q = deque([root]) w...
null
102.py
102.py
py
648
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" } ]
292790803
import logging import os LOGFILE = "/tmp/idtranslator/backend.log" def create_logger(): """ Creates a logging object and returns it """ logger = logging.getLogger("backend_logger") logger.setLevel(logging.DEBUG) try: # create the logging file handler fh = logging.FileHandler(r...
null
id_translator/log/backend_logger.py
backend_logger.py
py
742
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", "line_number": 15, "usage_type": "call" }, { "api_name": "os.mkdir", ...
92985725
from datetime import date, datetime from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.core.mail import EmailMessage from django.db import models from django.urls import reverse from ghost_shopper.core.models import PerformerLet...
null
ghost_shopper/check/models.py
models.py
py
9,943
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Manager", "line_number": 16, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 16, "usage_type": "name" }, { "api_name": "enums.CHECK_TYPES", "line_number": 18, "usage_type": "name" }, { "api_name": "djan...
68059128
from guestbook_app import db from wtforms.validators import Length from datetime import datetime class GuestBookItem(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) author = db.Column(db.String(140), nullable=False) text = db.Column(db.String(500), nullable=False, info={"valida...
null
lesson13/guestbook/models.py
models.py
py
1,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "guestbook_app.db.Model", "line_number": 6, "usage_type": "attribute" }, { "api_name": "guestbook_app.db", "line_number": 6, "usage_type": "name" }, { "api_name": "guestbook_app.db.Column", "line_number": 7, "usage_type": "call" }, { "api_name": "gue...
268929223
#!/usr/bin/env python from itertools import islice from pathlib import PurePath from pathlib import Path from datetime import timedelta import time import argparse import librosa import json import math import sys import os # Add this directory to path so that package is recognized. # Looks like a hack, but is ok for...
null
Audex/dataprep_asr.py
dataprep_asr.py
py
9,530
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number...
552723313
import numpy import scipy import netCDF4 import matplotlib.pyplot as mp import matplotlib.ticker import matplotlib.colors import scipy.stats import pandas import itertools mp.rcParams.update({'mathtext.default': 'regular'}) #get_ipython().magic('matplotlib inline') # ==================================================...
null
NEW_CALCULATIONS/calcs_and_plots/whiplash/old/whiplash_calculations_running_mean_loop_years_reversible.py
whiplash_calculations_running_mean_loop_years_reversible.py
py
10,918
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.rcParams.update", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { ...
22245594
def optimize(loss, initial_parameters, method='Powell', options=None, compile=False): """Main optimization method. Selects one of the following optimizers: - :meth:`qibo.optimizers.cma` - :meth:`qibo.optimizers.newtonian` - :meth:`qibo.optimizers.sgd` Args: loss (ca...
null
src/qibo/optimizers.py
optimizers.py
py
4,647
python
en
code
null
code-starcoder2
76
[ { "api_name": "cma.fmin2", "line_number": 41, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 60, "usage_type": "call" }, { "api_name": "qibo.K.Variable", "line_number": 93, "usage_type": "call" }, { "api_name": "qibo.K", "line_...
600646439
# !/user/bin/env python # -*- coding:utf-8 -*- from PyQt5.QtWidgets import QFileDialog, QMainWindow from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWebEngineWidgets import * import sys,os from carGUI import Ui_MainWindow import video_track import urllib.request class MyVideoForm(QMainWindow,Ui_MainWindow): ...
null
VideoGUI.py
VideoGUI.py
py
4,410
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "carGUI.Ui_MainWindow", "line_number": 11, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 13, "usage_type": "call" }, { "api_name...
535505999
"""Support functions """ import numpy import pygrib ww3_f = "data/nww3.t00z.grib.grib2.grb" # Region lat/lon bounding boxes region_box = { "gold_coast": { "lat": [-31, -25], "lon": [152, 157] } } # Era5 variable names var_names = { u'10 metre U wind component', u'10 metre V wind comp...
null
utils.py
utils.py
py
2,505
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygrib.open", "line_number": 95, "usage_type": "call" }, { "api_name": "pygrib.open", "line_number": 114, "usage_type": "call" } ]
362565839
import requests import misc import json weather_key = misc.weather_key def get_weather_updates(city): url = 'http://api.openweathermap.org/data/2.5/weather?q=' + city + '&APPID=' + weather_key r = requests.get(url) return r.json() def weather_save(city): data = get_weather_updates(city) with op...
null
bot/weather_api.py
weather_api.py
py
735
python
en
code
null
code-starcoder2
76
[ { "api_name": "misc.weather_key", "line_number": 6, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 17, "usage_type": "call" } ]
313676740
from geopy.distance import geodesic from math import radians, sin, cos, acos import pandas as pd from copy import deepcopy import math import sys def dist2(lat1, lon1, lat2, lon2): """ Utility function for finding distance between two points given their latitudes and longitudes """ distance = geod...
null
Mallocators_Submission/scorer.py
scorer.py
py
4,121
python
en
code
null
code-starcoder2
76
[ { "api_name": "geopy.distance.geodesic", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 26, "usage_type": "call" }, { "api_name": "pandas.read_csv...
118713915
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # 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...
null
ChuckTests/RemoteControlTest/src/joystick_control/scripts/talker.py
talker.py
py
3,856
python
en
code
null
code-starcoder2
76
[ { "api_name": "rospy.Publisher", "line_number": 44, "usage_type": "call" }, { "api_name": "std_msgs.msg.String", "line_number": 44, "usage_type": "argument" }, { "api_name": "rospy.Publisher", "line_number": 45, "usage_type": "call" }, { "api_name": "std_msgs.msg....
85473100
from functools import reduce from os import path import re BAG_REGEX = re.compile(r'(\d+) (\w+ \w+) bags?') SubBag = tuple[int, str] Rule = tuple[str, list[SubBag]] def parse_rules(input_file: str) -> list[Rule]: with open(input_file) as f: return [ parse_rule(rule_text) for rule_...
null
day07/day7.py
day7.py
py
2,313
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 5, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 62, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
337679872
import pygame as pg import random, math pg.init() WIDTH, HEIGHT = 500, 500 WIN = pg.display.set_mode((WIDTH, HEIGHT)) BLACK = 0, 0, 0 WHITE = 255, 255, 255 RED = 255, 0, 0 GREEN = 0, 255, 0 BLUE = 0, 0, 255 YELLOW = 255, 255, 0 FPS = 60 NB_CIVS = 10 NB_STARS = 5 class Civ: def __init__(self, pos, classe=1, color=...
null
_Old_PygameModel/signal-cercle.py
signal-cercle.py
py
3,624
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 7, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.draw.circ...
216828049
import sklearn from sklearn.datasets import make_regression, make_classification from sklearn.linear_model import SGDRegressor, SGDClassifier import pandas as pd import numpy as np import SPEC from scipy import stats from sklearn.metrics.pairwise import rbf_kernel from sklearn.mixture import BayesianGaussianMixture ...
null
saliency/ogfs_classifier.py
ogfs_classifier.py
py
9,060
python
en
code
null
code-starcoder2
76
[ { "api_name": "SPEC.similarity_classification", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "sklearn.mixt...
606609541
# Copyright 2017 Google Inc. 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 applicable law or a...
null
tensorflow_transform/impl_helper_test.py
impl_helper_test.py
py
25,695
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.python.framework.test_util.TensorFlowTestCase", "line_number": 40, "usage_type": "attribute" }, { "api_name": "tensorflow.python.framework.test_util", "line_number": 40, "usage_type": "name" }, { "api_name": "tensorflow_transform.tf_metadata.dataset_sche...
480024205
try: import pptx except ModuleNotFoundError as e: Warning( "Please install python-pptx for Powerpoint " "reports. - conda install python-pptx" ) raise e from tigerml.core.utils import slugify from .lib import create_ppt_report from .Report import PptReport, Section from .Slide import Sl...
null
src/ta_lib/_vendor/tigerml/core/reports/ppt/__init__.py
__init__.py
py
704
python
en
code
null
code-starcoder2
76
[ { "api_name": "pptx.Presentation", "line_number": 15, "usage_type": "call" }, { "api_name": "tigerml.core.utils.slugify", "line_number": 24, "usage_type": "call" }, { "api_name": "tigerml.core.utils.slugify", "line_number": 25, "usage_type": "call" } ]
302580967
from copy import deepcopy import numpy as np import pandas as pd from sklearn.metrics import matthews_corrcoef from sklearn.model_selection import StratifiedKFold from sklearn.preprocessing import MinMaxScaler from sklearn.svm import SVC from .constants import RANDOM_STATE class GOA_SVM: ID_POS = 0 # Position ...
null
apps/goa_svm.py
goa_svm.py
py
7,333
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 26, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.MinMaxScaler", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.rand...
322875852
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
null
2019/finals/crypto-vmac/vmac64.py
vmac64.py
py
4,341
python
en
code
null
code-starcoder2
76
[ { "api_name": "cryptography.hazmat.primitives.ciphers.Cipher", "line_number": 54, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.ciphers.algorithms.AES", "line_number": 54, "usage_type": "call" }, { "api_name": "cryptography.hazmat.primitives.ciphers.algori...
639108513
#!/usr/bin/env python from django.conf import settings def filter(request): context_extras = {} return context_extras def menu(request): parts = request.META["PATH_INFO"][1:].split('/', 3) cur_appname = 'Unknown' cur_action = 'Unknown' if len(parts) == 2: (cur_appname, cur_...
null
src/levis/context_processors.py
context_processors.py
py
790
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings.MENU_TREE", "line_number": 21, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 21, "usage_type": "name" } ]
374726297
import sys import logging import datetime from src.helpers import utils # Creating a Custom Logger for logging the process # def setup_custom_logger(name): class ContextFilter(logging.Filter): def filter(self, record): record.memcalc = utils.memcalc() record.cpucalc = utils.cpucalc(...
null
src/helpers/logger.py
logger.py
py
877
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.Filter", "line_number": 10, "usage_type": "attribute" }, { "api_name": "src.helpers.utils.memcalc", "line_number": 12, "usage_type": "call" }, { "api_name": "src.helpers.utils", "line_number": 12, "usage_type": "name" }, { "api_name": "src.h...
652809159
from glob import glob path = './' list_im = glob(path + '*.jpg') list_im from PIL import Image rm_img = [] for img in list_im: try: org = Image.open(img) except: rm_img.append(img) for i in rm_img: try: os.remove(i) except: print(i) print("File Removed!")
null
bad_image.py
bad_image.py
py
320
python
en
code
null
code-starcoder2
76
[ { "api_name": "glob.glob", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 12, "usage_type": "name" } ]
522118666
"""Simple excel report drawing framework The main idea here is to have a plotter-like object (called a drawer), that moves through an excel sheet matrix and draws objects that are supplied to it. """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use consistent encoding fro...
null
setup.py
setup.py
py
2,056
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "codecs.open", "line_numbe...
359652036
import getpass import os from pathlib import Path import urllib.parse import appdirs from .utils import ( client_and_path_from_uri, client_from_catalog, handle_error, ) DEFAULT_TOKEN_CACHE = os.getenv( "TILED_TOKEN_CACHE", os.path.join(appdirs.user_config_dir("tiled"), "tokens") ) def _token_direc...
null
tiled/client/authentication.py
authentication.py
py
6,222
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.getenv", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "appdirs.user_config_dir", "li...
66591771
""" Script to illustrate the result of the CNN on one example. """ #Choose number of training samples used to build the CNN. The CNN has to be trained beforehand Ntrain = 10000 import numpy as np import os import matplotlib.pyplot as plt from keras.datasets import mnist from keras import models fileModel = "Mnist_mo...
null
Mnist_example.py
Mnist_example.py
py
1,352
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 22, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 22, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.imshow", "line_number": 25, "usage_type": "call" }, { "api_...
269464104
import cv2 import numpy as np from matplotlib import pyplot as plt from argparse import ArgumentParser # module pour utiliser une ligne pour taper les arguments d'un fichier sur le terminal parser = ArgumentParser() parser.add_argument(dest="video", type=int, help="video d'entrée") input_args = parser.parse_args() vid...
null
TP2/Validation/SaveImgfromVideos.py
SaveImgfromVideos.py
py
1,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 15, "usage_type": "call" }, { "api_name": "cv2.VideoCap...
140660256
from unittest import TestCase from yanother.higher.fnot import fnot, fnot_tracable from itertools import product from operator import eq, ne class T(TestCase): def test(self): ab = 0, 1 feed = tuple(product(ab, ab)) def expected(): for op in eq, ne: for a, b i...
null
ztest/higher/fnot.py
fnot.py
py
676
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "itertools.product", "line_number": 11, "usage_type": "call" }, { "api_name": "operator.eq", "line_number": 14, "usage_type": "name" }, { "api_name": "operator.ne", "lin...
109282942
#!/usr/bin/env python """ The main module file that will be invoked by the one line installer. Usage: gather_metrics [operating system(DEBIAN|REDHAT)] log file] If log file is provided, then errors will be logged to such file. Otherwise, all errors will be flushed. It first checks the dependency this module needs. D...
null
python_installer/gather_metrics.py
gather_metrics.py
py
11,756
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 37, "usage_type": "attribute" }, { "api_name": "install_utils.print_step", "line_number": 38, "usage_type": "call" }, { "api_name": "sys.stderr.write", "line_number": 40, "usage_type": "call" }, { "api_name": "sys.s...
436649654
import tensorflow as tf import collections import numpy def loadData(datapath, labelpath,classnum=100): bookvecs = [] labels = [] id2index = dict() index2id = dict() with tf.gfile.FastGFile(labelpath) as f: lines = f.readlines(); marks = [] for line in lines: l...
null
huaben/bookmark/data_set.py
data_set.py
py
5,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.gfile.FastGFile", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.gfile", "line_number": 12, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 20, "usage_type": "call" }, { "api_name": "...
116800203
import os import cv2 import numpy as np from keras import Sequential from keras.layers import Conv2D, MaxPooling2D, BatchNormalization, Flatten, Dense, Activation, Dropout from keras.optimizers import SGD from keras.utils import np_utils from sklearn.metrics import accuracy_score from sklearn.preprocessing import Labe...
null
neural_network.py
neural_network.py
py
2,823
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.Sequential", "line_number": 14, "usage_type": "call" }, { "api_name": "keras.layers.Conv2D", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.layers.MaxPooling2D", "line_number": 16, "usage_type": "call" }, { "api_name": "keras....
57073359
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import mptt.fields import core.models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] op...
null
project/core/migrations/0001_initial.py
0001_initial.py
py
3,429
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 10, "usage_type": "name" }, { "api_name": "django.db.migrations.swappable_dependency", "line_number": 13, "usage_type": "ca...
392364257
# ========================================== # Title: Model Learning Code # Author: Yash Trikannad # ========================================== import tensorflow as tf import numpy as np import gym class Model: """ Learns a model of an environment using a DNN for function approximation. Data is collecte...
null
model_learning.py
model_learning.py
py
13,824
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 23, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 37, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 37, "usage_type": "attribute" }, { "api_name": "tensorflow.ge...
517806384
from setuptools import setup, find_namespace_packages from pathlib import Path ROOT = Path(__file__).resolve().parent with open(ROOT / 'README.md', 'r') as readme: long_description = readme.read() exec(open(ROOT / 'dmod/requestservice/_version.py').read()) setup( name='dmod-requestservice', version=__ve...
null
python/services/requestservice/setup.py
setup.py
py
701
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "setuptools.find_namespace_packages", "line_number": 22, "usage_type": "call" } ]
85868690
import json import requests import datetime from weather_report_base import WeatherReportBase from engine.private_data import PrivateData from watering_response import WateringResponse class WeatherReportCurrent(WeatherReportBase): def __init__(self, successor, logger): super(WeatherReportCurrent, self...
null
src/server/engine/weather/weather_report_current.py
weather_report_current.py
py
1,850
python
en
code
null
code-starcoder2
76
[ { "api_name": "weather_report_base.WeatherReportBase", "line_number": 8, "usage_type": "name" }, { "api_name": "engine.private_data.PrivateData", "line_number": 11, "usage_type": "call" }, { "api_name": "watering_response.WateringResponse", "line_number": 19, "usage_type"...
337911035
""" Написать функцию host_range_ping_tab(), возможности которой основаны на функции из примера 2. Но в данном случае результат должен быть итоговым по всем ip-адресам, представленным в табличном формате (использовать модуль tabulate). Таблица должна состоять из двух колонок """ from tabulate import tabulate from task_...
null
lessons/lesson01/task_3.py
task_3.py
py
2,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "task_2.host_range_ping", "line_number": 16, "usage_type": "call" }, { "api_name": "tabulate.tabulate", "line_number": 19, "usage_type": "call" } ]
29940419
from datetime import datetime, timedelta def check_time(date_time, format_str): if datetime.now().time() > datetime.strptime(date_time, format_str).time(): return True else: return False def check_date(date_str, format_str): if datetime.now().date() == datetime.strptime(date_str, format_...
null
utilities/DateHelpers.py
DateHelpers.py
py
626
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 5, "usage_type": "call" }, { "api_name": "datet...
633837950
# -*- coding: utf-8 -*- """ Created on Mon Jun 4 12:10:26 2018 @author: marcu """ ''' This corpus contains a metadata-rich collection of fictional conversations extracted from raw movie scripts: - 220,579 conversational exchanges between 10,292 pairs of movie characters - involves 9,035 characters from 617 movies -...
null
Marcus/Movies_sentiment.py
Movies_sentiment.py
py
13,788
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.asarray", "line_number": 109, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 116, "usage_type": "call" }, { "api_name": "keras.layers.Embedding", "line_number": 125, "usage_type": "call" }, { "api_name": "pandas.read_excel...
96248084
#To dump the json into files import json #To execute the main shell script (main.sh) import subprocess from AzureSite.settings import BASE_DIR import logging import os logger = logging.getLogger(__name__) logger.error(BASE_DIR) list_json=["arima","prophet","holtwinter","lstm","xgboost","operational_research","os","tim...
null
SupplyChain/databricks_linux/databricks.py
databricks.py
py
2,311
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "AzureSite.settings.BASE_DIR", "line_number": 9, "usage_type": "argument" }, { "api_name": "AzureSite.settings.BASE_DIR", "line_number": 55, "usage_type": "name" }, { "api_n...
516861071
# -*- coding: utf-8 -*- __version__ = '0.1.4' __author__ = 'Ossama Edbali (ossedb@gmail.com)' import os import datetime import json import shutil import pytz from pathlib import Path from slugify import slugify from .utils import copy_directory from .pylog import action from .utils import parse_metadata from .reader...
null
statico/contents.py
contents.py
py
6,864
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.date.today", "line_number": 23, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 23, "usage_type": "attribute" }, { "api_name": "slugify.slugify", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join",...
322516146
import os import time import json import hashlib import boto3 from pympler import asizeof from .dynamodb_table import DynamodbTable EXPIRATION_DELAY = 6 * 24 * 3600 # we set expiration time to 6 days # because it will be removed between +1/+2 days of expiration so 7/8 days MAX_ITEMS_SIZE = (400 * (10 ** 3)) MAX_ITEMS...
null
artefact/connectors/kinesis/api/digest_table.py
digest_table.py
py
5,697
python
en
code
null
code-starcoder2
76
[ { "api_name": "dynamodb_table.DynamodbTable", "line_number": 19, "usage_type": "name" }, { "api_name": "time.time", "line_number": 24, "usage_type": "call" }, { "api_name": "pympler.asizeof.asizeof", "line_number": 42, "usage_type": "call" }, { "api_name": "pymple...
81690254
from typing import Dict, List, Optional, Type import kubernetes from kubernetes.client import V1beta1CronJob, V1Deployment, V1StatefulSet from loguru import logger from streams_explorer.core.config import settings from streams_explorer.core.k8s_app import K8sApp from streams_explorer.core.node_info_extractor import (...
null
backend/streams_explorer/streams_explorer.py
streams_explorer.py
py
7,920
python
en
code
null
code-starcoder2
76
[ { "api_name": "streams_explorer.core.config.settings.k8s", "line_number": 28, "usage_type": "attribute" }, { "api_name": "streams_explorer.core.config.settings", "line_number": 28, "usage_type": "name" }, { "api_name": "streams_explorer.core.config.settings.k8s", "line_number...
520976822
import cv2 import numpy as np import time import sys from imutils import face_utils from face_utilities import Face_utilities from signal_processing import Signal_processing from collections import OrderedDict def draw_poly(bg, shape, pts, color): poly = np.array([[shape[pts[0]][0],shape[pts[1]][1]],[s...
null
Heart-rate-measurement-using-camera-master/Heart-rate-measurement-using-camera-master/new_update/ROIs_selection.py
ROIs_selection.py
py
2,553
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.int32", "line_number": 13, "usage_type": "attribute" }, { "api_name": "cv2.fillPoly", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.OrderedDict", ...
14879168
from math import inf from keras.layers import Input, Dense, Conv2D, MaxPooling2D, Flatten, Dropout, Embedding, Reshape from keras.models import Model from keras.optimizers import Adam from development.BioNer.nen.auto_encoder import helpers from development.BioNer.nen.auto_encoder.constants import * from development.Bi...
null
nen/auto_encoder/models.py
models.py
py
6,890
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.inf", "line_number": 64, "usage_type": "name" }, { "api_name": "development.BioNer.nen.auto_encoder.helpers.display_history", "line_number": 81, "usage_type": "call" }, { "api_name": "development.BioNer.nen.auto_encoder.helpers", "line_number": 81, "us...
91003353
""" Copyright 2021 Lukas Kreisköther Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
null
SPACE/random_concept_building.py
random_concept_building.py
py
5,869
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 57, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 58, "usage_type": "call" }, { "api_name": "os.path", "line_number": 58, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number":...
329955339
from matplotlib import pyplot as plt import pickle import math with open("attr.pkl", "rb") as f: attrList = pickle.load(f) # Histogram # tags tagMap = {} tagList = [] tagNum = [] for i in attrList: tags = i["tags"] for j in tags: if not j in tagMap: tagMap[j] = len(tagList) ...
null
lab2/tags.py
tags.py
py
510
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 6, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
608149261
from typing import List import os import subprocess from subprocess import TimeoutExpired import uuid import shutil import tarfile from datetime import datetime from flask import ( Blueprint, current_app as flask_app, render_template, request, g) from werkzeug.utils import secure_filename from model...
null
app/projects.py
projects.py
py
7,957
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 46, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 46, "usage_type": "name" }, { "api_name": "flask.g.auth"...
608390613
# License: BSD 3 clause import unittest import numpy as np from scipy.sparse import csr_matrix from tick.linear_model import SimuLinReg, ModelLinReg from tick.base_model.tests.generalized_linear_model import TestGLM class ModelLinRegTest(object): def test_ModelLinReg(self): """...Numerical consistency ...
null
tick/linear_model/tests/model_linreg_test.py
model_linreg_test.py
py
3,504
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random",...
560943842
# Standard imports import numpy as np import matplotlib.pyplot as plt # Compute the predicted values def hypothesis(weights,input_x): # Weights = (n+1)x1, n - degree of polynomial # input_x = m x (n+1), m - no. of points # Output = m x 1 - predicted values for each example result = np.matmul(input_x,weights) retu...
null
Assignment 1 LR/Problem 2/question2.py
question2.py
py
2,578
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.matmul", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.multiply", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_...
455742798
import datetime import pendulum import pytest import prefect from prefect.engine.signals import ( FAIL, LOOP, PAUSE, RETRY, SKIP, SUCCESS, TRIGGERFAIL, VALIDATIONFAIL, PrefectStateSignal, signal_from_state, ) from prefect.engine.state import ( Failed, Looped, Paused...
null
tests/engine/test_signals.py
test_signals.py
py
3,818
python
en
code
null
code-starcoder2
76
[ { "api_name": "prefect.engine.signals.PrefectStateSignal", "line_number": 34, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 40, "usage_type": "call" }, { "api_name": "prefect.exceptions.PrefectSignal", "line_number": 40, "usage_type": "argument" ...
568222446
import urllib, json, urllib.request import pprint from openpyxl import Workbook import socket # Chengdu 2158433 # Brisbane 1100661 # Melbourne 1103816 # New York 2459115 # Sydney 1105779 cities = [ 'Brisbane', 'Chengdu', 'Melbourne', 'New York', 'Sydney' ] woeids = [ 1100661, 2158433,...
null
weather.py
weather.py
py
2,853
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.parse.urlencode", "line_number": 32, "usage_type": "call" }, { "api_name": "urllib.parse", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pprint.pprint", "line_number": 33, "usage_type": "call" }, { "api_name": "urllib.request...
187757837
from numpy import genfromtxt import numpy as np from scipy import optimize # loosely adopted from Welch labs tutorial class NeuralNetwork(object): def __init__(self): #Define Hyperparameters self.inputLayerSize = 7 self.hiddenLayerSize = 3 self.outputLayerSize = 1 ...
null
business/regression.py
regression.py
py
5,246
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.randn", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "numpy.random.randn", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random"...
594039196
""" Demonstration of the GazeTracking library. Check the README.md for complete documentation. """ import cv2 from gaze_tracking import GazeTracking from Drowsiness_Detection import DrowsinessDetection from scipy.spatial import distance from imutils import face_utils from imutils.video import VideoStream from threadin...
null
example.py
example.py
py
6,498
python
en
code
null
code-starcoder2
76
[ { "api_name": "gaze_tracking.GazeTracking", "line_number": 21, "usage_type": "call" }, { "api_name": "Drowsiness_Detection.DrowsinessDetection", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 23, "usage_type": "call" }, { ...
610160430
# Copyright (c) 2018 Rolls-Royce Power Systems AG. All rights reserved. import logging import json import os from hashlib import md5 as hashlib_md5 from concurrent.futures import ThreadPoolExecutor from base64 import b64decode from binascii import Error as binascii_Error import requests from IoticAgent i...
null
__offline/__Digital_Twin/__release2/__release2_sprint2/impl/impl_docu.py
impl_docu.py
py
9,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 29, "usage_type": "call" }, { "api_name": "ioticlabs.dt.api.integrator.IntegratorCallbacks", "line_number": 32, "usage_type": "name" }, { "api_name": "IoticAgent.ThingRunner", "line_number": 32, "usage_type": "name" }, ...
404810460
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.macosx-10.7-x86_64/egg/notekeras/model/yolo.py # Compiled at: 2020-03-29 10:33:01 # Size of source mod 2**32: 29919 bytes import os, random, cv2, nump...
null
pycfiles/notekeras-0.0.8-py3.7/yolo.cpython-37.py
yolo.cpython-37.py
py
27,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "tensorflow.keras.layers.Input", "line_number": 42, "usage_type": "call" }, { "api_name": "notekeras.compo...
468392012
import os from flask import Flask, Request, render_template, request from pyfiglet import Figlet ENVIRONMENT = os.environ.get("ENVIRONMENT", "Localhost") # where the app is running app = Flask("7apps") fmt = Figlet(font="slant") # render our greeting in a fancy ascii font def greeting(req: Request): name = r...
null
app/main.py
main.py
py
683
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ.get", "line_number": 6, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 6, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "pyfiglet.Figlet", "line_n...
468753397
#!/usr/bin/env python # PySys System Test Framework, Copyright (C) 2006-2018 M.B.Grieve # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your ...
null
pysys/process/user.py
user.py
py
35,314
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.namedtuple", "line_number": 32, "usage_type": "call" }, { "api_name": "pysys.log", "line_number": 56, "usage_type": "name" }, { "api_name": "time.time", "line_number": 162, "usage_type": "call" }, { "api_name": "pysys.process.helper.Proc...
270365995
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################################################################################### #Copied for Dash: # Basics Requirements import pathlib import os import dash from dash.dependencies import Input, Output, State, Client...
null
app/index_h.py
index_h.py
py
9,426
python
en
code
null
code-starcoder2
76
[ { "api_name": "dash_bootstrap_components.NavItem", "line_number": 42, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.NavLink", "line_number": 42, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.Navbar", "line_number": 43, "usage_type": "...
301396889
from django.db import models from django.core import validators from django.contrib.auth.models import (PermissionsMixin, AbstractBaseUser, UserManager) import re class User(AbstractBaseUser, PermissionsMixin): username = models.CharField( max_length = 255, unique = True, validators = [...
null
app/models.py
models.py
py
3,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.auth.models.AbstractBaseUser", "line_number": 7, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.PermissionsMixin", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usa...
521745461
import sys, re, pymongo from pprint import pprint client = pymongo.MongoClient (host="da0.eecs.utk.edu") # Define the source and target collections source = client['test']['repos'] target = client['ossfinder']['repositories'] # Query setup minForks = 20 minWatchers = 20 skip = 0 limit = 500 count = 4 total = 0 query...
null
data-discovery/repos-transfer.py
repos-transfer.py
py
1,301
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 4, "usage_type": "call" } ]
276864542
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('users', '0016_member_source_website'), ] operations = [ migrations.AlterField( model_name='member', ...
null
grh/users/migrations/0017_auto_20150212_0504.py
0017_auto_20150212_0504.py
py
635
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
444126394
# Built-in packages import time # ASE from ase import Atoms from ase.io import read, write from ase.parallel import world # GPAW from gpaw import GPAW from gpaw.tddft import * # Load the ground state calculator from task1 td_calc = TDDFT('../task1/groundCalc.gpw') # Set up time propagation DFT time_step = 30 # 30 ...
null
computational_materials_and_molecular_physics/HW4/task4/task4.py
task4.py
py
1,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "ase.parallel.world.rank", "line_number": 25, "usage_type": "attribute" }, { "api_name": "ase.parallel.world", "line_number": 25, "usage_type": "name" }, { "api_name": "time.time", "line_number": 27, "usage_type": "call" }, { "api_name": "ase.paralle...
172932498
# -*- coding: utf-8 -* #rid 51 STP import xlsxwriter from io import BytesIO import datetime from .. import stp_config def form_url(params): base_url = str(stp_config.CONST.API_URL_PREFIX) + 'stp_contractor_plant_tree/' base_url += str(params["year"]) return base_url #Contractor Plants Trees def render(res, params...
null
stp/report_classes/stp_cpt.py
stp_cpt.py
py
3,947
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.BytesIO", "line_number": 22, "usage_type": "call" }, { "api_name": "xlsxwriter.Workbook", "line_number": 23, "usage_type": "call" } ]
262287974
# pylint: disable=missing-module-docstring # pylint: disable=missing-function-docstring # pylint: disable=missing-class-docstring # pylint: disable=unused-argument # pylint: disable=arguments-differ # pylint: disable= expression-not-assigned from django.contrib import admin from django.template import loader from djan...
null
B7FunDjango/chat/admin.py
admin.py
py
3,430
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 17, "usage_type": "name" }, { "api_name": "django.contrib.admin.register", "line_number": 16, "usage_type": "call" }, ...
631180112
import socket import threading import time import queue from irc.config import NICK, CHANNEL, PASSWORD _wait = .01 class IRC(object): """A simple IRC interface that can handle simultaneous reading and writing. Its interface is similar to those in the io module.""" def __init__(self, nick=NICK, channel=...
null
irc/simple_twitch_irc.py
simple_twitch_irc.py
py
6,353
python
en
code
null
code-starcoder2
76
[ { "api_name": "irc.config.NICK", "line_number": 15, "usage_type": "name" }, { "api_name": "irc.config.CHANNEL", "line_number": 15, "usage_type": "name" }, { "api_name": "irc.config.PASSWORD", "line_number": 15, "usage_type": "name" }, { "api_name": "queue.Queue", ...
361392323
__author__ = 'spacegoing' ## import pickle from ModelUtils.measures import getAllMeasures, getMeasureCombo, comp_F1_Score from sklearn.metrics import confusion_matrix from itertools import combinations from ModelUtils.trainModel import getDocIndexScoreInfo, getTrainSet from DataMisc.contestParameters import loadTrainLa...
null
src/ALTA2015/ModelUtils/featuresSelection.py
featuresSelection.py
py
3,807
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.combinations", "line_number": 39, "usage_type": "call" }, { "api_name": "ModelUtils.measures.getAllMeasures", "line_number": 70, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 79, "usage_type": "call" }, { "api_name": ...
483891921
import logging as log # 方法名称:init # 描述:此方法主要进行初始化缓存信息 def init(): global _cache _cache = dict() _cache['A'] = dict() _cache['PTR'] = dict() _cache['NS'] = dict() _cache['AAAA'] = dict() # 方法名称:_getValue def _getValue(_type, _key): return _cache[_type][_key] # 方法名称:_getValue def _setVal...
null
packet/cache.py
cache.py
py
709
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.info", "line_number": 23, "usage_type": "call" } ]
605826269
#!/usr/bin/python3 # -*- coding: utf-8 -*- ### BEGIN LICENSE # Copyright (C) 2021 KylinSoft Co., Ltd. # # Authors: # Yang Min yangmin@kylinos.cn # # 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 F...
null
kyasDbus/systemdaemon/kacdrominfo.py
kacdrominfo.py
py
5,254
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.Popen", "line_number": 46, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 46, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 50, "usage_type": "call" }, { "api_name": "json.dumps", "li...
112705617
import mysql.connector from datetime import datetime class DBWorker(): # connection = mysql.connector.connect(user='root', password='root', # host='localhost', # database='csgostats', # auth_plugin='my...
null
DBWorker.py
DBWorker.py
py
5,095
python
en
code
null
code-starcoder2
76
[ { "api_name": "mysql.connector.connector.connect", "line_number": 9, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 9, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 9, "usage_type": "name" }, { "api...
58512353
import substeps import util import numpy as np # import matplotlib # matplotlib.use('TkAgg') import matplotlib.animation as animate import matplotlib.pyplot as plt import plotting_utls as pltuls import time import sys # ========== # This piece is for testing the entire updating process (shifts, coefficients, Ws) # ...
null
muscle_synergies/test_all_parts_20.py
test_all_parts_20.py
py
9,343
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.uniform", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.random.uniform", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.ran...
196020664
from fnc_config import FNCConfig from tabulate import tabulate import re import csv import os from pprint import pprint import argparse def parseNumList(string): return sum((_parse(s) for s in string.split(',')), []) def _parse(string): m = re.match(r'(\d+)(?:-(\d+))?$', string) # ^ (or use .split('-'). ...
null
show.py
show.py
py
5,092
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.match", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.ArgumentTypeError", "line_number": 17, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 22, "usage_type": "call" }, { "api_name": "fnc_confi...
498747240
"""Add a name column on NodePoolPolicy Revision ID: a4d56bb32148 Revises: 5e96c3b8d67d Create Date: 2016-10-02 11:04:43.471850 """ # revision identifiers, used by Alembic. revision = 'a4d56bb32148' down_revision = '5e96c3b8d67d' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa ...
null
oasis/db/sqlalchemy/alembic/versions/a4d56bb32148_add_a_name_column_on_nodepoolpolicy.py
a4d56bb32148_add_a_name_column_on_nodepoolpolicy.py
py
689
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
182198556
# Definition of the nets for Critic and Actor # hyper-parameters # - [The final layer weights and biases of both the actor and critic were initialized # from a uniform distribution [−3×10−3, 3×10−3]]ddpg.p. # - [Other layers were initialized from uniform distributions [−1/√f , 1/√f] where f is the fan-in of the lay...
null
p3_collab-compet/src_draft_maddpg/networkforall.py
networkforall.py
py
1,794
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_...
600897073
from moviepy.editor import VideoFileClip import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import cv2 import glob import time from sklearn.svm import LinearSVC from sklearn.preprocessing import StandardScaler from skimage.feature import hog from sklearn.model_selection import...
null
Features.py
Features.py
py
25,515
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 17, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.histogram", "line_number...
407998300
from __future__ import print_function import numpy as np np.random.seed(1234) from keras.datasets import mnist, cifar10 from keras.models import Sequential from keras.callbacks import History from keras.models import Model from keras.layers import Convolution2D, MaxPooling2D, AveragePooling2D, Input, ZeroPadding2D fro...
null
sanity.py
sanity.py
py
9,691
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.setrecursionlimit", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.dataset...
389008855
"""Defines a node for the docstring AST.""" from collections import deque from enum import Enum from typing import ( # noqa: F401 Any, List, Iterator, Tuple, Optional, ) from .token import ( # noqa: F401 Token, ) class NodeType(Enum): """The type of node in a docstring.""" # Non-Te...
null
darglint/node.py
node.py
py
6,478
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "token.line_number", "line_number": 87, "usage_type": "attribute" }, { "api_name": "token.line_number", "line_number": 88, "usage_type": "attribute" }, { "api_name": "collections.d...
499928694
from __future__ import print_function import os import cv2 from models import * import torch import numpy as np import time import math from data.dataset import * from torch.nn import DataParallel import matplotlib.pyplot as plt def cosin_metric(x1, x2): """ 求两向量的cosin夹角 :param x1: :param x2: :ret...
null
in_pytorch/MobileNetV3_MixNet/verify.py
verify.py
py
4,712
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.dot", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linalg.norm", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 21, "usage_type": "attribute" }, { "api_name": "math.acos", "line_n...
88830879
import json from flask import session, redirect, url_for, render_template, flash, request from .blueprint import demo_blueprint from app.models import Subdomain from app.demo.forms import CategoriesForm @demo_blueprint.route("/categories", methods=["GET", "POST"]) def categories(): form = CategoriesForm(request.f...
null
app/demo/views/categories.py
categories.py
py
1,337
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.demo.forms.CategoriesForm", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 10, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 10, "usage_type": "name" }, { "api_name": "f...
167020556
from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect from django.urls import reverse from django.template.loader import render_to_string # Create your views here. monthly_challenges = { "january": "Eat no meat", "february": "Walk for 20 mins every...
null
session_templates/monthly_challenge/challenges/views.py
views.py
py
1,458
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 25, "usage_type": "call" }, { "api_name": "django.http.HttpResponseNotFound", "line_number": 32, "usage_type": "call" }, { "api_name": "django.urls.reverse", "line_number": 34, "usage_type": "call" }, { "api_...
642423683
"""WConsole class.""" from PyQt5 import QtWidgets, QtCore, QtGui import matplotlib import matplotlib.pyplot as plt from cryspy_editor.widgets.matplotlib import Graph class WOutput(QtWidgets.QScrollArea): """WFunction class.""" def __init__(self, parent=None): super(WOutput, self).__init__(parent) ...
null
cryspy_editor/widgets/w_output.py
w_output.py
py
2,671
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QScrollArea", "line_number": 7, "usage_type": "attribute" }, { "api_name": "PyQt5.QtWidgets", "line_number": 7, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 15, "usage_type": "call" }, { "api_name": ...
528825953
# this file is responsible to describe the methods import bot.booking.constants as const import os from selenium import webdriver from bot.booking.booking_filtration import BookingFiltration from bot.booking.booking_report import BookingReport from prettytable import PrettyTable class Booking(webdriver.Chrome): ...
null
booking/booking.py
booking.py
py
3,879
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 11, "usage_type": "attribute" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "bot...
253675878
import datetime from pathlib import Path import click import h5py import numpy as np import pandas as pd import torch import torch.optim as optim from sklearn.metrics import roc_auc_score from torch.nn.modules.distance import PairwiseDistance from torch.utils.data import DataLoader from torch.utils.tensorboard import ...
null
indoorhack/tasks/train.py
train.py
py
6,435
python
en
code
null
code-starcoder2
76
[ { "api_name": "indoorhack.pipelines.pipeline", "line_number": 38, "usage_type": "call" }, { "api_name": "datetime.datetime.utcnow", "line_number": 40, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 40, "usage_type": "attribute" }, { "api...
236351207
import tensorflow as tf import numpy as np from helper import MNIST from matplotlib import pyplot as plt from layers import feed_forward_layer, conv_layer def get_siamnese(X): """ creates the siamnese stem for the neural network. This is the part both images are send through sequentially :param X: the inpu...
null
simnet_MNIST.py
simnet_MNIST.py
py
6,651
python
en
code
null
code-starcoder2
76
[ { "api_name": "tensorflow.variable_scope", "line_number": 13, "usage_type": "call" }, { "api_name": "layers.conv_layer", "line_number": 14, "usage_type": "call" }, { "api_name": "tensorflow.nn", "line_number": 14, "usage_type": "attribute" }, { "api_name": "tensor...
251066451
import time import threading import os from multiprocessing import Process """ $ time python multi-processing.py ID of process running main program: 2344 Main thread name: MainThread Waiting for processes to finish Dispatcher thread name: MainThread ID of process running dispatcher thread: 2345 Dispatcher thread nam...
null
projects/concurrency-app/multi-processing.py
multi-processing.py
py
1,178
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.sleep", "line_number": 26, "usage_type": "call" }, { "api_name": "threading.current_thread", "line_number": 30, "usage_type": "call" }, { "api_name": "os.getpid", "line_number": 31, "usage_type": "call" }, { "api_name": "os.getpid", "line_n...
155273178
""" 12/11/2019 premiere version de l'import general deve : Mahli concu initialement pour l'architecture general c'est fonction est une fonction de gestion des ressources fichiers, qui ne prend que tres peux sur le cpu et le gpu. Elle a pour but d'eviter et de cibler les problemes qui pourraient-etre liés a tel ...
null
Main.py
Main.py
py
4,509
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.image.load", "line_number": 76, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 76, "usage_type": "attribute" }, { "api_name": "pygame.error", "line_number": 78, "usage_type": "attribute" }, { "api_name": "pygame.image.lo...
157930769
# 816000772 # Christopher Sahadeo # christophersahadeo@gmail.com import collections from collections import deque import read_edgelist import pprint pp = pprint.PrettyPrinter(indent=4) def printLists(iteration_number, open, closed): print('{}. open = {}; closed = {}'.format(iteration_number, open, closed)) de...
null
Assignments/Assignment_1/dfs.py
dfs.py
py
2,229
python
en
code
null
code-starcoder2
76
[ { "api_name": "pprint.PrettyPrinter", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" }, { "api_name": "read_edgelist.read", "line_number": 72, "usage_type": "call" } ]
390615374
import urllib.request import json import sys def get_json(url): resposta = urllib.request.urlopen(url) json_string = resposta.read().decode('utf-8') json_obj = json.loads(json_string) return json_obj if '--h' in sys.argv: print("\nUSE:\n\tfb_comment_mining facebook_page [tags]\n\n" + "where\n\tfacebook_page\t...
null
fb_comment_mining.py
fb_comment_mining.py
py
2,776
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.request.request.urlopen", "line_number": 6, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 6, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 6, "usage_type": "name" }, { "api_name":...
617805744
import scrapy import json class ND_spider(scrapy.Spider): '''Queries the North Dakota Secy of State Business Search page and copies resulting info into JSON lines file. Expected usage: $ scrapy runspider nd_spider.py -a query=<str> -s FEED_URI=<filepath> ''' name = "ND_business_search" ...
null
nd_spider.py
nd_spider.py
py
1,924
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.http.JsonRequest", "line_number": 17, "usage_type": "call" }, { "api_name": "scrapy.http", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.loads...
344055889
#!/usr/bin/env python3 import os import time import datetime import paramiko # All the options for the job datasets = ['cifar10'] epochs = [300] nets = ['vgg16', 'alexnet', 'resnet34'] batch_sizes = [512] epsilon = ['1e-3'] bounds = [0.7] #bounds = [0] server = "login.dei.unipd.it" username = "stringherm" lr = 0.001 o...
null
scripts/cluster_SGE.py
cluster_SGE.py
py
3,496
python
en
code
null
code-starcoder2
76
[ { "api_name": "paramiko.SSHClient", "line_number": 24, "usage_type": "call" }, { "api_name": "paramiko.AutoAddPolicy", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", ...
26547088
# utils for contraction notebook import numpy as np from matplotlib import pyplot as plt def sim_sys(A, dt, x0, N): n = x0.shape[0] x = np.zeros((N, n)) x[0] = x0 for i in xrange(N-1): x[i+1] = A.dot(x[i]) * dt + x[i] return x def phase(A, x1lim=(-1., 1), x2lim=(-1., 1.), n1=20, n2=20, a...
null
slotine/utils/contraction.py
contraction.py
py
2,522
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_n...
239402404
import csv import itertools import os import pathlib import matplotlib.colors as mcolors import matplotlib.pyplot as plt import nashpy as nash import numpy as np import pandas as pd import ambulance_game as abg # from nashpy.algorithms.lemke_howson_lex import lemke_howson_lex def get_index_of_values(problem_parame...
null
data/game_data/nbs/main.py
main.py
py
27,786
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.isclose", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.isclose", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.isclose", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.isclose", "line_n...
470564062
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Nov 23 15:33:30 2017 @author: li """ #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Nov 23 14:12:40 2017 @author: li """ import torch import torch.utils.data as Data from torchsample import transforms as tensor_tf from skimage impor...
null
custom/custom_data_reflection_simulation.py
custom_data_reflection_simulation.py
py
4,533
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.stats.norm.cdf", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.stats.norm", ...
582611796
# -*- coding: utf-8 -*- """ smpa.models.core ~~~~~~~~~~~~~~~~ BaseModel class """ import json import arrow import datetime from importlib import import_module from schematics.models import Model, ModelMeta from schematics.transforms import blacklist from inflection import tableize, underscore from bson.ob...
null
app/smpa/models/core.py
core.py
py
7,798
python
en
code
null
code-starcoder2
76
[ { "api_name": "schematics.types.BaseType", "line_number": 30, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "lin...
156678976
""" anipotential.py: Implements the ANI potential function using TorchANI. This is part of the OpenMM molecular simulation toolkit originating from Simbios, the NIH National Center for Physics-Based Simulation of Biological Structures at Stanford, funded under the NIH Roadmap for Medical Research, grant U54 GM072970. ...
null
openmmml/models/anipotential.py
anipotential.py
py
5,521
python
en
code
null
code-starcoder2
76
[ { "api_name": "openmmml.mlpotential.MLPotentialImplFactory", "line_number": 40, "usage_type": "name" }, { "api_name": "openmmml.mlpotential.MLPotentialImpl", "line_number": 43, "usage_type": "name" }, { "api_name": "openmmml.mlpotential.MLPotentialImpl", "line_number": 47, ...
87179265
from dataContainers import * import psycopg2 import psycopg2.extras import datetime import logging import pickle import copy _logger = logging.getLogger() class PostgresWrapper(): def __init__(self, connectionString, force_quiet=False): self.connection_string = connectionString self.force_quiet ...
null
postgresWrapper.py
postgresWrapper.py
py
6,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 26, "usage_type": "call" }, { "api_name": "psycopg2.extras", "line_number": 27, "usage_type": "attribute" }, { "api_name": "psycopg2.Inte...
458324066
import json from flask import Flask, jsonify, url_for, request, render_template, redirect #import pyodbc as pyodbc app = Flask(__name__) with open('customers.json') as f: customers = json.load(f) @app.route('/', methods = ["GET", "POST"]) def home(): if request.method == "POST": kundnum...
null
app.py
app.py
py
857
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "json.load", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask.request", "li...