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
527140531
import re from django.shortcuts import render_to_response, RequestContext from django.db.models import Q from .models import Article stopwords = ['an', 'and', 'are', 'as', 'at', 'be', 'but', 'by', 'for', 'if', 'in', 'into', 'is', 'it', 'no', 'not', 'of', 'on', 'or', 's', 'such', 't', 'that', 'the', 'thei...
null
answers/views.py
views.py
py
2,294
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "django.db.models.Q", "line_number": 40, "usage_type": "call" }, { "api_name": "models.Article.objects.filte...
189912403
import sys from itertools import chain import xlrd def extract(filename): book = xlrd.open_workbook(filename, formatting_info=True) sheet = book.sheet_by_index(0) headers = [] j = 0 while True and j < 4: value = sheet.cell_value(2, 1 + j) if not value: break ...
null
extrator.py
extrator.py
py
894
python
en
code
null
code-starcoder2
76
[ { "api_name": "xlrd.open_workbook", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 46, "usage_type": "attribute" }, { "api_name": "itertools.chain", "line_number": 50, "usage_type": "call" } ]
56547224
from __future__ import print_function, division from keras.datasets import mnist from keras.layers import Input, Dense, Reshape, Flatten, Dropout from keras.layers import BatchNormalization, Activation, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolutional import UpSampl...
null
Application 1/dcgan.py
dcgan.py
py
8,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.optimizers.Adam", "line_number": 32, "usage_type": "call" }, { "api_name": "keras.layers.Input", "line_number": 44, "usage_type": "call" }, { "api_name": "keras.models.Model", "line_number": 56, "usage_type": "call" }, { "api_name": "keras.mod...
520370218
import enum import io import datetime import uuid from aiosmb.commons.utils.ts2dt import * from aiosmb.protocol.common import NegotiateDialects from aiosmb.wintypes.dtyp.constrcuted_security.guid import * # https://msdn.microsoft.com/en-us/library/cc246543.aspx class NegotiateSecurityMode(enum.IntFlag): SMB2_NEGOTI...
null
aiosmb/protocol/smb2/commands/negotiate.py
negotiate.py
py
13,645
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.IntFlag", "line_number": 12, "usage_type": "attribute" }, { "api_name": "enum.IntFlag", "line_number": 18, "usage_type": "attribute" }, { "api_name": "aiosmb.protocol.common.NegotiateDialects.SMB311", "line_number": 53, "usage_type": "attribute" }, ...
329551880
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from fixture.session import SessionHelper class Application: def __init__(self, browser, config): if brows...
null
fixture/application.py
application.py
py
1,140
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 15, "usage_type": "name" }, { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 17, "usage_type": "call" }, { "ap...
53350901
from requests import Session import math from tqdm import tqdm from urllib.parse import urlencode class MagicTheGatheringAPI: def __init__(self): self.protocol = 'https' self.domain = 'api.magicthegathering.io' self.requests_session = Session() def get_sets(self): return self...
null
src/etl/extract_cards/magic_the_gathering_api.py
magic_the_gathering_api.py
py
1,239
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 12, "usage_type": "call" }, { "api_name": "math.ceil", "line_number": 21, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 23, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", "li...
472281400
import numpy as np from scipy import io import pickle from collections import OrderedDict def main(): dict_file = './pickles/knock90_idx_t' with open(dict_file, 'rb') as f: t_dict = pickle.load(f) matrix_file = 'knock90_300' matrix_name = 'knock90_300' matrix = io.loadmat(matrix_file)[mat...
null
hwichan/chapter10/knock96.py
knock96.py
py
1,082
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 10, "usage_type": "call" }, { "api_name": "scipy.io.loadmat", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.io", "line_number": 14, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "...
39102478
import gym import pickle import os import numpy as np import random import time import traceback import math import tensorflow as tf from keras.optimizers import Adam from keras.models import Model from keras.layers import * from keras import backend as K import multiprocessing as mp import matplotlib.pyplot as plt...
null
r2d2/01_F/src/network.py
network.py
py
3,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.backend.square", "line_number": 27, "usage_type": "call" }, { "api_name": "keras.backend", "line_number": 27, "usage_type": "name" }, { "api_name": "keras.backend.abs", "line_number": 28, "usage_type": "call" }, { "api_name": "keras.backend", ...
181905119
# -*- coding: utf-8 -*- import json import re import uuid from qiniu import Auth, BucketManager from scrapy import Spider, Request from img_spiders.items import ImgSpidersItem, SheJiDiGuo class Design68Spider(Spider): name = 'design68' allowed_domains = ['www.68design.net', 'img.aiji66.com'] headers = {...
null
img_spiders/spiders/design68.py
design68.py
py
1,096
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 12, "usage_type": "name" }, { "api_name": "scrapy.Request", "line_number": 25, "usage_type": "call" }, { "api_name": "img_spiders.items.SheJiDiGuo", "line_number": 31, "usage_type": "call" } ]
168088733
import librosa import numpy as np import scipy as sp class Energy4Hz: def __init__(self, soundPath="", rawData = None, frameLenght=0.016, frameStep=0.008, modulLenght=1, coreFrequency=4, firOrder=100, nMelBand=40, n_fft=2048, fft_step=512): """ Can compute the Energy modulation of...
null
.ipynb_checkpoints/nrj_leo-checkpoint.py
nrj_leo-checkpoint.py
py
5,113
python
en
code
null
code-starcoder2
76
[ { "api_name": "librosa.load", "line_number": 47, "usage_type": "call" }, { "api_name": "librosa.filters.mel", "line_number": 69, "usage_type": "call" }, { "api_name": "librosa.filters", "line_number": 69, "usage_type": "attribute" }, { "api_name": "numpy.hamming",...
254595675
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from labs.lib.utils import array_map, unzip def plot_features(y, x, col_names=None, N_COLS=3): N_FEATURES = x.shape[1] N_ROWS = int(np.ceil(N_FEATURES / N_COLS)) fig, ax = plt.subplots(N_ROWS, N_COLS, figsize=(N_COLS * 10, N_ROWS *...
null
labs/lib/plots.py
plots.py
py
1,547
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.ceil", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "labs.lib.utils...
442438918
import json from pathlib import Path import requests import utils from handler import Handler class RequestTransferHandler(Handler): def handle(self, environ, start_response): user = environ['user'] missionJsonString = utils.environToContents(environ) missionJson = json.loads(missionJson...
null
handlers/requestTransfer.py
requestTransfer.py
py
1,871
python
en
code
null
code-starcoder2
76
[ { "api_name": "handler.Handler", "line_number": 10, "usage_type": "name" }, { "api_name": "utils.environToContents", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.checkUserPer...
627097962
fin = open('C:\\Users\\Ani\\Downloads\\dataset_2_10.txt', 'r') fout = open('C:\\Users\\Ani\\OneDrive\\Desktop\\output.txt', 'w') txt = fin.readline().replace('\n','').split(' ') k = int(txt[0]) string = fin.readline().replace('\n','') from collections import Counter patterns = [] for i in range(0,len(string)...
null
the_Frequent_Words_Problem.py
the_Frequent_Words_Problem.py
py
613
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
427870074
#write a program to download youtube video using python import pytube link = input("Enter the link of the video: ") url = input("Enter the url of the video: ") video = pytube.YouTube(url) stream = video.streams.get_highest_resolution() stream.download() print("Download Completed!!")
null
python-DataTransaction/copilot_test.py
copilot_test.py
py
291
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytube.YouTube", "line_number": 8, "usage_type": "call" } ]
494447838
#!/usr/bin/env python3 """Simple directory listing http server that also allows to upload files. """ import os import sys import argparse import base64 import mimetypes import pathlib import traceback from cgi import FieldStorage from wsgiref.util import FileWrapper CHUNKSIZE = 65536 # 64KB options = { "rootd...
null
httpuploader.py
httpuploader.py
py
13,173
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.exc_info", "line_number": 293, "usage_type": "call" }, { "api_name": "traceback.format_tb", "line_number": 296, "usage_type": "call" }, { "api_name": "mimetypes.guess_type"...
203401050
#! /usr/bin/env python3 # bulletPointAdder.py - Adds bullet points to start of each line of text on the clipboard starting with the 3rd line (skips first two). import pyperclip text = pyperclip.paste() # Separate lines and add stars. lines = text.split('\n') for i in range(len(lines)-2): #loop through all indexes ...
null
bulletPointAdder.py
bulletPointAdder.py
py
465
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyperclip.paste", "line_number": 5, "usage_type": "call" }, { "api_name": "pyperclip.copy", "line_number": 13, "usage_type": "call" } ]
435880485
from deap import creator, tools, base, algorithms from solver import Solver from specified_genetic_operators import * import matplotlib.pyplot as plt import time from GUI import print_2d_projections, get_3d_plot from mesh import * class GeneticSolver(Solver): def __init__(self, shape, objective_func, ob...
null
genetic3rd.py
genetic3rd.py
py
6,874
python
en
code
null
code-starcoder2
76
[ { "api_name": "solver.Solver", "line_number": 10, "usage_type": "name" }, { "api_name": "deap.creator.create", "line_number": 18, "usage_type": "call" }, { "api_name": "deap.creator", "line_number": 18, "usage_type": "name" }, { "api_name": "deap.base.Fitness", ...
153192320
import json import codecs import sys import jieba import logging logging.basicConfig(level=logging.ERROR) from os.path import exists, isfile, isdir from gensim import corpora, models from sklearn import lda sys.path.append('../utils') from JigClient import JigClient from es_client import ElasticClien...
null
src/dk/re-much_topic_lda_mmr_scale.py
re-much_topic_lda_mmr_scale.py
py
15,534
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "...
306021074
from torch.utils.data import Dataset, DataLoader import torchvision.transforms as transforms import numpy as np import cv2 def image_loader(image_path): try: image = cv2.imread(image_path) if len(image.shape) == 2: image = np.stack([image]*3, 2) return image except IOError: ...
null
Datasets/ms1m.py
ms1m.py
py
2,241
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 10, "usage_type": "call" }, { "api_name": "torchvision.transforms.Compose", "line_number": 15, "usage_type": "call" }, { "api_name": "torchvision.tran...
324750746
import sys import os sys.path.append(os.path.abspath("../")) """Entry point to train IRNet""" import numpy as np import torch import torch.nn as nn from pytorch_lightning import Trainer, seed_everything from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.core.lightning import LightningModul...
null
chexpert-model/IRNet/train_irnet.py
train_irnet.py
py
7,421
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number...
360113836
from django.urls import path from events import views from rest_framework_simplejwt.views import TokenObtainPairView app_name = 'events' urlpatterns = [ path('', views.home, name='home'), path('now/', views.event_list, name='event-list'), path('create/', views.create_event, name='create-event'), path('<int:event_...
null
events/urls.py
urls.py
py
1,026
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "events.views.home", "line_number": 8, "usage_type": "attribute" }, { "api_name": "events.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.path", ...
20581205
import configparser import os user_home = os.environ['HOME'] cfg_file_path = user_home + '\\.easy_mindoc\\config.ini' if not os.path.exists(cfg_file_path): cfg_path = cfg_file_path[:cfg_file_path.rindex('\\')] os.makedirs(cfg_path) conf = configparser.ConfigParser() conf.read(cfg_file_path, encoding='utf-8') ...
null
easymindoc/easymindoc/my_config/mindoc_config.py
mindoc_config.py
py
643
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_numb...
230489360
""" S3 storage Store data in S3 """ import os import sys import json import gzip try: # python2 from urlparse import urlparse import cStringIO BytesIO = cStringIO.StringIO except: # python3 from urllib.parse import urlparse import io BytesIO = io.BytesIO from .datastore import Metaflo...
null
metaflow/metaflow/datastore/s3.py
s3.py
py
9,505
python
en
code
null
code-starcoder2
76
[ { "api_name": "cStringIO.StringIO", "line_number": 15, "usage_type": "attribute" }, { "api_name": "io.BytesIO", "line_number": 20, "usage_type": "attribute" }, { "api_name": "datastore.MetaflowDataStore", "line_number": 26, "usage_type": "name" }, { "api_name": "u...
455362939
# # This program reads through the input file for lptsmanager, and # lists the values found there for each data field. # from xml.dom import minidom import io XML_FILENAME = "FCBH Intro/qry_dbp4_Regular_and_NonDrama.xml" OUT_FILENAME = "DBP4_Analyze_XML.txt" out = io.open(OUT_FILENAME, mode="w", encoding="utf-8") xml...
null
obsolete/analysis/py/AnalyzeXMLDoc.py
AnalyzeXMLDoc.py
py
988
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.open", "line_number": 11, "usage_type": "call" }, { "api_name": "xml.dom.minidom.parse", "line_number": 12, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 12, "usage_type": "name" } ]
292678281
# coding: utf8 import pytest from app.core import stations as st from app.core.dispatcher import GetWalletItinerary REQUIRED_KEYS = ["id"] STATIONS = [ st.StartRailwayDepotSt, st.GetUserSt, st.IsThereUserSt, st.IsUserBlockedSt, st.IsThereHeroSt, st.GetWalletSt, st.ViewWalletSt, st.Fin...
null
tests/units/dispatcher/test__get_wallet_itinerary.py
test__get_wallet_itinerary.py
py
777
python
en
code
null
code-starcoder2
76
[ { "api_name": "app.core.stations.StartRailwayDepotSt", "line_number": 10, "usage_type": "attribute" }, { "api_name": "app.core.stations", "line_number": 10, "usage_type": "name" }, { "api_name": "app.core.stations.GetUserSt", "line_number": 11, "usage_type": "attribute" ...
424394598
# from .simpleAPI2 import * from nltk import word_tokenize import re """1) количество классов в документе 2) среднее количество предложений в классе(еще можно максимальное) 3) среднее количество слов в классе 4) среднее количество символов в классе""" classes = 0 sents = 0 words = 0 symbols = 0 number = 0 #### All = 1...
null
local_settings.py
local_settings.py
py
1,804
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.fullmatch", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.word_tokenize", "line_number": 35, "usage_type": "call" } ]
490227429
import numpy as np from sklearn.cross_validation import train_test_split from sklearn.datasets import fetch_mldata def load_noisy_mnist(noise_ratio=0.): """ load MNIST with noisy labels Parameters ---------- noise_ratio : float ratio of noisy labels in training Returns ------- ...
null
dataset.py
dataset.py
py
1,083
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.fetch_mldata", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.cross_v...
448312223
import re import csv import datetime from pymongo import MongoClient client = MongoClient() db = client.newcompany path = r'E:\data\附件1:招聘信息.csv' _work_year = re.compile(r'[-年月日]') _salary = re.compile(r'[k-]') _salary_inf = re.compile(r'[k-以上]') _salary_sup = re.compile(r'[k-以下]') _position_advantage = re.compil...
null
refine_data.py
refine_data.py
py
4,175
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 7, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "re.compile", "line_numbe...
87859025
import argparse from LEDTranslator import LEDTranslator parser = None translator = LEDTranslator() text = False image = False parser = argparse.ArgumentParser() content_type = parser.add_mutually_exclusive_group() content_type.add_argument("-f", "--text", action="store_true", help="display text") content_type.add_a...
null
CLIManager.py
CLIManager.py
py
792
python
en
code
null
code-starcoder2
76
[ { "api_name": "LEDTranslator.LEDTranslator", "line_number": 6, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 10, "usage_type": "call" } ]
577176523
""" Implement a web service with API to return number of connected components for a given undirected graph - Input in JSON format - Input can be quite large - Must respond to POST request (http://localhost:5000/connected_components) """ from problem1.graph import Graph from flask import Flask, request app...
null
problem1/solution.py
solution.py
py
704
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 16, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.request.met...
458698027
# from django.conf.urls import url from django.urls import path from .views import index, about_view app_name = 'pages' urlpatterns = [ path('', index, name='index'), path('about/', about_view, name='about'), ]
null
src/pages/urls.py
urls.py
py
220
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.index", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.about_view", ...
633809502
def current_datetime(): from datetime import datetime now = datetime.now() dt_string = now.strftime("%d/%m/%Y %H:%M:%S") return (f"[{dt_string}]\n") def play(song): import os os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide" from pygame import mixer mixer.init() mi...
null
ex-6 healthy programmer/healthy programmer.py
healthy programmer.py
py
3,332
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 3, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 3, "usage_type": "name" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.mixer.in...
550445582
#encoding=utf-8 from bs4 import BeautifulSoup import urlparse import re class HtmlParser(object): #解析下载器下载的网页内容 def parse(self , page_url , html_cont): if page_url is None or html_cont is None: return #使用BeautifulSoup4库来进行解析 soup = BeautifulSoup(html_cont, 'html.parser' , ...
null
spider/html_parser.py
html_parser.py
py
1,778
python
en
code
null
code-starcoder2
76
[ { "api_name": "bs4.BeautifulSoup", "line_number": 14, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 25, "usage_type": "call" }, { "api_name": "urlparse.urljoin", "line_number": 30, "usage_type": "call" } ]
372440683
import pygame from pygame.sprite import Sprite class Bullet(Sprite): def __init__(self, ai_settings, screen, ship): super(Bullet, self).__init__() self.screen = screen self.rect = pygame.Rect(0, 0, ai_settings.bullet_width, ai_settings.bullet_height) self.rect.centerx = ship.rect.centerx self.rect.top = ...
null
bullet_test.py
bullet_test.py
py
1,160
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.sprite.Sprite", "line_number": 4, "usage_type": "name" }, { "api_name": "pygame.Rect", "line_number": 8, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.draw", "li...
11109089
import numpy as np import matplotlib.pyplot as plt def fn(x,n): return (x**n -n*x -1) x = np.linspace(1,3,1000) y2 = [fn(k,2) for k in x] plt.plot(x,y2) y3 = [fn(k,3) for k in x] plt.plot(x,y3) y4 = [fn(k,4) for k in x] plt.plot(x,y4) y5 = [fn(k,5) for k in x] plt.plot(x,y5) y10 = [fn(k,10) for k in x]...
null
TP 11/EX 3/ex 2.py
ex 2.py
py
656
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linspace", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplo...
597543183
#!/usr/bin/env python # A python version of the script hardCIDR.sh by Jason Ashton (@ninewires) # A tool to enumerate CIDRs by querying RIRs & BGP ASN prefix lookups # Currently queries: ARIN, RIPE NCC, APNIC, AfriNIC, LACNIC # # Queries are made for the Org name, network handles, org handles, customer handles, # BGP ...
null
pdisco/hardCIDR.py
hardCIDR.py
py
50,183
python
en
code
null
code-starcoder2
76
[ { "api_name": "threading.Semaphore", "line_number": 38, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 43, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 45, "usage_type": "attribute" }, { "api_name": "telnetlib.T...
372817139
import os import logging import web logging.getLogger("shell").setLevel(logging.DEBUG) def get_page_file_list_by_req_path(folder_pages_full_path, req_path, sort_by_modified_ts = False, max_depth = None, limit = None): if req_path in ("~all", "~recent"): path = "." else: path = web.utils.str...
null
zbox_wiki/shell.py
shell.py
py
913
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 7, "usage_type": "attribute" }, { "api_name": "web.utils.strips", "line_number": 14, "usage_type": "call" }, { "api_name": "web.utils", "...
313988350
import json from flask import render_template, request from ...data.db import db from ...data.models import MarathonInfo, ScheduleEntry def show(): return render_template('schedule/show.tmpl') def as_json(): start = request.args.get('start') end = request.args.get('end') schedule_entries = db.sessio...
null
src/web/views/schedule.py
schedule.py
py
1,014
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.render_template", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 12, "usage_type": "attribute" }, { "api_name": "f...
38869884
""" Dictionaries. Rosalind ID: INI6 URL: http://rosalind.info/problems/ini6/ """ from collections import defaultdict from helper import output, get_input def ini6(text): """Return dict with count of times the word occured in the string.""" result = defaultdict(int) for word in text.split(' '): r...
null
python/src/ini6.py
ini6.py
py
618
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 14, "usage_type": "call" }, { "api_name": "helper.get_input", "line_number": 22, "usage_type": "call" }, { "api_name": "helper.output", "line_number": 27, "usage_type": "call" } ]
556131818
# -- encoding: UTF-8 -- from addict import Dict from requests import Session from six.moves.urllib.parse import urljoin class WurstSession(Session): """ A "DWIM" requests session wrapper for sessions targeting the Wurst API. """ def __init__(self, base_url): self.base_url = base_url s...
null
wurstc/net.py
net.py
py
973
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.Session", "line_number": 7, "usage_type": "name" }, { "api_name": "six.moves.urllib.parse.urljoin", "line_number": 21, "usage_type": "call" }, { "api_name": "addict.Dict", "line_number": 31, "usage_type": "call" } ]
304545147
# coding: utf-8 """ An example of script of how you can create a system tray icon using python Requirements: pip install pystray """ import pystray from pystray import Menu, MenuItem from PIL import Image class ShowSystemTryIcon: def __init__(self): self.icon = pystray.Icon("File Organization System") ...
null
scripts/05_system_tray_icon_window.py
05_system_tray_icon_window.py
py
873
python
en
code
null
code-starcoder2
76
[ { "api_name": "pystray.Icon", "line_number": 14, "usage_type": "call" }, { "api_name": "pystray.Menu", "line_number": 15, "usage_type": "call" }, { "api_name": "pystray.MenuItem", "line_number": 15, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line...
632239545
import os import sys import pygame import math import glob import random import time from pygame.locals import * import maps from loader import load_image CENTER_X = -1 CENTER_Y = -1 GRASS_SPEED = 0.715 GRASS_GREEN = 75 COUNTDOWN_FULL = 3600 COUNTDOWN_EXTEND = 750 STONENESS_INCR = 10 STONENESS_DECR = 1 DRUNKNE...
null
player.py
player.py
py
7,182
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.transform.rotate", "line_number": 86, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 86, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 92, "usage_type": "call" }, { "api_name": "random.r...
528252236
import pytest from bitcart.errors import LightningDisabledError pytestmark = pytest.mark.asyncio async def test_node_id(btc_wallet): assert isinstance(await btc_wallet.node_id, str) async def test_add_invoice(btc_wallet): assert isinstance(await btc_wallet.addinvoice(0.5, "test description"), str) async ...
null
tests/coins/btc/test_lightning.py
test_lightning.py
py
494
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytest.mark", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pytest.raises", "line_number": 17, "usage_type": "call" }, { "api_name": "bitcart.errors.LightningDisabledError", "line_number": 17, "usage_type": "argument" } ]
118979613
import os import arcus.azureml.environment.aml_environment as aml import arcus.azureml.environment.errors as errors import arcus.azureml.environment.environment_factory as fac import pytest def is_interactive(): # If the environment variable System_DefinitionId is not available, we run locally return 'SYSTEM_D...
null
tests/test_workenvironment_create.py
test_workenvironment_create.py
py
1,680
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "pytest.raises", "line_number": 12, "usage_type": "call" }, { "api_name": "arcus.azureml.environment.errors.EnvironmentException", "line_number": 12, "usage_type": "attribute" }, ...
630666628
from django.urls import path from .views import * app_name='mytest' urlpatterns = [ path('',map,name='map'), path('out/',OutDB.as_view(),name='out'), path('in/', point_input, name='in'), path('outmap/',Outmap.as_view(),name='outmap'), ]
null
mytest/urls.py
urls.py
py
256
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
562619608
import helpers, testly, sys, json from time import time from glob import glob from os import path, symlink, makedirs, utime, remove from tempfile import gettempdir from collections import OrderedDict from shutil import rmtree from copy import deepcopy from liquid import LiquidRenderError from pyppl.job import Job from...
null
tests/testJob.py
testJob.py
py
83,680
python
en
code
null
code-starcoder2
76
[ { "api_name": "testly.TestCase", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "name" }, { "api_name": "tempfile.gettempdir", "...
391242699
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Parser Created on Fri Mar 8 07:10:43 2019 @author: Juan Manuel Perez & German Villacorta """ from ply import yacc from .vars_table import VarsTable from .intermediate_code_generator import ICG from .lexer import tokens vars_table = VarsTable() ic_generator = ICG()...
null
build/lib/elda/Compiler/parser.py
parser.py
py
28,615
python
en
code
null
code-starcoder2
76
[ { "api_name": "vars_table.VarsTable", "line_number": 16, "usage_type": "call" }, { "api_name": "intermediate_code_generator.ICG", "line_number": 17, "usage_type": "call" }, { "api_name": "vars_table.table", "line_number": 30, "usage_type": "attribute" }, { "api_na...
540896946
import numpy as np import pandas as pd from sklearn import metrics from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import r2_score from sklearn.model_selection import train_test_split def run_regression(filename='datafile.csv'): data = pd.read_csv(filename, low_memory=False) data.head...
null
regression.py
regression.py
py
3,114
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 25, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 36, "usage_type": "call" }, { "api_name": "sklearn.model_sel...
186617423
# -*- coding: utf-8 -*- """ Created on Tue Feb 26 12:40:56 2019 @author: Killer1 """ import pandas as pd import numpy as np from sklearn import linear_model from sklearn.metrics import r2_score import matplotlib.pyplot as plt regr = linear_model.LinearRegression() datos = pd.read_csv('movies3.csv') ...
null
Regresion_Lineal.py
Regresion_Lineal.py
py
869
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 14, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_na...
160622275
from tradenplay import settings from django.contrib.sites.models import Site def project_constants(HttpRequest): site_name = Site.objects.get(id=settings.SITE_ID) return {'STATIC_URL': settings.STATIC_URL, 'IMG_UPLD_DIR': settings.IMG_UPLD_DIR, 'site_name': site_name ...
null
utils/context_processors.py
context_processors.py
py
326
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.sites.models.Site.objects.get", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.sites.models.Site.objects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.sites.models.Site", "line_number": 6,...
426549455
from django.shortcuts import render, redirect from myblog.models import Genre, Post from django.template import loader from django.http import HttpResponse, HttpResponseRedirect, Http404 from myblog.forms import MyPostForm from django import forms from django.utils import timezone def add_post(request): if reque...
null
myblog/views.py
views.py
py
1,601
python
en
code
null
code-starcoder2
76
[ { "api_name": "myblog.forms.MyPostForm", "line_number": 12, "usage_type": "call" }, { "api_name": "django.utils.timezone.now", "line_number": 15, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 15, "usage_type": "name" }, { "api_name"...
485547320
import pygame import enum import time class Direction(enum.Enum): LTR = 0 RTL = 1 TTB = 2 BTT = 3 class Gradient(): def __init__(self, parent, position, size, start_color = pygame.Color(0,0,0), end_color = pygame.Color(255,255,255), direction = Direction.LTR, occurrence = -1): self.occurre...
null
gradient.py
gradient.py
py
5,072
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.Color", "line_number": 12, "usage_type": "call" }, { "api_name": "pygame.Surface", "line_number": 24, "usage_type": "call" }, { "api_name": "pygame.Color", "line_nu...
375099316
#!/usr/bin/env python3 import os, sys import time import json import asyncio from datetime import datetime HOME_DIR = os.environ['HOME_DIR'] sys.path.insert(0, HOME_DIR) from dnx_configure.dnx_constants import * from dnx_configure.dnx_configure import System from dnx_configure.dnx_iptables import IPTables class IP...
null
ip_proxy/ip_proxy_timer.py
ip_proxy_timer.py
py
3,975
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "json.load", "line_n...
91857038
from transitions import Machine import asyncio from util import ImageUtil from uiautomator2 import Device class FriendPointTask(object): states = ["friend_point_pool", "friend_point_confirm", "friend_point_summon"] def __init__(self, image_util: ImageUtil, device: Device): self.image_util = image_uti...
null
friend_point.py
friend_point.py
py
2,766
python
en
code
null
code-starcoder2
76
[ { "api_name": "util.ImageUtil", "line_number": 10, "usage_type": "name" }, { "api_name": "uiautomator2.Device", "line_number": 10, "usage_type": "name" }, { "api_name": "transitions.Machine", "line_number": 14, "usage_type": "call" }, { "api_name": "transitions.Ma...
332399611
##载入所需库 import xgboost as xgb import pandas as pd import numpy as np ##载入训练数据 data = pd.read_csv('./train.csv').fillna(0) ##数据集拆分 label = data['pay_status'] feature = data.iloc[:, 3:] train_rate = 0.7 random_index = np.random.permutation(feature.shape[0]) train_index, test_index = random_index[:int(train_rate * featu...
null
Ensemble Learning/Boosting/xgboost.py
xgboost.py
py
1,358
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 13, "usage_type": "attribute" }, { "api_name": "xgboost.DMa...
88997774
import asyncio import os import subprocess import aiofiles import logging logger = logging.getLogger("app") async def determine_server_version(install_path="."): loop = asyncio.get_event_loop() version = await loop.run_in_executor(None, determine_server_version_from_git) if version: return ver...
null
virtool/version.py
version.py
py
1,181
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "l...
187997791
import scrapy class QuotesSpider(scrapy.Spider): name = "tripadvisor" start_urls = [ 'https://www.tripadvisor.com/Restaurants-g294074-Bogota.html', ] def parse(self, response): for restaurant in response.css("a._15_ydu6b"): yield { 'name': restaurant.get(),...
null
Data_Collection_Scraping/tadd/tadd/spiders/tripavisor_crawler.py
tripavisor_crawler.py
py
540
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" } ]
628551000
# -*- coding: utf-8 -*- import json from urllib.parse import quote import scrapy from scrapy import Request, Selector from scrapy_demo.items import LianjiaItem class LianjiaSpider(scrapy.Spider): name = 'lianjia' allowed_domains = ['lianjia.com'] # start_urls = ['https://nj.lianjia.com/'] name = 'l...
null
pycharmProject/scrapy_dev/scrapy_demo/scrapy_demo/spiders/lianjia.py
lianjia.py
py
7,232
python
en
code
null
code-starcoder2
76
[ { "api_name": "scrapy.Spider", "line_number": 11, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 39, "usage_type": "call" }, { "api_name": "scrapy.Selector", "line_number": 54, "usage_type": "call" }, { "api_name": "json.loads", "l...
231404944
__author__ = 'Jarvis' import logging from django.utils.translation import ugettext as _ from notification import models from dashboard import models as dashboardModels from utilities import email from utilities import common log = logging.getLogger('email') def sendRegisterActiveEmail(request, *args, **kwargs): ...
null
notification/views.py
views.py
py
13,740
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "notification.models.NotificationTemplate.objects.filter", "line_number": 17, "usage_type": "call" }, { "api_name": "notification.models.NotificationTemplate", "line_number": 17, "...
605057153
from gettext import gettext as _ from gi.repository import GObject, Gtk, Gedit # Place the menu item above "Select All" in "Edit". ui_str = """<ui> <menubar name="MenuBar"> <menu name="EditMenu" action="Edit"> <placeholder name="EditOps_2"> <menuitem name="DuplicateLine" action="DuplicateLine"/> </placeholder> </menu>...
null
duplicateline.py
duplicateline.py
py
3,126
python
en
code
null
code-starcoder2
76
[ { "api_name": "gi.repository.GObject.Object", "line_number": 16, "usage_type": "attribute" }, { "api_name": "gi.repository.GObject", "line_number": 16, "usage_type": "name" }, { "api_name": "gi.repository.Gedit.WindowActivatable", "line_number": 16, "usage_type": "attribu...
167960994
"""Utility functionality for logging. """ import os import sys import logbook def create_log_handler(config, log_name): log_dir = config.get("log_dir", None) if log_dir: if not os.path.exists(log_dir): os.makedirs(log_dir) handler = logbook.FileHandler(os.path.join(log_dir, "%s.log...
null
nextgen/bcbio/log/__init__.py
__init__.py
py
416
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 12, "usage_type": "call" }, { "api_name": "logbook.FileHandler", "li...
78183459
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED STOP_RENDERING = runtime.STOP_RENDERING __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1499327915.777048 _enable_loop = True _template_filename = '/home/duytung/PycharmProjects/test/tes...
null
data/templates/pages/new.mako.py
new.mako.py
py
2,988
python
en
code
null
code-starcoder2
76
[ { "api_name": "mako.runtime.UNDEFINED", "line_number": 3, "usage_type": "attribute" }, { "api_name": "mako.runtime", "line_number": 3, "usage_type": "name" }, { "api_name": "mako.runtime.STOP_RENDERING", "line_number": 4, "usage_type": "attribute" }, { "api_name":...
456189038
#!/usr/bin/env python3 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Author: Jeremy Maurer, Raymond Hogenson & David Bekaert # Copyright 2019, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. # # ~~~~~~~~~~~~~~...
null
tools/RAiDER/losreader.py
losreader.py
py
11,665
python
en
code
null
code-starcoder2
76
[ { "api_name": "RAiDER.constants._ZREF", "line_number": 64, "usage_type": "name" }, { "api_name": "RAiDER.Geo2rdr.PyGeo2rdr", "line_number": 89, "usage_type": "call" }, { "api_name": "RAiDER.Geo2rdr", "line_number": 89, "usage_type": "name" }, { "api_name": "numpy....
208186634
from PyQt5 import QtSql from PyQt5.QtSql import QSqlQuery import xlrd import datetime import time import random a1 = (2016, 1, 1, 0, 0, 0, 0, 0, 0) # 设置开始日期时间元组(1976-01-01 00:00:00) a2 = (2019, 12, 31, 23, 59, 59, 0, 0, 0) # 设置结束日期时间元组(2019-12-31 23:59:59) start = time.mktime(a1) # 生成开始时间戳 end = time.mktime(a2) #...
null
create_sql.py
create_sql.py
py
12,008
python
en
code
null
code-starcoder2
76
[ { "api_name": "time.mktime", "line_number": 11, "usage_type": "call" }, { "api_name": "time.mktime", "line_number": 12, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "time.localtime", "line_num...
608264431
from models.config import session from models.user import User from models.book import Book from models.own_book import Own_Book from models.lend_info import Lend_info from app.BookList import GetOwnBookById,GetOwnBookIDByUseridAndBookid import os from datetime import date, timedelta import datetime from app.IsSam...
null
server/app/add_db_LendInfo.py
add_db_LendInfo.py
py
2,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.config.session.query", "line_number": 21, "usage_type": "call" }, { "api_name": "models.user.User", "line_number": 21, "usage_type": "argument" }, { "api_name": "models.config.session", "line_number": 21, "usage_type": "name" }, { "api_name":...
546766921
""" Sort all traffic packets data based on date and time Return and write to directory files: em2_sorted.csv em3_sorted.csv em4_sorted.csv """ import numpy as np import pandas as pd import datetime import time import os import ConfigParser import multiprocessing import sys Config = ConfigParser.ConfigParser() Confi...
null
sort_packet.py
sort_packet.py
py
1,949
python
en
code
null
code-starcoder2
76
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 20, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path.join", ...
38102716
"""PinkBlack URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
null
PinkBlack/urls.py
urls.py
py
2,846
python
en
code
null
code-starcoder2
76
[ { "api_name": "pink_black.sitemaps.ItemSitemap", "line_number": 29, "usage_type": "name" }, { "api_name": "pink_black.sitemaps.StaticViewSitemap", "line_number": 30, "usage_type": "name" }, { "api_name": "django.urls.path", "line_number": 34, "usage_type": "call" }, {...
524817873
""" Created by Alexander Swanson on 8/1/18. Copyright (c) 2018, Alexander Joseph Swanson Villares alexjosephswanson@gmail.com """ import indicoio import json import pandas from itertools import chain from pprint import pprint with open('../resources/keys/indicoio.txt') as f: indicoio.config.api_key = f.readline()...
null
experiments/experiment2/src/py/keyphrases_generation.py
keyphrases_generation.py
py
2,218
python
en
code
null
code-starcoder2
76
[ { "api_name": "indicoio.config", "line_number": 14, "usage_type": "attribute" }, { "api_name": "indicoio.keywords", "line_number": 34, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 43, "usage_type": "call" }, { "api_name": "json.load", "lin...
609206817
import asyncio import pprint from itertools import product from collections import defaultdict import argparse tcp_ports = [22, 3389] class TcpProbe: def __init__(self, os_ip, port): self.os_ip = os_ip self.port = port def __repr__(self): return f'{self.os_ip}:{self.port} connect {...
null
IsAlive/IsAliveAsync.py
IsAliveAsync.py
py
1,858
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.open_connection", "line_number": 25, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 35, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 50, "usage_type": "call" }, { "api_name": "asy...
239243101
""" A simulator for Nokia 1830-PSS for testing purposes """ import os import re import logging import sshim logging.basicConfig(level='DEBUG') logger = logging.getLogger() fixture_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'fixtures') logger.info(fixture_path) class NokiaPSS18...
null
tests/pss1830sim.py
pss1830sim.py
py
6,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "lin...
2574549
from dataclasses import dataclass from defines import inv_cell_enum from Solver import Solver, make_xor_bool @dataclass class Label: bit: int type: str num: int @dataclass class ActiveInfo: cycle: int cell_id: int prop_var: int @dataclass class VariableInfo: cycle: int cell_id: int...
null
classes.py
classes.py
py
4,378
python
en
code
null
code-starcoder2
76
[ { "api_name": "dataclasses.dataclass", "line_number": 6, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 13, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 20, "usage_type": "name" }, { "api_name": "Solv...
652706147
import torch import torch.nn.functional as F try: import matplotlib.pyplot as plt except ImportError: pass def factor_getter(n, base): base = base * 0.8 ** (n // 6) i = n % 6 if i < 3: f = [0, 0, 0] f[i] = base else: base /= 2 f = [base, base, base] f[i ...
null
pytorch_mask_rcnn/visualize.py
visualize.py
py
2,652
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.functional.interpolate", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.nn.functional.interpolate", "line_number": 37, "usage_type": "call" }, { ...
436360597
import os from conans import ConanFile, tools, CMake from conans.errors import ConanInvalidConfiguration class WavPackConan(ConanFile): name = "wavpack" description = "Hybrid Lossless Wavefile Compressor." topics = ("conan", "wavpack", "lossless", "audio", "lossy", "wv") url = "https://github.com/audac...
null
wavpack/all/conanfile.py
conanfile.py
py
3,150
python
en
code
null
code-starcoder2
76
[ { "api_name": "conans.ConanFile", "line_number": 5, "usage_type": "name" }, { "api_name": "conans.tools.get", "line_number": 40, "usage_type": "call" }, { "api_name": "conans.tools", "line_number": 40, "usage_type": "name" }, { "api_name": "conans.tools.rename", ...
237491995
# coding=utf-8 __author__ = "AstroPrint Product Team <product@astroprint.com>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2017 3DaGoGo, Inc - Released under terms of the AGPLv3 License" import sqlite3 class AstroprintDB(): def __init__(self...
null
octoprint_astroprint/AstroprintDB.py
AstroprintDB.py
py
4,589
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 39, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 50, "usage_type": "call" }, { "api_name": "sqlite3.connect", ...
296168486
""" This module contains classes and functions used for defining RESTFul web interfaces. You can define resources which contain sets of endpoints. You can also create bundles of resources for versioning and grouping your api calls. Those resources and Please refer to the documentation for the Resource class for mor...
null
resourceful/resources.py
resources.py
py
35,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.View", "line_number": 19, "usage_type": "name" }, { "api_name": "bundles.Bundle", "line_number": 171, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 217, "usage_type": "call" }, { "api_name": "djang...
416341900
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.linux-x86_64/egg/treedraw/render.py # Compiled at: 2017-10-18 08:39:32 # Size of source mod 2**32: 4255 bytes import cairo, math class Renderer: ...
null
pycfiles/treedraw-1.1.0-py3.6/render.cpython-36.py
render.cpython-36.py
py
3,665
python
en
code
null
code-starcoder2
76
[ { "api_name": "math.sqrt", "line_number": 16, "usage_type": "call" }, { "api_name": "cairo.ImageSurface", "line_number": 17, "usage_type": "call" }, { "api_name": "cairo.FORMAT_RGB24", "line_number": 17, "usage_type": "attribute" }, { "api_name": "cairo.Context", ...
646811852
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- """ ################################################################################ # # Copyright (c) 2016 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # ####################################################################...
null
src/ETReg.py
ETReg.py
py
7,447
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.insert", "line_number": 42, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 42, "usage_type": "name" }, { "api_name": "sys.path.insert", "line_number": 43, "usage_type": "call" }, { "api_name": "sys.path", "line_number"...
473154351
import numpy as np #GLOBAL VARIABLES IMAGE_SIZE=32 NUM_CLASSES=10 NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN=50000 NUM_EXAMPLES_PER_EPOCH_FOR_EVAL=10000 IMAGE_PIXELS=IMAGE_SIZE*IMAGE_SIZE*3 def unpickle(file): import pickle with open(file, 'rb') as fo: dict=pickle.load(fo, encoding='bytes') return dict ...
null
HW2/feedforward/code/CIFAR_INPUT.py
CIFAR_INPUT.py
py
3,084
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.reshape", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 19, "usage_type": "call" }, { "api_name": "random.randrange", "line_...
178276414
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
null
horizon/openstack_dashboard/utils/signature_utils.py
signature_utils.py
py
1,531
python
en
code
null
code-starcoder2
76
[ { "api_name": "base64.b64encode", "line_number": 42, "usage_type": "call" }, { "api_name": "hmac.new", "line_number": 42, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 43, "usage_type": "attribute" } ]
512731413
__author__ = 'Agnieszka' from django.shortcuts import render_to_response, render from django.template import RequestContext from django.http import HttpResponse def handler404(request): response = render_to_response('404.html', {}, context_instance=RequestContext(request)) re...
null
Prostate_Project_Web/views.py
views.py
py
841
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render_to_response", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template.RequestContext", "line_number": 8, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 14, "usage_type": "...
475826057
import logging from time import time from sklearn import metrics logger = logging.getLogger(__name__) def trim(s): return s if len(s) <= 80 else s[:77] + "..." def sk_statistical(clf, x_train, y_train, y_test, x_test): """ Run the classifier and collect results. This is intended for use with the `...
null
dataScience/experimental/policy/text_classif/utils/benchmarks.py
benchmarks.py
py
1,399
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 39, "usage_type": "call" }, { "api_name": "time.time", "line_number": 41, "usage_type": "call" }, { "api_name": "time.time", "line_number": 4...
65029407
import numpy as np import matplotlib.pyplot as plt from pulseinfo import PulseProfile from opmmodel import ModeDecomposedProfile from scipy.signal import argrelextrema import scipy.optimize as opt from sklearn import mixture from gaussianmixture import fit_samples class GaussianMixture(object): def __init__(self,...
null
fit_gaussians/gaussian_profile_fit.py
gaussian_profile_fit.py
py
4,041
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.exp", "line_number": 19, "usage_type": "call" }, { "api_name": "scipy.signal.argrelextrema", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.greater", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.zeros",...
457267656
from django.urls import path,include from student import views urlpatterns = [ path('home_student',views.home_student,name="home_student"), path('profile_student', views.student_profile, name="profile_student"), path('student_dash', views.dash, name='StudentDash'), path('student_profile', views.profil...
null
student/urls.py
urls.py
py
486
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "student.views.home_student", "line_number": 6, "usage_type": "attribute" }, { "api_name": "student.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.ur...
11053652
from flask import Flask, render_template, request from scipy.misc import imread, imresize import numpy as np import re import sys import os import keras sys.path.append(os.path.abspath("./model")) from load import * from PIL import Image app = Flask(__name__) global model, graph model, graph = init() import base6...
null
app.py
app.py
py
1,873
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_num...
517771520
import pyautogui from time import sleep import keyboard pause = False print(pause) def change(): global pause pause = not pause print(pause) keyboard.add_hotkey('page up', lambda: change()) keyboard.add_hotkey('esc', lambda: exit()) while 1: if pause == True: find = pyautogui.locateOnS...
null
Bot1.0.pyw
Bot1.0.pyw
pyw
2,004
python
en
code
null
code-starcoder2
76
[ { "api_name": "keyboard.add_hotkey", "line_number": 14, "usage_type": "call" }, { "api_name": "keyboard.add_hotkey", "line_number": 15, "usage_type": "call" }, { "api_name": "pyautogui.locateOnScreen", "line_number": 20, "usage_type": "call" }, { "api_name": "pyau...
134773524
#!/usr/bin/env python import rospy from std_msgs.msg import String from std_msgs.msg import Empty from nav_msgs.msg import Odometry from geometry_msgs.msg import Twist #import pandas as pd import threading import numpy as np from geometry_msgs.msg import TransformStamped from tf.transformations import euler_from_quate...
null
jackal1_ws/src/offbordctrl/script/serial_command.py
serial_command.py
py
6,255
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 22, "usage_type": "call" }, { "api_name": "tf.transformations.euler_from_quaternion", "line_number": 53, "usage_type": "call" }, { "api_name": "math.degrees", "line_number": 54, "usage_type": "call" }, { "api_name": "geo...
118240346
from rest_framework import test, status from nodeconductor.iaas.tests import factories from nodeconductor.structure import models from nodeconductor.structure.tests import factories as structure_factories class FloatingIPListRetreiveTestCase(test.APITransactionTestCase): def setUp(self): # objects ...
null
nodeconductor/iaas/tests/test_floating_ips.py
test_floating_ips.py
py
5,191
python
en
code
null
code-starcoder2
76
[ { "api_name": "rest_framework.test.APITransactionTestCase", "line_number": 8, "usage_type": "attribute" }, { "api_name": "rest_framework.test", "line_number": 8, "usage_type": "name" }, { "api_name": "nodeconductor.structure.tests.factories.CustomerFactory", "line_number": 12...
70956973
#!/usr/bin/env python # encoding: utf-8 ''' @author: Roy Law @license: (C) Copyright 2018. @contact: https://github.com/RoyLaw @file: consultation_from_baidu.py @time: 2018/1/15 下午1:40 @desc: @ref: https://github.com/smileboywtu/MillionHeroAssistant/blob/master/core/baiduzhidao.py ''' import operator import ...
null
common/consultation_from_baidu.py
consultation_from_baidu.py
py
1,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 45, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 50, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 71, "usage_type": "call" } ]
118813535
# -*- coding: utf-8 -*- """ author: Juan Ramón Espinoza Created on Mon May 9 16:23:43 2016 """ import numpy as np from matplotlib import pyplot as plt from matplotlib import cm def displayData(X, example_width=0): """Displays 2D data stored in X in a nice grid.""" if example_width==False: ...
null
functions/displayData.py
displayData.py
py
1,549
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.round", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 23...
542323686
from django.views import View from onlineapp.forms.auth import * from django.contrib.auth import login, authenticate,logout from django.contrib.auth.forms import UserCreationForm from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib import messages class ...
null
mentor_app_git/onlineapp/views/auth.py
auth.py
py
2,062
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.View", "line_number": 9, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 21, "usage_type": "call" ...
538557126
#Question 10 import numpy as np import scipy.optimize as scop import matplotlib.pyplot as plt import emcee import corner f=open("Data.txt","r") #Read the data given. Data=f.readlines() i=0 x=np.zeros(20) y=np.zeros(20) y_er=np.zeros(20) for D in Data: D1,D2,D3,D4=D.split() x[i]=float(D2) y[i]=f...
null
Q_10.py
Q_10.py
py
1,574
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 25...
536239765
import inspect import warnings from contextlib import ExitStack from typing import TYPE_CHECKING, Any, Callable, Generator, List, NamedTuple, Optional, Union, cast from dagster import check from dagster.core.errors import DagsterInvalidInvocationError, DagsterInvariantViolationError from dagster.core.instance import D...
null
python_modules/dagster/dagster/core/definitions/sensor.py
sensor.py
py
19,997
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 47, "usage_type": "name" }, { "api_name": "dagster.core.instance.ref.InstanceRef", "line_number": 47, "usage_type": "name" }, { "api_na...
540857571
################################################################ # # # doc # # # ############################################################...
null
classifier/inceptionv3.py
inceptionv3.py
py
6,082
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.applications.InceptionV3", "line_number": 51, "usage_type": "call" }, { "api_name": "keras.applications", "line_number": 51, "usage_type": "name" }, { "api_name": "keras.preprocessing.image.ImageDataGenerator", "line_number": 56, "usage_type": "call" ...
134337906
import threading import discord from discord.ext import commands import asyncio from datetime import datetime,time,timedelta import datetime as dt import UserSLAlert import Position import database import json import urllib.request import time from selenium import webdriver from selenium.webdriver.chrome.options impor...
null
source/alertsSL.py
alertsSL.py
py
6,036
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.platform", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "li...
627646598
# -*- coding: utf-8 -*- import re import os import json import datetime import requests from pymongo import MongoClient from selenium import webdriver from time import sleep from threading import Thread from models.documents import LiveScore, Tournament import logging class Driver: def __init__(self): chr...
null
scripts/bet365_livescore.py
bet365_livescore.py
py
7,115
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 25, "usage_type": "call" }, { "api...
280783455
import sys import re import os import glob import json import collections import cv2 import errno import numpy as np import shutil ''' before run this script please exec: cd /media/benw/Data/data/aws_log_data/data ls -1 metadata/ | grep mta.json | head -n 25000 > ../trainval24k/trainvallist24k.txt prepare the traini...
null
segmentation/data/prepareImagas.py
prepareImagas.py
py
8,093
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 45, "usage_type": "call" }, { "api_name": "os.path", "line_number": 45, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 4...
516110928
#! /usr/bin/env python # # Author: Graeme A Stewart <graeme.andrew.stewart@cern.ch> # # Copyright (C) 2017 CERN for the benefit of the ATLAS collaboration # # 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 th...
null
cmttags.py
cmttags.py
py
4,991
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.stat", "line_number": 36, "usage_type": "call" }, { "api_name": "glogger.logger.debug", "line_number": 65, "usage_type": "call" }, { "api_name": "glogger.logger", "line_number": 65, "usage_type": "name" }, { "api_name": "glogger.logger.debug", ...
442277639
# -*- coding: utf-8 -*- """ Python module to manipulate, analyze and visualize structural geology data """ from __future__ import division, print_function from copy import deepcopy import warnings import numpy as np from .helpers import sind, cosd, acosd, asind, atan2d, angle_metric __all__ = ['Vec3', 'Lin', 'Fol',...
null
apsg/core.py
core.py
py
38,926
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_num...
306824329
from PyQt5.QtWidgets import QApplication from model.experiment.IV_measurement import IVExperiment from view.scan_window import ScanWindow exp = IVExperiment() exp.load_config('Config/experiment.yml') exp.load_daq() app = QApplication([]) win = ScanWindow(exp) win.show() app.exec()
null
test_view.py
test_view.py
py
284
python
en
code
null
code-starcoder2
76
[ { "api_name": "model.experiment.IV_measurement.IVExperiment", "line_number": 6, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 10, "usage_type": "call" }, { "api_name": "view.scan_window.ScanWindow", "line_number": 11, "usage_type": "...
601166021
import numpy as np import os from pandas.io.parsers import read_csv from sklearn.cross_validation import train_test_split from sklearn.utils import shuffle def load_train_data(filepath, cols=None): df = read_csv(os.path.expanduser(filepath)) # load dataframes df['Image'] = df['Image'].apply(lambda im: np.fr...
null
K/utils/load.py
load.py
py
1,322
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.io.parsers.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.fromstr...