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
144645119
# -*- coding: utf-8 -*- from flask import request from flask_restful import Resource, reqparse from .notification import CREATED, UPDATED, PATCHED, REMOVED import rest.timeservice as timeservice from util.patch import patch, PatchConflict import model _NOTIFICATION_ARG = "notifications" _API_ARG = "api" _MODEL_ARG = ...
null
server/rest/tag.py
tag.py
py
3,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_restful.Resource", "line_number": 15, "usage_type": "name" }, { "api_name": "rest.timeservice.time_service", "line_number": 27, "usage_type": "attribute" }, { "api_name": "rest.timeservice", "line_number": 27, "usage_type": "name" }, { "api_na...
317208988
import os import json from data.preprocess_data import preprocess_data import pandas as pd import numpy as np from copy import copy ''' This file contains the functions that are used universally in the live deployments, usually for the generation of processed data. ''' #creates the split dates array which rolls f...
null
code/utils/general_functions.py
general_functions.py
py
11,118
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.exit", "line_number": 69, "usage_type": "call" }, { "api_name": "os.exit", "line_number": 119, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 130, "usage_type": "call" }, { "api_name": "os.path", "line_number": 130, ...
33537019
# !mkdir dst; for l in `cat best_model.txt`; do f=`echo $l|tr ',' '_'|cut -d '_' -f1-5`; for file in `find checkpoints/ -name $f*`; do cp $file dst/; done; done import os import pickle import numpy as np import statistics as st from sklearn.metrics import mean_squared_error from scipy.stats import pearsonr from sc...
null
.ipynb_checkpoints/sent_analyze-checkpoint.py
sent_analyze-checkpoint.py
py
5,030
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3...
371827357
import os import pydub from docx import Document # Imports the Google Cloud client library from google.cloud import storage from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech import types file_name = 'a' # flacに変換 sound = pydub.AudioSegment.from_file('sound/' + file_name +...
null
sptotx.py
sptotx.py
py
1,620
python
en
code
null
code-starcoder2
66
[ { "api_name": "pydub.AudioSegment.from_file", "line_number": 14, "usage_type": "call" }, { "api_name": "pydub.AudioSegment", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "...
50051373
import cv2 as cv import numpy as np def bliateralFilter(image): dst = cv.bilateralFilter(image,0,100,15) cv.imshow("bliateralFilter",dst) def pyrMeanShiftFilter(image): dst = cv.pyrMeanShiftFiltering(image,10,50) cv.imshow("pyrMeanShiftFilter",dst) src = cv.imread("D:/opencv/head.jpg") cv.imshow("h...
null
test/tutorial_8.py
tutorial_8.py
py
418
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.bilateralFilter", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.pyrMeanShiftFiltering", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", ...
587526595
''' Created on 15 Apr 2020 @author: si ''' import json import os from ayeaye.connectors.base import DataConnector, AccessMode from ayeaye.pinnate import Pinnate class JsonConnector(DataConnector): engine_type = 'json://' def __init__(self, *args, **kwargs): """ Single JSON file loaded into ...
null
ayeaye/connectors/json_connector.py
json_connector.py
py
4,260
python
en
code
null
code-starcoder2
66
[ { "api_name": "ayeaye.connectors.base.DataConnector", "line_number": 13, "usage_type": "name" }, { "api_name": "ayeaye.connectors.base.AccessMode.READ", "line_number": 78, "usage_type": "attribute" }, { "api_name": "ayeaye.connectors.base.AccessMode", "line_number": 78, "...
348244176
from django.core.management.base import BaseCommand, CommandError from ImagePicker.views import * import sys class Command(BaseCommand): help = 'deletes duplicate zone codes' def handle(self, *args, **options): #mapPoints = MapPoint.objects.all() mapPoints = MapPoint.objects.filter(pk=69997) ...
null
streetviewInterface/mySite/ImagePicker/management/commands/deleteDuplicateZoneCodes.py
deleteDuplicateZoneCodes.py
py
627
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 4, "usage_type": "name" }, { "api_name": "sys.exit", "line_number": 19, "usage_type": "call" } ]
632510581
#Exercise 9 #Authors: Janice Love and Melissa Stephens #Load data and import packages import numpy import pandas from scipy.optimize import minimize from scipy.stats import norm from scipy.stats import chi2 from plotnine import * #need to read-in/populate dataframe with existing data MyDataFrame=pandas.read_csv("Mmar...
null
Q2_Excercise09.py
Q2_Excercise09.py
py
1,784
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "line_number": 29, "usage_type": "call" }, { "api_name": "scipy.optimize.minimize", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.arange...
471975885
from django.conf.urls.defaults import * from data import views # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', ('^$', views.hello), (r'^test/$',views.qr), (r'^time/plus/(\d{1,2})/$', views.hours_ahead), (r'^choice/([a-z]+)/$',view...
null
urls.py
urls.py
py
625
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 5, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "data.views.hello", "line_number": 8, "usage_type": "attribute" }, { "api_nam...
95899387
# Crash Course Text Project 1 - 15th Iteration: ''' - Repopulating the fleet - Speeding up the bullets files updated: game_functions.py alien_invasion.py settings.py - Repopulating the fleet: When the fleet is destroyed - a new one appears. - Speeding up bullets due to the am...
null
Python_Crash_Course_text/Crash_Course_Text_Projects/15_ver_Project_01/alien_invasion.py
alien_invasion.py
py
1,318
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 28, "usage_type": "call" }, { "api_name": "settings.Settings", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 30, "usage_type": "call" }, { "api_name": "pygame.display"...
117844676
# -*- coding: utf-8 -*- from PyQt5.QtCore import QCoreApplication, pyqtSlot from PyQt5.QtWidgets import QApplication, QDialog,QMainWindow from PyQt5 import QtGui from UI.SCRIPT.Readpage_Script import Ui_Read_Window from UI.Theme.Journal_Content_Layout import layout import requests from bs4 import Beauti...
null
Core/Outliner_Journal.py
Outliner_Journal.py
py
2,262
python
en
code
null
code-starcoder2
66
[ { "api_name": "UI.Theme.Styles.Black_white", "line_number": 15, "usage_type": "name" }, { "api_name": "UI.Theme.Styles.White_Black", "line_number": 15, "usage_type": "name" }, { "api_name": "UI.Theme.Styles.Sleep_Red", "line_number": 15, "usage_type": "name" }, { ...
446009484
import numpy as np from sklearn import svm, datasets from sklearn.cross_validation import train_test_split from sklearn.multiclass import OneVsRestClassifier from sklearn_evaluation import ClassifierEvaluator # Import some data to play with iris = datasets.load_iris() X = iris.data y = iris.target # Add noisy featur...
null
examples/generate_report.py
generate_report.py
py
1,492
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 9, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 9, "usage_type": "name" }, { "api_name": "numpy.random.RandomState", "line_number": 14, "usage_type": "call" }, { "api_name": "nu...
553055567
import pygame import globals class Enemy(pygame.sprite.Sprite): def __init__(self, color, pos, player): super().__init__() self.color = color self.image = pygame.Surface([20, 20]) self.image.fill(color) self.image.set_colorkey((255, 255, 255)) self.rect = self.i...
null
entities/enemy.py
enemy.py
py
928
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.sprite", "line_number": 5, "usage_type": "attribute" }, { "api_name": "pygame.Surface", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.math.Vector2", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.math", ...
410849924
from datetime import datetime as dt from time import time import requests from common_components.orderbook import OrderBook import numpy as np class CoinbaseOrderBook(OrderBook): def __init__(self, sym): super(CoinbaseOrderBook, self).__init__(sym, 'coinbase') self.sequence = 0 def _get_book...
null
coinbase_connector/coinbase_orderbook.py
coinbase_orderbook.py
py
5,111
python
en
code
null
code-starcoder2
66
[ { "api_name": "common_components.orderbook.OrderBook", "line_number": 8, "usage_type": "name" }, { "api_name": "time.time", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "time.time...
77417560
import collections from math import sqrt import sys import numpy as np def calculate_diagonal(m): result = 1 for i in range(min(len(m), len(m[0]))): if m[i][i] != 0: result = result * m[i][i] return result def multiset_equal(x, y): first_set = collections.Counter(x...
null
functions.py
functions.py
py
1,744
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Counter", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 17, "usage_type": "call" }, { "api_name": "sys.maxsize", "line_number": 22, "usage_type": "attribute" }, { "api_name": "numpy.array"...
180070608
import numpy as np import matplotlib.pyplot as plt from math import sin, pi import scipy.signal as signal def heterodyne(stageName, t, p, rfreq, ifreq, fs_rf, fs_if, aa_cut, plots=True): # Stage 1: RF-IF1 # Design/build AA filter IF1osc = rfreq - ifreq IF1AAcutoff = aa_cut digcut = IF1AAcutoff/fs_r...
null
Radar/RFGenerator.py
RFGenerator.py
py
2,992
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.signal.firwin", "line_number": 14, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "math.sin", "line_num...
166562011
import json SPEED_OUTPUT_PATH = "./output/speed_meta.json" FACE_OUTPUT_PATH = "./output/face_meta.json" HAND_OUTPUT_PATH = "./output/hand_meta.json" class MetaCollector: def __init__(self): self._frame_number = 0 self._data = [] self._hands = {'left_hand': [], 'right_hand': []} def p...
null
project/solution/meta_collector.py
meta_collector.py
py
2,340
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dump", "line_number": 65, "usage_type": "call" } ]
258103828
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader from urlparse import urljoin as urljoin_rfc from scrapy.utils.response import get_base_url from product_spiders....
null
e-commerce/CompetitorMonitor/product_spiders/spiders/qatesting2/alexanderandjames_com.py
alexanderandjames_com.py
py
8,058
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.spider.BaseSpider", "line_number": 15, "usage_type": "name" }, { "api_name": "scrapy.xlib.pydispatch.dispatcher.connect", "line_number": 28, "usage_type": "call" }, { "api_name": "scrapy.xlib.pydispatch.dispatcher", "line_number": 28, "usage_type": "...
457582573
__author__ = 'YaelSegal & TzeviyaFuchs' # VGG model was taken from Yossi Adi import torch.nn as nn import torch.nn.functional as F import torch def _make_layers(cfg, kernel=3): layers = [] in_channels = 1 for x in cfg: if x == 'M': layers += [nn.MaxPool2d(kernel_size=2, stride=2)] ...
null
model_speech_yolo.py
model_speech_yolo.py
py
5,782
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.MaxPool2d", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
397261697
import numpy as np import pandas as pd from tensorflow.keras.models import Sequential, Model, load_model from tensorflow.keras.layers import Dense, LSTM, Conv1D, Input, Flatten, MaxPooling1D, Dropout, Reshape, SimpleRNN, LSTM, LeakyReLU, GRU, Conv2D, MaxPool2D, BatchNormalization, Activation from tensorflow.keras.c...
null
dacon/solar/py/ff.py
ff.py
py
10,950
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 35, "usage_type": "call" }, { "api_name": "pandas.concat", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.cos", "line_n...
421702277
# -*- coding: utf-8 -*- """ Created on Sun Aug 23 00:38:00 2020 @author: BT """ ''' In semantic segmentation, each pixel is classified according to the class of the object it belongs to (e.g., road, car, pedestrian, building, etc.), as shown in Figure 14-26. Note that different objects of the same class are not disti...
null
DL/14_DeepCVusingCNN/10_semantic_segmentation.py
10_semantic_segmentation.py
py
8,226
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.reduce_min", "line_number": 50, "usage_type": "call" }, { "api_name": "tensorflow.reduce_max", "line_number": 50, "usage_type": "call" }, { "api_name": "sklearn.datasets.load_sample_image", "line_number": 53, "usage_type": "call" }, { "ap...
619274547
#!/usr/bin/env python """Application that calculates the domain architecture of each gene and outputs them in a simple text-based format. """ from __future__ import print_function from collections import defaultdict import operator import sys import re from gfam.assignment import AssignmentOverlapChecker from gfam.ass...
null
gfam/scripts/find_domain_arch.py
find_domain_arch.py
py
23,183
python
en
code
null
code-starcoder2
66
[ { "api_name": "gfam.scripts.CommandLineApp", "line_number": 23, "usage_type": "name" }, { "api_name": "gfam.utils.redirected", "line_number": 125, "usage_type": "call" }, { "api_name": "gfam.assignment.AssignmentOverlapChecker.max_overlap", "line_number": 135, "usage_type...
469951562
import numpy as np import pandas as pd from random import randint import random import argparse import time import itertools, collections import networkx as nx import matplotlib.pyplot as plt # Patent Cit. dataset with 7515023 Triangles and Fraction of closed triangles 0.02343 -- 16518948 edges # Adolescent health dat...
null
min_data_streams/main.py
main.py
py
5,481
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "networkx.from_edgelist", "line_number": 48, "usage_type": "call" }, { "api_name": "networkx.triangles", "line_number": 49, "usage_type": "call" }, { "api_name": "mat...
585031671
import torch import torch.nn as nn import numpy as np from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F import torch.optim as optim from tqdm.notebook import tqdm import math import copy import random #-----------------------------------------Model Definition----------------------------...
null
hw4&5/kq4ff-stackedlstm-rnnlm.py
kq4ff-stackedlstm-rnnlm.py
py
7,343
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 13, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line...
158122452
import json import os from PyQt5.QtWidgets import QLabel, QWidget, QPushButton, QFormLayout, QLineEdit, QHBoxLayout, QVBoxLayout from PyQt5.QtGui import QIntValidator from PyQt5.QtCore import pyqtSignal, Qt from fitness_tracker.database_wrapper import DatabaseWrapper class UpdateLiftsForRepsWindow(QWidget): change_l...
null
fitness_tracker/notes/compound_exercises/update_lifts_for_reps_window.py
update_lifts_for_reps_window.py
py
8,504
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 8, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 9, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.pyqtSignal", "line_number": 10, "usage_type": "call" }, { "api_name": ...
312034555
# Copyright 2018 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
null
mlrun/runtimes/base.py
base.py
py
39,958
python
en
code
null
code-starcoder2
66
[ { "api_name": "model.ModelObj", "line_number": 56, "usage_type": "name" }, { "api_name": "model.ModelObj", "line_number": 62, "usage_type": "name" }, { "api_name": "model.ModelObj", "line_number": 70, "usage_type": "name" }, { "api_name": "model.ModelObj", "li...
457624286
from django.shortcuts import render from django.contrib.auth.decorators import login_required from catalog.models.country import Country @login_required def countries(request): """ Страница списка стран :param request: :return: """ countries = Country.objects.all template = 'user/country_...
null
catalog/views/user_views/lists/country_list.py
country_list.py
py
451
python
en
code
null
code-starcoder2
66
[ { "api_name": "catalog.models.country.Country.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "catalog.models.country.Country", "line_number": 14, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 19, "usage_type": "ca...
346418181
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('blog', '0001_initial'), ] operations = [ migrations.CreateModel( ...
null
blog/migrations/0002_auto_20150510_2004.py
0002_auto_20150510_2004.py
py
1,242
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 16, "usage_type": "call" }, ...
640558266
import numpy as np def str_to_list(string): #print(string) #string= string[1:-1] listt= string.split(", ") listt2=[] for i in range(0,len(listt)): #print(listt[i]) #listt2.append(float(listt[i][1:-1])) listt2.append(float(listt[i])) return listt2 def get_data_bumps(filename1, data_with_labels): file1...
null
randomForestClassifier.py
randomForestClassifier.py
py
3,003
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.__version__", "line_number": 73, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 110, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 111, "usage_type": "call" }, { "api_name": "sklearn.utils.shuf...
643199375
# stmfile generator from PIL import Image import numpy as np import cv2 from itertools import product # meta settings NOCONVERT = False NOMOVIE = False filepath = "./10square_stripe05.stm" # settings width = 10 height = 10 frame = 100 fps = 10 total_time = frame / fps current_max = 0.5 # making arrays...
null
util/stmgenerater/stmgenerater.py
stmgenerater.py
py
2,637
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.full", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.copy", "line_number": 34,...
201035224
import sys, os import pygame as pg import numpy as np from pygame.locals import * from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QFrame, QAction, QPushButton, QTabWidget, QVBoxLayout, QToolBar, QListWidget, QOpenGLWidget from PyQt5.QtGui import QIcon, QCursor, QMouseEvent, QPixmap from PyQt5.QtOpenGL i...
null
gui/Gui2.py
Gui2.py
py
10,032
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt5.QtGui.QIcon", "line_number": 25, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 43, "usage_type": "name" }, { "api_name": ...
134170742
__author__ = 'Fabian' import zipfile class ModFile(): def __init__(self, path): self.path = path def check(self): try: zip = zipfile.ZipFile(self.path) zip.testzip() files = zip.namelist() info = False for file in files: ...
null
FactorioManager/ModFile.py
ModFile.py
py
668
python
en
code
null
code-starcoder2
66
[ { "api_name": "zipfile.ZipFile", "line_number": 10, "usage_type": "call" } ]
484568761
# По данной непустой строке s длины не более 104, состоящей из строчных букв латинского алфавита, # постройте оптимальный беспрефиксный код. В первой строке выведите количество различных букв k, # встречающихся в строке, и размер получившейся закодированной строки. # В следующих k строках запишите коды букв в формате "...
null
Greedy_algorithms/Huffman/Huffman_1.py
Huffman_1.py
py
4,139
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Counter", "line_number": 93, "usage_type": "call" } ]
354119698
__author__ = 'iacopo' from flask import request from flask.ext.restful import Resource from flask.ext.restful import marshal_with from flask.ext.restful import reqparse from sqlalchemy.exc import IntegrityError from sqlalchemy.orm.exc import NoResultFound from dao.ide_usage import IdeUsage from dao.discipline_member ...
null
src/api/resources.py
resources.py
py
2,197
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.ext.restful.Resource", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.ext.restful.reqparse.RequestParser", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.ext.restful.reqparse", "line_number": 21, "usage_type": "name" ...
452718791
import ast import os import json import binascii import astor class ConstantParam(object): def __init__(self, node): self.node = node def get_name(self): for target in self.node.targets: if isinstance(target, ast.Name): return target.id def set_value(self, val...
null
docker/comagic-web/configure/configurator.py
configurator.py
py
5,869
python
en
code
null
code-starcoder2
66
[ { "api_name": "ast.Name", "line_number": 14, "usage_type": "attribute" }, { "api_name": "ast.Dict", "line_number": 26, "usage_type": "attribute" }, { "api_name": "ast.Str", "line_number": 35, "usage_type": "attribute" }, { "api_name": "ast.Str", "line_number":...
188294844
import argparse import collections import logging import os from utils.misc import intervals_genomic_sort_order, parse_interval logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s') def parse_args(): p = argparse.ArgumentParser(description="Combine repeat regions .bed files") ...
null
docker/base-scripts/simulate/combine_repeat_regions_bed_files.py
combine_repeat_regions_bed_files.py
py
3,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.b...
363378016
import json import requests __author__ = 'Kozo Nishida' __email__ = 'knishida@riken.jp' __version__ = '0.0.1' __license__ = 'MIT' def escher2cyelements(escher_json_url): r = requests.get(escher_json_url) data = json.loads(r.content) escher_nodes = data[1]['nodes'] # escher_edges = cyelements = {} ...
null
escher2cyjs.py
escher2cyjs.py
py
1,225
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 44, "usage_type": "call" } ]
327286289
# import modules import os import requests import telegram import time from datetime import datetime from wallets_dict import wallets from config import limit, transactions, contract, looptime, my_token, filename, api_key def get_OPQ_prices(): request_ETH = requests.get( 'https://api.kucoin.com/v1/open/ti...
null
signals_blockchain.py
signals_blockchain.py
py
6,463
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
470860205
import numpy as np import json def read_layer(data, json_index) -> np.ndarray: size_in = int(data[json_index]['size_in']) size_out = int(data[json_index]['size_out']) weights = data[json_index]['weights'] matrix = np.zeros([size_in, size_out]) for x in data[json_index]['weights']: for y in ...
null
neural_network.py
neural_network.py
py
1,285
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number": 4, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number":...
319870563
from typing import Generator import requests from bs4 import BeautifulSoup def get_category_link(category_name: str)-> str: page = requests.get('http://books.toscrape.com/') soup = BeautifulSoup(page.content, 'html.parser') for link in soup.find_all('a'): if category_name == link.text.strip(): ...
null
main.py
main.py
py
1,469
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "li...
650050928
from uuid import uuid4 import tornado from .board import Board class PlayerValueError(ValueError): pass class MoveValueError(ValueError): pass class Game: MAX_PLAYERS = 2 STATE_MATCHMAKING = 'matchmaking' STATE_IN_PROGRESS = 'in_progress' STATE_FINISHED = 'finished' def __init__(sel...
null
solution/api/tictactoe/engine/game.py
game.py
py
1,741
python
en
code
null
code-starcoder2
66
[ { "api_name": "uuid.uuid4", "line_number": 23, "usage_type": "call" }, { "api_name": "board.Board", "line_number": 26, "usage_type": "call" } ]
303921844
from flask import Blueprint ,render_template,request from flask_login import login_required, current_user from .models import Upload views = Blueprint('views', __name__) @views.route('/', methods=['GET', 'POST']) @login_required def home(): if request.method == 'POST': note = request.form.get(...
null
Flask web app/Website/views.py
views.py
py
711
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "flask.request....
83528832
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponseBadRequest, HttpResponse from django.urls import reverse from .models import Squawk # Create your views here. def index(request): if(request.method == 'POST'): post_text = request.POST['post_text'] if(l...
null
squawkerApp/views.py
views.py
py
678
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.http.HttpResponseBadRequest", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Squawk", "line_number": 16, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 18, "usage_type": "call" }, { ...
94270874
import json import sys import os from collections import OrderedDict right_answers_path = sys.argv[1] right_answers = os.path.join(right_answers_path, 'right_answers.json') # right_answers = os.path.join(right_answers_path, 'overcome.json') print("found right answers:", right_answers) with open("/data2/ymeng/dolphin1...
null
scripts/auto_correct.py
auto_correct.py
py
819
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 1...
565764513
import traceback, logging import json from web.conf.return_conf import * from web.lib.request_api import Request_api from django.http import HttpResponse, HttpResponseServerError class insert_new_bok_report(): logger = logging.getLogger('web') logger_access = logging.getLogger('access') def __init__(self, reque...
null
web/htdocs/ajax/insert_new_bok_report.py
insert_new_bok_report.py
py
2,793
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "web.lib.request_api.Request_api", "line_number": 69, "usage_type": "call" }, { "api_name": "dj...
101717945
author = 'Simon Kohl, Paul Jaeger, June 2017' from abc import abstractmethod from collections import OrderedDict from copy import deepcopy import lasagne import cPickle from lasagne.layers import get_output, get_all_params, get_all_layers from lasagne.objectives import categorical_crossentropy from lasagne.updates imp...
null
DeepTrainerUtils/AbstractClassificationNet.py
AbstractClassificationNet.py
py
6,081
python
en
code
null
code-starcoder2
66
[ { "api_name": "abc.abstractmethod", "line_number": 31, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 42, "usage_type": "call" }, { "api_name": "theano.tensor.tensor4", "line_number": 47, "usage_type": "call" }, { "api_name": "thea...
129461879
#!/usr/bin/env python3 # -*- coding:utf-8 -*- u""" Created by ygidtu@gmail.com at 2018.11.25 Collect input fq.gz files, and assign SE PE output prefix to it """ import configparser as cp import glob import json import os import re from itertools import chain def __check_directory__(in_dir): U""" check whethe...
null
src/collect_fq.py
collect_fq.py
py
5,305
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_n...
355204796
from meta_mb.utils.networks.mlp import create_rnn from meta_mb.policies.distributions.discrete import Discrete from meta_mb.policies.base import Policy from meta_mb.utils import Serializable from meta_mb.utils.utils import remove_scope_from_name from meta_mb.logger import logger import tensorflow as tf import tensorfl...
null
meta-mb-internal/meta_mb/policies/discrete_rnn_with_cnn.py
discrete_rnn_with_cnn.py
py
15,835
python
en
code
null
code-starcoder2
66
[ { "api_name": "meta_mb.policies.base.Policy", "line_number": 35, "usage_type": "name" }, { "api_name": "meta_mb.utils.Serializable.quick_init", "line_number": 56, "usage_type": "call" }, { "api_name": "meta_mb.utils.Serializable", "line_number": 56, "usage_type": "name" ...
480225370
from reportlab.platypus import Paragraph, Table, TableStyle from reportlab.lib.units import inch from reportlab.lib import colors from PDFAttachment import PDFAttachment from taa.services.docusign.service import BasePDFDoc from utils import style, bold_style2, NumberedCanvas, create_attachment_header class Addition...
null
taa/services/docusign/documents/additional_replacement_policies.py
additional_replacement_policies.py
py
4,001
python
en
code
null
code-starcoder2
66
[ { "api_name": "PDFAttachment.PDFAttachment", "line_number": 11, "usage_type": "name" }, { "api_name": "taa.services.docusign.service.BasePDFDoc.__init__", "line_number": 13, "usage_type": "call" }, { "api_name": "taa.services.docusign.service.BasePDFDoc", "line_number": 13, ...
258495896
import networkx as nx from math import cos, sin, pi from algorithms import a_start, dijkstra def get_attr_val(G, node, attribute): if node in G.nodes: return G.nodes[node][attribute] def remove_node_util(G, node): if node in G.nodes: G.remove_node(node) def add_node_util(G, node): if...
null
functions.py
functions.py
py
1,448
python
en
code
null
code-starcoder2
66
[ { "api_name": "math.cos", "line_number": 40, "usage_type": "call" }, { "api_name": "math.pi", "line_number": 40, "usage_type": "name" }, { "api_name": "math.sin", "line_number": 40, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 41, "usag...
543228044
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os import re from collections import OrderedDict, defaultdict from datetime import datetime from pprint import pprint import tqdm import yaml from geopy.extra.rate_limiter import RateLimiter from geopy.geocoders import Nominatim from ranking.managem...
null
ranking/management/modules/neerc_ifmo_school.py
neerc_ifmo_school.py
py
9,728
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "ranking.management.modules.common.BaseModule", "line_number": 22, "usage_type": "name" }, { "...
639771259
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ configuration module for gstatic: it includes the routines to modify work of application""" import os import sys import tempfile import datetime from sgglobals import * from configparser import ConfigParser # # class CaseConfigParser(ConfigParser): """subclassing necessa...
null
sgconf.py
sgconf.py
py
8,496
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "os.path.exists", ...
17204822
#!/usr/bin/env python # Traces from opentelemetry import trace from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import SimpleSpanProcessor from opentelemetry.instrumentation.flask import FlaskInstrumentor from opentelemetry.exporter.jaeger.thrift import JaegerExporter from opentel...
null
sender/main.py
main.py
py
2,266
python
en
code
null
code-starcoder2
66
[ { "api_name": "opentelemetry.exporter.jaeger.thrift.JaegerExporter", "line_number": 27, "usage_type": "call" }, { "api_name": "opentelemetry.trace.set_tracer_provider", "line_number": 32, "usage_type": "call" }, { "api_name": "opentelemetry.trace", "line_number": 32, "usa...
624234264
# -*- encoding: utf-8 -*- import numpy as np def loadDataSet(fileName): numFeat = len(open(fileName).readline().split('\t')) - 1 dataMat = [] labelMat = [] fr = open(fileName) for line in fr.readlines(): lineArr = [] curLine = line.strip().split('\t') for i in range(numFeat...
null
02.机器学习实战/08.线性回归/codes/regression.py
regression.py
py
8,930
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.mat", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.linalg.det", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number"...
636424397
from music21 import * import numpy as np import os import torch import time import random from torch import nn from torch import optim import torch.utils.data as Data from torch.autograd import Variable from imblearn.over_sampling import RandomOverSampler device = torch.device("cuda:0" if torch.cuda.is_available() el...
null
generation_frommodel.py
generation_frommodel.py
py
4,990
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.device", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.nn.Module"...
547981540
''' Maria Cioffi, Cole Conte, Andrew Kirna httpserver.py Last Edited: Mon Nov 30 2015 Revised from a sample Python Server from Xiannong Meng, which was in turn revised from the code segments: http://stackoverflow.com/questions/23264569/python-3-x-basehttpserver-or-http-server and https://wiki.python.org/moin/BaseHttpSe...
null
httpserver.py
httpserver.py
py
5,928
python
en
code
null
code-starcoder2
66
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 27, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 51, "usage_type": "call" }, { "api_name": "os.open",...
200321826
# -*- coding: cp932 -*- import time import sys from sys import platform as _platform from datetime import datetime, date, timedelta from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from sele...
null
tc_common.py
tc_common.py
py
11,328
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.INFO", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 33, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 34, "usage_type": "call" }, { "api_name": "selenium.webdri...
337975908
# -*- coding:utf-8 -*- from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine from bottle.ext import sqlalchemy as bs Model = declarative_base() plugin = None create_session = None def init(app): global plugin, create_session eng...
null
wa/database.py
database.py
py
597
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 9, "usage_type": "call" }, { "api_name": "sqlalchemy.create_engine", "line_number": 16, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.sessionmaker", "line_number": 17, "usage_type": "call"...
138503523
# The MIT License (MIT) # # Copyright (c) 2015 Philippe Proulx <eepp.ca> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
null
lttngc/model.py
model.py
py
6,808
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 28, "usage_type": "attribute" }, { "api_name": "enum.unique", "line_number": 27, "usage_type": "attribute" }, { "api_name": "enum.Enum", "line_number": 37, "usage_type": "attribute" }, { "api_name": "enum.unique", "lin...
308943387
# 给你一个整数数组 coins 表示不同面额的硬币,另给一个整数 amount 表示总金额。 # # 请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额,返回 0 。 # # 假设每一种面额的硬币有无限个。 # # 题目数据保证结果符合 32 位带符号整数。 # # # # # # # 示例 1: # # # 输入:amount = 5, coins = [1, 2, 5] # 输出:4 # 解释:有四种方式可以凑成总金额: # 5=5 # 5=2+2+1 # 5=2+1+1+1 # 5=1+1+1+1+1 # # # 示例 2: # # #...
null
[518]零钱兑换 II.py
[518]零钱兑换 II.py
py
1,900
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 56, "usage_type": "name" } ]
149618261
from django.conf.urls import url from django.contrib.auth.decorators import login_required from django.views.generic.edit import UpdateView, DeleteView from django.views.generic import DetailView from .models import Photo, Album from .views import PHOTO_FORM_FIELDS, ALBUM_FORM_FIELDS from .views import PhotoCreate, Al...
null
imager_images/urls.py
urls.py
py
2,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "django.contrib.auth.decorators.login_required", "line_number": 13, "usage_type": "call" }, { "api_name": "views.LibraryView.as_view", "line_number": 13, "usage_type": "call" ...
415607032
# -*- coding: utf-8 -*- # 3rd party library try: from urllib.parse import urljoin from urllib.parse import urlencode import urllib.request as urlrequest except ImportError: from urlparse import urljoin from urllib import urlencode import urllib2 as urlrequest import json import time class Sl...
null
slackweb/slackweb.py
slackweb.py
py
1,511
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib2.build_opener", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib2.HTTPHandler", "line_number": 21, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": "urllib.urlencode"...
498041910
try: import argparse except ImportError: print("Please check if module 'argparse' is installed") quit() parser = argparse.ArgumentParser() parser.add_argument('--tab', type=argparse.FileType('r'), required=True) parser.add_argument('--out', type=str) args = parser.parse_args() def table_parsi...
null
NeuroPep_fasta_prep.py
NeuroPep_fasta_prep.py
py
1,403
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "argparse.FileType", "line_number": 8, "usage_type": "call" } ]
29144765
import pysam import pandas as pd import os def depth_combine(samples, bed, batch_out, name_list): bed_df = pd.read_csv(bed, header = None, sep = '\t') try: df = pd.DataFrame({'chr': bed_df[0], 'start': bed_df[1], 'end': bed_df[2], ...
null
src/depth.py
depth.py
py
1,221
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.isfile", ...
126000740
from bottomup_cluster import * import matplotlib.pyplot as plt X = np.loadtxt("s1.txt") c = AggloClustering(X[0:5000, :]) clusters = c.cluster(15, linkage="average") LABEL_COLOR_MAP = ['b','g','r','c','m','y','k'] [plt.scatter(cluster[:, 0], cluster[:, 1], c=LABEL_COLOR_MAP[i], marker='+') for i, cluster in enumerate...
null
bottom up clustering/main.py
main.py
py
1,223
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 10, "usage_type": "call" }, { "api_name": "m...
93056293
import psycopg2 import pandas as pd host = 'localhost' dbname = 'audioforma' user = 'postgres' conn = psycopg2.connect(f"host={host} dbname={dbname} user={user}") cur = conn.cursor() songs = pd.read_csv('songs.csv').iterrows() for idx, s in songs: cur.execute( ''' INSERT INTO song (song_t...
null
static/data/import_csv.py
import_csv.py
py
562
python
en
code
null
code-starcoder2
66
[ { "api_name": "psycopg2.connect", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" } ]
645709859
import pyupbit import numpy as np import time from datetime import datetime import pandas as pd start_time = datetime.now() tickers = pyupbit.get_tickers(fiat="KRW") start_day = datetime(2021,8,10) today = datetime.now() days = days = (today-start_day).days ################################################ Function ...
null
Backtest_bol.py
Backtest_bol.py
py
3,736
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "name" }, { "api_name": "pyupbit.get_tickers", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.dat...
196233136
from bs4 import BeautifulSoup import requests as req class NetworkClass(object): def __init__(self): pass def get_correct_url(self, url, source): if url[0] == "/" and source[len(source)-1] != "/" or url[0] != "/" and source[len(source) - 1] == "/": return source + url elif ...
null
app/NetworkClass.py
NetworkClass.py
py
1,339
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 34, "usage_type": "call" } ]
622119111
import logging import time import requests from urllib.parse import urlencode class RequestManager(object): """Manager of external requests.""" def __init__( self, request_timeout=30, max_retries=5, retry_interval=0, log=None ): """ Instance configuration. Args: ...
null
feed_test_api/utils/request.py
request.py
py
3,491
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 60, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 62, "usage_type": "attribute" }, { "api_name": "requests.put",...
375025873
import os from flask import Flask def create_app(test_config=None): # create and configure the app app = Flask(__name__, instance_relative_config=True) app.config.from_mapping( SECRET_KEY='dev', ) if test_config is None: # load the instance config, if it exists, when not testing ...
null
awesome_site/__init__.py
__init__.py
py
880
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 29, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 30, ...
471122063
import pyglet from random import random class Stars: def __init__(self): self.stars = [] for i in range(200): z = random() self.stars.append([int(random()*self.window.width*z), int(random()*self.window.height*z), z]) def drawstars(self): starbatch =...
null
stars.py
stars.py
py
754
python
en
code
null
code-starcoder2
66
[ { "api_name": "random.random", "line_number": 9, "usage_type": "call" }, { "api_name": "random.random", "line_number": 10, "usage_type": "call" }, { "api_name": "pyglet.graphics.Batch", "line_number": 13, "usage_type": "call" }, { "api_name": "pyglet.graphics", ...
482071496
__author__ = 'liuwei' from gensim.models import Word2Vec import logging from Common import Common from nltk.corpus import stopwords import nltk.data import numpy as np import os class Word_2_Vec(object): '''word to vec, to get the distuibuted representation of the word''' def __init__(self, train, test, unla...
null
Word_2_Vec.py
Word_2_Vec.py
py
2,649
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "gensim.models.Word2Vec.load", "line_number": 26, "usage_type": "call" }, { "api_name": "gensim.models...
356676373
import pandas as pd import pandasql # 默认读取第一个表单,直接默认读取到这个Excel的第一个表单 df = pd.read_excel('D:\\TAL\\考勤自动化\\2019年秋季教师请假汇总-更新2019.10.27-赵哲面授.xlsx', sheet_name='面授10.27') df.columns = [ 'a1', 'classid', 'a3', 'a4', 'a5', 'teacherid', 'teacher', '学期', '年部', '年级', '年份', '学科', ...
null
tal/excel/postpone.py
postpone.py
py
1,822
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_excel", "line_number": 5, "usage_type": "call" }, { "api_name": "pandasql.sqldf", "line_number": 51, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 56, "usage_type": "call" } ]
175840373
# -*- coding: utf-8 -*- """ Created on Sat Apr 4 15:49:50 2020 @author: pietertpt """ import RPi.GPIO as GPIO import os from time import sleep from http.server import BaseHTTPRequestHandler, HTTPServer host_name = '192.168.2.200' # Change this to your Raspberry Pi IP address host_port = 8000 class MyServer(BaseHT...
null
simple_webserver2.py
simple_webserver2.py
py
4,888
python
en
code
null
code-starcoder2
66
[ { "api_name": "http.server.BaseHTTPRequestHandler", "line_number": 16, "usage_type": "name" }, { "api_name": "RPi.GPIO.setmode", "line_number": 35, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 35, "usage_type": "name" }, { "api_name": "RPi.GPIO...
116507634
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
null
genshi/template/directives.py
directives.py
py
27,622
python
en
code
null
code-starcoder2
66
[ { "api_name": "genshi.template.eval.Expression", "line_number": 110, "usage_type": "call" }, { "api_name": "genshi.template.base.TemplateSyntaxError", "line_number": 115, "usage_type": "call" }, { "api_name": "six.add_metaclass", "line_number": 39, "usage_type": "call" ...
470548402
import os, fnmatch import netCDF4 as nc import numpy as np from time import time from scDataset import scDataset #from IPython import embed def gethourlyfiles(prefix, days, grid): files = [] for day in days: dirname = os.path.join(prefix, day) for item in os.listdir(dirname): if fn...
null
scDataset/test_scDataset.py
test_scDataset.py
py
3,401
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "fnmatch.fnmatchcase", "line_...
57896764
from copy import copy from django.core.exceptions import ImproperlyConfigured from django.forms import ModelForm, ModelChoiceField, ModelMultipleChoiceField from types import StringTypes from django.db.models import Model from .bundle import Bundle def model_to_dict(bundle, resource): data = {} for name, fie...
null
tastypie/validation.py
validation.py
py
3,958
python
en
code
null
code-starcoder2
66
[ { "api_name": "bundle.Bundle", "line_number": 16, "usage_type": "argument" }, { "api_name": "django.core.exceptions.ImproperlyConfigured", "line_number": 57, "usage_type": "call" }, { "api_name": "django.db.models.Model", "line_number": 65, "usage_type": "argument" }, ...
521559504
from __future__ import print_function, division import warnings import numpy as np import matplotlib.pyplot as plt from matplotlib import get_backend from matplotlib.widgets import Slider __all__ = ["echelle", "plot_echelle", "interact_echelle"] def echelle(freq, power, dnu, offset=0.0): if len(freq) != len(p...
null
echelle/echelle.py
echelle.py
py
5,047
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.intersect1d", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.median", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.arange", "line_n...
516345078
#!/usr/bin/python3 """Places file """ from api.v1.views import app_views from flask import jsonify, abort, request from models import storage from models.state import State from models.city import City from models.place import Place @app_views.route("/cities/<city_id>/places", methods=['GET', 'POST']) def places(city...
null
api/v1/views/places.py
places.py
py
2,210
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.storage.get", "line_number": 16, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.abort", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.request.method", ...
650962179
import torch import torch.nn as nn from torch.utils.data import Dataset, DataLoader, Sampler import numpy as np import random from typing import Sized, Iterator, List class Experience: def __init__(self, dvae): self.dvae = dvae self.frames = [] self.encoded_frames = [] self.rewar...
null
utils/experience.py
experience.py
py
4,624
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.tensor", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.tensor", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.stack", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.stack", "line_number"...
274409183
import pygame from paddle import Paddle from ball import Ball from random import randint pygame.init() black = (0, 0, 0) white = (255, 255, 255) screen = pygame.display.set_mode((600, 400)) pygame.display.set_caption("Pong") leftPoints = 0 rightPoints = 0 scoredict = { 0: 'zero.png', 1: 'one.png', 2: '...
null
wontrun.py
wontrun.py
py
5,196
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.display...
609332472
from tqdm import tqdm countries_set = set() for line in open('./chapter09/country.txt', 'r').readlines(): if len(line) > 2: countries_set.add(line.strip()) with open('./chapter09/corpus81.txt', 'w') as f: for line in tqdm(open('./chapter09/corpus.txt', 'r')): for country in countries_set: ...
null
wanghongfei/chapter09/knock81.py
knock81.py
py
405
python
en
code
null
code-starcoder2
66
[ { "api_name": "tqdm.tqdm", "line_number": 9, "usage_type": "call" } ]
120749197
import pdb import pyfits import numpy as np import matplotlib.cm as cmp import matplotlib.pyplot as py from matplotlib import rc from astropysics.spec import * from coaddSpectra import sigclip_coadd rc('text', usetex = True) rc('font', family = 'serif') rc('font', size = 20) hdu = pyfits.open('/Users/khamren/M31_Re...
null
Plots/Coadds/mstar_ladder.py
mstar_ladder.py
py
1,928
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.rc", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.rc", "line_number": 13, "usage_type": "call" }, { "api_name": "pyfits.open", "line_num...
437272340
from ctypes import cdll, Structure, POINTER, c_char_p, c_void_p, c_uint, c_bool, c_ulong, c_int from clang import CXUnsavedFile, CXCompletionChunkKind, CXCursorKind from sys import platform as _platform import os import re # It's not who I am underneath, # but what I do that defines me. class Batman(): def __init__(...
null
cc.py
cc.py
py
13,589
python
en
code
null
code-starcoder2
66
[ { "api_name": "clang.CXCursorKind.FIELD_DECL", "line_number": 29, "usage_type": "attribute" }, { "api_name": "clang.CXCursorKind", "line_number": 29, "usage_type": "name" }, { "api_name": "clang.CXCursorKind.FUNCTION_TEMPLATE", "line_number": 31, "usage_type": "attribute"...
130523726
import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.ticker as mticker import mpl_finance import pandas as pd import matplotlib.dates as mdates import os def plot_indicators(filename = '', coin = ''): if not filename: dataset = pd.read_csv('data\minute\price_surge_YOYOBNB.csv...
null
breakout_finder/plot.py
plot.py
py
3,531
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.p...
425399776
# TensorFlow and tf.keras import tensorflow as tf from tensorflow import keras # Helper libraries import numpy as np import matplotlib.pyplot as plt print(tf.__version__) # Import MNIST Dataset fashion_mnist = tf.keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist.l...
null
src/test_model.py
test_model.py
py
2,468
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.__version__", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tensorflow.keras", "line_number": 12, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 28, "usage_type": "call" }, { "api_nam...
2070584
""" Openface classification """ import cv2 import numpy as np np.set_printoptions(precision=2) import pandas as pd from models.model_openface import aligndlib2 as aligndlib import os import random import shutil import openface import openface.helper from openface.data import iterImgs import argparse from subprocess im...
null
models/model_openface/model_classify.py
model_classify.py
py
9,037
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.set_printoptions", "line_number": 5, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path...
643171623
import os import torch, torchvision import urllib.request import numpy as np import pandas as pd import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset import matplotlib.pyplot as plt def download_images(): """ Download players' face images. """ #...
null
utils.py
utils.py
py
2,376
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.request.request.URLopener", "line_number": 22, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 22, "usage_type": "attribute" }, { "api_...
542381356
from app.main import main from app import db from flask import render_template, flash, redirect, url_for, request, current_app, g, jsonify from flask_login import login_user, logout_user, current_user, login_required from .forms import LoginForm, RegistrationForm, EditProfileForm, PostForm, SearchForm, MessageForm from...
null
app/main/views.py
views.py
py
11,349
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask_login.current_user.is_authenticated", "line_number": 13, "usage_type": "attribute" }, { "api_name": "flask_login.current_user", "line_number": 13, "usage_type": "name" }, { "api_name": "flask_login.current_user.last_seen", "line_number": 14, "usage_ty...
187989106
import os from collections import Counter import importlib,sys import numpy as np base_dir = 'DATA' train_dir = os.path.join(base_dir, 'traindata.txt')#训练集 test_dir = os.path.join(base_dir, 'testdata.txt')#测试集 val_dir = os.path.join(base_dir, 'devdata.txt')#验证集 vocab_dir = os.path.join(base_dir, 'vocab.txt')#词汇表 stopw...
null
Dataload.py
Dataload.py
py
4,723
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, ...
57638771
import os import pandas as pd from src.preprocess import PreprocessData from sklearn import model_selection TRAIN = os.environ.get("TRAINING_DATA") TEST = os.environ.get("TEST_DATA") df_train = pd.read_csv(TRAIN) df_test = pd.read_csv(TEST) preprocessor = PreprocessData(model = "xgboost", ...
null
tabulardata/src/load_data.py
load_data.py
py
867
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ", "line_num...
218821346
""" Module for all related to registries endpoint. """ from __future__ import absolute_import import logging from flask import Blueprint from flask_restplus import Resource from flask_restplus import Api import pyba.library as lib REGISTRIES = Blueprint('registries', __name__) API = Api(REGISTRIES) @API.route("/r...
null
pyba/blueprints/registries.py
registries.py
py
1,273
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_restplus.Api", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_restplus.Resource", "line_number": 19, "usage_type": "name" }, { "api_name": "pyba.libra...
452173791
import pandas as pd import numpy as np from collections import defaultdict def load_user_data(): user_dataset = pd.read_csv("u.data",sep = "\t",header=None) user_dataset.columns = ["UserID","MovieID","Rating","Datetime"] user_dataset["Datetime"] = pd.to_datetime(user_dataset["Datetime"]) print("user_da...
null
apriori/main.py
main.py
py
1,828
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 8, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 33, "usage_type": "call" } ]
510251273
""" Module for holding and exporting file metadata as JSON documents. """ from __future__ import division import hashlib import json import logging import math from pyhull.convex_hull import qconvex class Properties(object): """ A class to hold, manipulate, and export geospatial metadata at file level. "...
null
python/src/ceda_di/metadata/product.py
product.py
py
8,303
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 32, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 51, "usage_type": "call" }, { "api_name": "pyhull.convex_hull.qconvex", "line_number": 115, "usage_type": "call" }, { "api_name": "math.ceil"...
80864909
import torch import torch.nn as nn import torch.nn.functional as F import torch.autograd as autograd class Decoder(nn.Module): def __init__(self, vocab_size, hidden_dim, embed_dim, output_dim, n_layers=1): super(Decoder, self).__init__() self.n_layers = n_layers self.hidden_dim = hidden_d...
null
decoder.py
decoder.py
py
1,019
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.nn", "line_n...
389519822
import datetime import json import requests def main(): file = open('/Users/lyj/Downloads/coinget_pk', 'w') size = 0 for i in range(1, 10000): r = requests.get( 'https://coinget.vip/api/index/listNewDrawnPeriod?pageNo=' + str(i) + '&pageSize=99&zoneList=3') resJson = json.loa...
null
script/spider.py
spider.py
py
1,122
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.d...
369902371
from django.http import Http404 from django.shortcuts import get_object_or_404 from dataworkspace.apps.datasets.models import DataSet from dataworkspace.apps.datasets.constants import DataSetType def find_dataset(dataset_uuid, user): dataset = get_object_or_404(DataSet.objects.live(), id=dataset_uuid) if us...
null
dataworkspace/dataworkspace/apps/datasets/utils.py
utils.py
py
917
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 9, "usage_type": "call" }, { "api_name": "dataworkspace.apps.datasets.models.DataSet.objects.live", "line_number": 9, "usage_type": "call" }, { "api_name": "dataworkspace.apps.datasets.models.DataSet.objects", ...
379153695
#Bayesian Neural Network import numpy as np import numpy.random as npr import tensorflow as tf import random import math from os.path import expanduser home = expanduser("~") import time import pickle from utils import log_normal3 class BNN(object): def __init__(self, network_architecture, act_func, batch_s...
null
BVAE/BVAE_3jul2017/BNN.py
BNN.py
py
4,624
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.Variable", "line_number": 57, "usage_type": "call" }, { "api_name": "tensorflow.random_normal", "line_number": 57, "usage_type": "call" }, { "api_name": "tenso...
49506620
#!/usr/bin/python import requests from PIL import Image import sys from datetime import datetime import CredentialManager ####################################################################### # Written by Ryan D'souza # # Takes a link, calls PDFLayer's API to get a PDF representation # Of the text at that link # ...
null
Python/TextPDF.py
TextPDF.py
py
2,133
python
en
code
null
code-starcoder2
66
[ { "api_name": "CredentialManager.get_value", "line_number": 25, "usage_type": "call" }, { "api_name": "CredentialManager.get_value", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 35, "usage_type": "attribute" }, { "api_name": ...
174619031
from datetime import datetime import pymysql.cursors class cal: """Đây là class tính phí""" total = "" def __init__(self,con,dnhan,dtra,idkm,idlphong,idti): self.con = con self.dnhan = dnhan self.dtra = dtra self.idkm = idkm self.idlphong = idlphong self.idti...
null
assitant/calucate.py
calucate.py
py
1,840
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.strptime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.strptime", "line_number": 18, "usage_type": "call" }, { "api_name"...