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
269149666
import numpy as np import matplotlib.pyplot as plt infile = open('output.txt','r') header_size = int(infile.readline().rstrip()) m = int(infile.readline().rstrip()) h = float(infile.readline().rstrip()) numproc = int(infile.readline().rstrip()) infile.close() data = np.genfromtxt('output.txt',skip_header=header_size)...
null
week3/plotter.py
plotter.py
py
836
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.genfromtxt", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subp...
515376614
''' Predict demand for bikes and empty docks based on historical data ''' import pandas as pd import numpy as np from sklearn.tree import DecisionTreeRegressor from sklearn.metrics import mean_absolute_error #===================================================================== # Function to learn decision tree regre...
null
models/predict_demand.py
predict_demand.py
py
3,397
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeRegressor", "line_number": 58, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeRegressor", "line_number": 59, "usage_type": "call" } ]
47487292
#!/usr/bin/python3 from __future__ import print_function from message.message_pb2 import RequestV1, RequestV2, ResponseV1, ResponseV2 import numpy as np import yaml from keras.models import model_from_yaml, model_from_json import os import socket from struct import pack def load_model_and_weights(model_name = 'model.1...
null
server.py
server.py
py
5,272
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "keras.models.model_from_json", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join",...
167967850
# Quick Python Exercise: Requests and Collections :flag-fr: # Given this resource: https://github.com/thm/uinames , read the documentation and extract 25 random names, both male and female, from France. Also count all the names by gender # Example Output: # {'name': 'Maxence', 'surname': 'Prevost', 'gender': 'male', 'r...
null
Modules/collections_module/dev_exercise/elijah_france.py
elijah_france.py
py
1,197
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 21, "usage_type": "call" } ]
517124325
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/2/5 14:35 # @Author : zhujinghui # @File : binance_websocket.py # @Software: PyCharm import pymysql from binance.client import Client from binance.websockets import BinanceSocketManager from DBUtils.PooledDB import PooledDB from decimal impor...
null
binance/dev/order_book_new.py
order_book_new.py
py
5,385
python
en
code
null
code-starcoder2
83
[ { "api_name": "binance.client.Client", "line_number": 31, "usage_type": "call" }, { "api_name": "binance.websockets.BinanceSocketManager", "line_number": 32, "usage_type": "call" }, { "api_name": "DBUtils.PooledDB.PooledDB", "line_number": 37, "usage_type": "call" } ]
148849443
from time import sleep import math import Map import numpy as np from pygame.math import Vector2 from scipy.spatial.distance import euclidean import scipy.spatial.distance as ds from geometry import line_intersection, line class Car: def __init__(self, x, y, angle=270.0, length=10): self.position = Vecto...
null
geneticAlgorithmLearning/Car.py
Car.py
py
4,835
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.math.Vector2", "line_number": 14, "usage_type": "call" }, { "api_name": "pygame.math.Vector2", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.around", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.around", ...
533594234
from __future__ import absolute_import, print_function, unicode_literals from ..tlib import NamedTemporaryFile, TestCase from ..impl.bool import FF, TT from ..impl.path import Y_path from pathlib import Path def setup(): p = Y_path(0, r'1') s = p.fp() j = Path(r'0', r'1').__str__() return p, s, j c...
null
root/test/_4path.py
_4path.py
py
923
python
en
code
null
code-starcoder2
83
[ { "api_name": "impl.path.Y_path", "line_number": 10, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 12, "usage_type": "call" }, { "api_name": "tlib.TestCase", "line_number": 16, "usage_type": "name" }, { "api_name": "impl.bool.FF", "line_...
157586531
import os import pickle, json, datetime import matplotlib import matplotlib.dates as md import matplotlib.pyplot as plt import matplotlib.patches as mp import numpy as np import fox_telem # Globals years = md.YearLocator() # every year months = md.MonthLocator(interval=1) # every month weeks = md.WeekdayLocator(by...
null
plot/upsets_mplt.py
upsets_mplt.py
py
1,726
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.dates.YearLocator", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.dates", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.dates.MonthLocator", "line_number": 13, "usage_type": "call" }, { "api_n...
153490113
from segbuild import seg_builder import argparse if __name__ == '__main__': parser = argparse.ArgumentParser(description='hey') parser.add_argument('-cidr', dest='cidr', help='Please enter a CIDR (ex: 192.168.1.0/24)') args = parser.parse_args() if not args.cidr: parser.print_help() exit(1) seg_bu...
null
langs/python/tests/networking/segmain.py
segmain.py
py
337
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "segbuild.seg_builder", "line_number": 14, "usage_type": "call" } ]
425226333
from data.dataAPI import dataAPI from models.contracts import Contract class ContractLogic: def __init__(self): self.data = dataAPI() def all_contracts(self): return self.data.get_contracts() def create_contract(self, a_list): new_contract = Contract(self.data.new_contract_...
null
Program/logic/ContractsLogic.py
ContractsLogic.py
py
1,620
python
en
code
null
code-starcoder2
83
[ { "api_name": "data.dataAPI.dataAPI", "line_number": 8, "usage_type": "call" }, { "api_name": "models.contracts.Contract", "line_number": 15, "usage_type": "call" } ]
521184386
import logging import datetime import os import urllib2 from elasticsearch_dsl.query import Q, MultiMatch, Term from designsafe.apps.data.models.elasticsearch import IndexedFile #pylint: disable=invalid-name logger = logging.getLogger(__name__) #pylint: enable=invalid-name class FileManager(object): """Elasticsea...
null
designsafe/apps/data/managers/elasticsearch.py
elasticsearch.py
py
2,011
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "designsafe.apps.data.models.elasticsearch.IndexedFile.search", "line_number": 23, "usage_type": "call" }, { "api_name": "designsafe.apps.data.models.elasticsearch.IndexedFile", "line_n...
259500181
# 模板包 封装好的。不用分步骤去使用模板文件 # redirect 网页跳转包 # render 是渲染 # reverse 反向解析 from django.shortcuts import render, redirect, reverse from django.http import HttpResponse, JsonResponse # 导入加载模板文件包 from django.template import loader # 导入定义模板上下文的包 from django.template import RequestContext # 导入模型类包 from .models import BookInfo...
null
test1/booktest/views.py
views.py
py
13,468
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 62, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 68, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 73, "usage_type": "call" }, { "api_name"...
18155068
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jul 9 14:24:52 2017 @author: mmrosek """ from skimage.filters import threshold_otsu, rank, threshold_local try: from skimage import filters except ImportError: from skimage import filter as filters import matplotlib.pyplot as plt import numpy a...
null
Connected Components Analysis/cca_4_5_llo_1_full_vid_seg_cells_updated_7_26.py
cca_4_5_llo_1_full_vid_seg_cells_updated_7_26.py
py
6,972
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 50, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 51, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_pdf.PdfPages", "line_number": 5...
371101529
#!/usr/bin/env python from datetime import datetime import os import subprocess import boto3 import yaml TIMESTAMP = datetime.utcnow().isoformat().replace(':', '').replace('-', '') SETTINGS = yaml.safe_load(open(os.path.expanduser("~/.hexagony.net.yaml"))) BUCKET = SETTINGS["bucket"] CLOUDFRONT_DISTRIBUTION_ID = SETT...
null
scripts/deploy.py
deploy.py
py
2,827
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.utcnow", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "name" }, { "api_name": "yaml.safe_load", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.expan...
105077345
import datetime def dif_time(): time_1 = input("Input first date Ymd without spaces: ") time_dt_1 = datetime.datetime.strptime(time_1, '%Y%m%d') time_2 = input("Input second date Ymd without spaces: ") time_dt_2 = datetime.datetime.strptime(time_2, '%Y%m%d') delta = time_dt_2 - time_dt_1 days ...
null
Practice/a.isaev/Homework_lec_7/Homework_lection_7_task_1.py
Homework_lection_7_task_1.py
py
696
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 6, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 6, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 8, "usage_type": "call" }, { "api_nam...
165674999
# coding=utf-8 # Q124: # Write a function char_freq() that takes a string and builds a frequency listing of the characters # contained in it. # Represent the frequency listing as a Python dictionary. # Try it with something like char_freq("abbabcbdbabdbdbabababcbcbab"). from collections import Counter def char_freq(...
null
tasks/junior/answers/q124.py
q124.py
py
977
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" }, { "api_name": "my_profiler.profiler.fprofile", "line_number": 31, "usage_type": "call" }, { "api_name": "my_profiler.profiler", "line_number": 31, "usage_type": "name" } ]
327034417
import scrapy from lxml import etree class Test(scrapy.Spider): name = 'test1' start_urls = ['https://www.julyedu.com/category/index'] def parse(self,response): print("我是测试parse") print (type(response)) #print (response.xpath('//div[@class="course_info_box"]/a/h4/text()')) i...
null
爬虫/scrapy_test/scrapy_spider_test.py
scrapy_spider_test.py
py
911
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" } ]
507268339
from typing import List, Optional, Union, TextIO import pathlib from more_itertools import first from libs import us_state_abbrev import pandas as pd from libs.datasets.dataset_utils import AggregationLevel, make_rows_key from libs.datasets import dataset_utils from libs.datasets import custom_aggregations from libs....
null
libs/datasets/latest_values_dataset.py
latest_values_dataset.py
py
6,934
python
en
code
null
code-starcoder2
83
[ { "api_name": "libs.datasets.dataset_base.DatasetBase", "line_number": 17, "usage_type": "attribute" }, { "api_name": "libs.datasets.dataset_base", "line_number": 17, "usage_type": "name" }, { "api_name": "libs.datasets.common_fields.CommonIndexFields.AGGREGATE_LEVEL", "line_...
295217330
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import codecs import logging import sys from copy import copy from .grammar import EMPTY, STOP from .tables import LALR, SLR, SHIFT, REDUCE, ACCEPT from .exceptions import ParseError, ParserInitError, DisambiguationError, \ DynamicDisam...
null
parglare/parser.py
parser.py
py
40,662
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version", "line_number": 17, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 23, "usage_type": "call" }, { "api_name": "tables.LALR", "line_number": 34, "usage_type": "name" }, { "api_name": "grammar.EMPTY.action",...
609559746
#!/usr/bin/env python import os from setuptools import setup, find_packages requirements = [ "dask-ms[xarray]", "dask[complete]", "datashader @ git+https://github.com/o-smirnov/datashader.git", "holoviews", "matplotlib>2.2.3; python_version >= '3.5'", "cmasher", "future-fstrings", "requests", "MSUtils" ] extras_requ...
null
setup.py
setup.py
py
1,265
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 23, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 29, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 33, "usage_type": "call" } ]
176141794
from math import * import numpy as np from Distances import Distances from NFWlens import NFWlens from Sersic import Sersic import matplotlib.pyplot as plt from scipy.optimize import bisect class lens_stat1D(): """ ======================================================= Lens Parameters: ===============...
null
onedimLens.py
onedimLens.py
py
5,853
python
en
code
null
code-starcoder2
83
[ { "api_name": "Distances.Distances", "line_number": 44, "usage_type": "call" }, { "api_name": "NFWlens.NFWlens", "line_number": 45, "usage_type": "call" }, { "api_name": "Sersic.Sersic", "line_number": 46, "usage_type": "call" }, { "api_name": "numpy.atleast_1d", ...
398527391
import mysql.connector as mariadb import rg_api_key import requests import json import asyncio import datetime connection = mariadb.connect(user='root', password='123321Almitimo', database='RiotGames') cursor = connection.cursor() #Create Table in MySQL DB==========================================================...
null
lol_sql.py
lol_sql.py
py
22,428
python
en
code
null
code-starcoder2
83
[ { "api_name": "mysql.connector.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "mysql.connector", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 75, "usage_type": "call" }, { "api_name": "requests.get", ...
483530729
from django.urls import path from . import views # from dal import autocomplete urlpatterns = [ path('list', views.StudentListView.as_view(), name='students'), path('test', views.test, name='test'), path('student/<int:pk>', views.StudentDetailView.as_view(), name='student'), path('student2/<int:pri...
null
students/urls.py
urls.py
py
1,120
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
11068048
#!/usr/bin/env python3 import argparse from cyvcf2 import VCF from pysam import FastaFile def create_library(name, record, chrom, begin, end=None, flank_size=20): """ Create a library line record should be a pysam FastaFile """ if not end: end = begin + 1 left_marker = record.fetch(re...
null
create-library.py
create-library.py
py
1,878
python
en
code
null
code-starcoder2
83
[ { "api_name": "pysam.FastaFile", "line_number": 25, "usage_type": "call" }, { "api_name": "cyvcf2.VCF", "line_number": 28, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.ArgumentD...
87192425
# coding: utf-8 import csv from pathlib import Path #Initial loan cost list loan_costs = [500, 600, 200, 1000, 450] # How many loans are in the list? # Print the number of loans from the list number_of_loans = len(loan_costs) print(f"A total of {number_of_loans} loans were issued.") # What is the total of all loans...
null
Challenge_1/Challenge_1/loan_analyzer.py
loan_analyzer.py
py
4,247
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 129, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 134, "usage_type": "call" } ]
307686350
#!/usr/bin/env python # -*- coding:utf-8 -*- # __author__ = "10291" # 删除剪贴板文本中的换行符 import pyperclip import time a = 1 tt = pyperclip.paste() print(pyperclip.paste()) copyBuff = '' while True: time.sleep(2) CopiedText = pyperclip.paste() if copyBuff != CopiedText: copyBuff = CopiedText no...
null
DelHuanhang.py
DelHuanhang.py
py
529
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyperclip.paste", "line_number": 10, "usage_type": "call" }, { "api_name": "pyperclip.paste", "line_number": 11, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 15, "usage_type": "call" }, { "api_name": "pyperclip.paste", "lin...
122392954
""" I tried the naive make a choice, undo a choice method with a stack, but time limit exceeded. Use DP rather than recursion or backtracking. Memoize the all possible sentences in a list. After that, try optimization. """ from typing import List class Solution: def wordBreak(self, s: str, wor...
null
140. Word Break II.py
140. Word Break II.py
py
1,116
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" } ]
30765453
"""myweb URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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-based v...
null
main/urls.py
urls.py
py
2,627
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 22, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.path",...
362305116
import os.path as pt import matplotlib.pyplot as plt import torch from torch import autograd from tqdm import tqdm from sig_lib.ResFNN import ResFNN from sig_lib.sig_conditional import get_dataset, supervised_losses, to_numpy, compare_cross_corr from sig_lib.sig_conditional import sample from sig_lib.tools import sam...
null
sig_lib/baselines.py
baselines.py
py
8,705
python
en
code
null
code-starcoder2
83
[ { "api_name": "sig_lib.sig_conditional.get_dataset", "line_number": 36, "usage_type": "call" }, { "api_name": "sig_lib.ResFNN.ResFNN", "line_number": 41, "usage_type": "call" }, { "api_name": "torch.optim.Adam", "line_number": 42, "usage_type": "call" }, { "api_na...
506301692
import numpy as np import os from skimage import img_as_float from skimage.io import imread from glob import glob from PIL import Image def load_imgset(path, load_masks=False, C=65535.): lr_paths = glob(os.path.join(path,'LR*.png')) lrs = np.array([np.array(Image.open(i)) / C for i in lr_paths]) hr = np.ar...
null
trainer/utils.py
utils.py
py
1,346
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 10,...
606516158
#!/usr/bin/env python3.6 import json import os from pprint import pprint from subprocess import check_output, CalledProcessError REGION = "us-east-1" def aws(*args, ignore_errors=False): cmd = ['aws', '--region', REGION, '--output', 'json'] + list(args) print('+ ' + ' '.join(cmd)) try: output = ...
null
jobs/integration/tigera/cleanup_vpcs.py
cleanup_vpcs.py
py
2,131
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.check_output", "line_number": 15, "usage_type": "call" }, { "api_name": "subprocess.CalledProcessError", "line_number": 16, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 23, "usage_type": "call" }, { "api_name": "ppri...
416648058
"""Taxonomy, naming categories.""" from neomodel import ( ArrayProperty as ListProp, StructuredNode as Model, StringProperty as StringProp, UniqueIdProperty, RelationshipTo, RelationshipFrom, ) from plantstuff.schema_graph.formatters import basic_choice PLANT_CATEGORY = [ "angiosperm", ...
null
plantstuff/schema_graph/models/taxonomy.py
taxonomy.py
py
29,709
python
en
code
null
code-starcoder2
83
[ { "api_name": "neomodel.StructuredNode", "line_number": 1668, "usage_type": "name" }, { "api_name": "neomodel.StringProperty", "line_number": 1671, "usage_type": "call" }, { "api_name": "plantstuff.schema_graph.formatters.basic_choice", "line_number": 1671, "usage_type": ...
187643153
import logging from abc import ABC, abstractmethod import requests logger = logging.getLogger(__name__) class CannotGetTokenPriceFromApi(Exception): pass class PriceOracle(ABC): @abstractmethod def get_price(self, ticker) -> float: pass class Binance: """ Get valid symbols from https...
null
safe_relay_service/tokens/exchanges.py
exchanges.py
py
2,954
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "abc.ABC", "line_number": 13, "usage_type": "name" }, { "api_name": "abc.abstractmethod", "line_number": 14, "usage_type": "name" }, { "api_name": "requests.get", "line_...
16368025
#!/usr/bin/python # -*- coding: utf-8 -*- from lettuce import step, before, after from selenium.webdriver import Firefox from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select, WebDriverWait from selenium.webdriver.support import expe...
null
testcode.py
testcode.py
py
5,095
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 23, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 24, "usage_type": "call" }, { "api_name": "lettuce.before.all", "line_number": 20, "usage_type": "attribute" ...
476537297
#!/usr/bin/python3 from __future__ import print_function from base64 import b64encode from time import sleep, time, strftime, gmtime from fnmatch import fnmatch import socket import ssl from random import * import os import sys import threading import hashlib import urllib.request startTime = time() messagesSeen = 0 ...
null
main.py
main.py
py
33,657
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.mkfifo", "line_number": ...
345581548
import nltk import random import re from statistics import mode from nltk.corpus import movie_reviews from nltk.classify.scikitlearn import SklearnClassifier from nltk.classify import ClassifierI from nltk.tokenize import word_tokenize from sklearn.naive_bayes import MultinomialNB, BernoulliNB from sklearn.linear_model...
null
sent_mod_train.py
sent_mod_train.py
py
5,219
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.classify.ClassifierI", "line_number": 15, "usage_type": "name" }, { "api_name": "statistics.mode", "line_number": 24, "usage_type": "call" }, { "api_name": "statistics.mode", "line_number": 31, "usage_type": "call" }, { "api_name": "pickle.dump...
653648248
import requests import time import math import numpy import os import datetime import logging import sys import traceback import argparse import json import paho.mqtt.client as mqtt appName = "netatmo2graphite" try: from systemd.journal import JournalHandler logger = logging.getLogger(appName) logger.addH...
null
netatmo.py
netatmo.py
py
10,596
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "systemd.journal.JournalHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "lo...
86007937
""" Module for parsing FUMBBL API XML match reports. """ def match_dict_iter(data): """ Yields Python dictionaries of matches of data. :param data: getter data :type data: bytes :yield: match data dictionary :ytype: dict """ match_ets = match_et_iter(data) yield from (Parser(match_et)() for match_et...
null
formats/xml_matches/parse.py
parse.py
py
8,854
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 28, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 28, "usage_type": "name" } ]
77996709
import pandas as pd import numpy as np import pickle from us import states def covidtracking_ustates(): ## ========== Import # import covidtracking data # see: data/covidtracking_update.py with open("../data/covidtracking/covidtracking_dfs.pickle", "rb") as file: covidtracking_dfs = pickle.loa...
null
src/localutils/dataload.py
dataload.py
py
1,359
python
en
code
null
code-starcoder2
83
[ { "api_name": "pickle.load", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 18, "usage_type": "call" }, { "api_name": "us.states.lookup", ...
587734848
#!/usr/bin/python # Classification (U) """Program: run_program.py Description: Unit testing of run_program in mail_2_rmq.py. Usage: test/unit/mail_2_rmq/run_program.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sys.version_info < (2, 7): import u...
null
test/unit/mail_2_rmq/run_program.py
run_program.py
py
7,791
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 30, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.getcwd", "...
559591669
# ----------------------------------------------------------------------------# # Imports # ----------------------------------------------------------------------------# import os, sys, datetime import json import dateutil.parser import babel from flask import Flask, render_template, request, Response, flash, redirect...
null
projects/01_fyyur/starter_code/app.py
app.py
py
18,314
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "flask_moment.Moment", "line_number": 23, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 25, "usage_type": "call" }, { "api_name": "flask_mig...
9244093
from boto3 import resource from app.podcasts import ep_num_file import re s3 = resource('s3') bucket = s3.Bucket('pitpodcast') def podcast_title(title): """Converts the filename to an appropriate title""" title = re.sub(r'Released/', r'', title) title = title.rstrip('.mp3') title = re.sub(r'^(ep)*(pi...
null
app/aws.py
aws.py
py
1,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.resource", "line_number": 5, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 11, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "re.I", "line_number": 13, "usage_...
469654674
import paddle import argparse import numpy as np import paddle.fluid as fluid def parse_args(): parser = argparse.ArgumentParser(description='paddle activation op test') parser.add_argument("op", type=str, choices=['leaky_relu'], help="activation op in 'leaky_relu', default is 'leaky_relu'", default='leaky_relu') ...
null
paddle/op/fluid_activation.py
fluid_activation.py
py
975
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "paddle.fluid.layers.data", "line_number": 13, "usage_type": "call" }, { "api_name": "paddle.fluid.layers", "line_number": 13, "usage_type": "attribute" }, { "api_name...
163889258
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import glob import os import pickle import numpy as np from sklearn.feature_extraction.text import CountVectorizer, HashingVectorizer, TfidfTransformer from aidistillery.file_handling import identifier_from_path def tfidf_main(args): print('Beginning tfidf_main()....
null
aidistillery/index_tfidf.py
index_tfidf.py
py
2,287
python
en
code
null
code-starcoder2
83
[ { "api_name": "glob.glob", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "sklearn.feature_extraction.text.H...
511854759
#Device Detector to detect when the specific phone is present #Author: Joshua Roberts import nmap import Constants networkScanner = nmap.PortScanner() device = Constants.LOCAL_NETWORK_PORT def detectSpecificDevice(): "Detect whether a certain device is nearby" networkScanner.scan(device) for detectedDevic...
null
DeviceDetector.py
DeviceDetector.py
py
446
python
en
code
null
code-starcoder2
83
[ { "api_name": "nmap.PortScanner", "line_number": 6, "usage_type": "call" }, { "api_name": "Constants.LOCAL_NETWORK_PORT", "line_number": 7, "usage_type": "attribute" } ]
332565940
import re import datetime from utils import Parser, EasySource, Source class Canteen(EasySource): def __init__(self, *args, location, needed_title, meta): super(Canteen, self).__init__(*args) self.location = location self.needed_title = needed_title self.meta = meta def parse...
null
parsers/halle.py
halle.py
py
4,875
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils.EasySource", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 67, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 67, "usage_type": "attribute" }, { "api_name": "utils.So...
104061956
import numpy as np import cv2 img = cv2.imread("../input/img4.jpg", 0) cv2.imshow("image", img) new_img = np.zeros([img.shape[0], img.shape[1]], dtype="uint8") for i in range(img.shape[0]): for j in range(img.shape[1]): new_img[i, j] = ((np.floor(img[i, j]/255 * 8 ) / 8)* 255).astype("uint8") cv...
null
Practice questions/scripts/q5.py
q5.py
py
367
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.floor", "line_number": 11, ...
489870694
from django.contrib import admin from .models import SanPham, SimNamSinh, SimTheoGia, SimTheoLoai, NhaMang from import_export import resources, fields, widgets from import_export.admin import ImportExportModelAdmin, ExportActionMixin # Register your models here. ################--Xuất nhập khẩu--###################...
null
PythonWeb/sanpham/admin.py
admin.py
py
6,002
python
en
code
null
code-starcoder2
83
[ { "api_name": "import_export.resources.ModelResource", "line_number": 12, "usage_type": "attribute" }, { "api_name": "import_export.resources", "line_number": 12, "usage_type": "name" }, { "api_name": "models.SanPham", "line_number": 16, "usage_type": "name" }, { ...
109498405
import logging from db.dbclient import MongoClient import feedparser from bs4 import BeautifulSoup import requests as req from pymongo import ReplaceOne from tqdm import tqdm from ml.review_model import ReviewModel class Feed: # type, attr, value meta_keywords = [ ('meta_keywords','name','news_keywords...
null
src/etl/rss.py
rss.py
py
6,284
python
en
code
null
code-starcoder2
83
[ { "api_name": "db.dbclient.MongoClient", "line_number": 22, "usage_type": "call" }, { "api_name": "db.dbclient.MongoClient", "line_number": 23, "usage_type": "call" }, { "api_name": "feedparser.parse", "line_number": 28, "usage_type": "call" }, { "api_name": "logg...
119674158
# -*- coding:utf-8 -*- # ! python3 ''' Copyright 2017 Sebastian Bauer 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 require...
null
ThargoidHunt/insert_systems.py
insert_systems.py
py
5,611
python
en
code
null
code-starcoder2
83
[ { "api_name": "ThargoidHunt.EliteSystem", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path", "line_number": 36, "usage_type": "attribute" }, { "api_name": "os.getcwd", "l...
492278154
import pandas as pd from typing import List import movielens as ml from recommender import Recommender def ask_user_id(user_list: List[int]) -> int: """ read user_id from input. must be integer and be contained in the user_list. :param user_list: list of permitted user_ids. :return: a valid user_id ...
null
assignment4/main.py
main.py
py
1,763
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "pandas.merge", "line_number": 33, "usage_type": "call" }, { "api_name": "movielens.rating", "line_number": 33, "usage_type": "attribute" }, { "api_name": "movielens.rating", ...
242250710
import pandas as pd #from IPython.display import Markdown, display, clear_output import os import gensim from gensim.test.utils import datapath, get_tmpfile from gensim.models import KeyedVectors import _pickle as cPickle from pathlib import Path import spacy import logging from spacy import displacy nlp = spacy.load('...
null
Final.py
Final.py
py
9,428
python
en
code
null
code-starcoder2
83
[ { "api_name": "spacy.load", "line_number": 12, "usage_type": "call" }, { "api_name": "_pickle.dump", "line_number": 16, "usage_type": "call" }, { "api_name": "_pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number"...
91374572
import sys, os, csv, django dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = os.path.dirname(dir_path) sys.path.append(dir_path) os.environ['DJANGO_SETTINGS_MODULE'] = 'Bookstore.settings' django.setup() from database.models import * data = csv.reader(open("ADDRESS.csv"),delimiter=",") firstline = ...
null
Bookstore/sample_data/readAddresses.py
readAddresses.py
py
992
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path.dirname", "lin...
337129146
import pandas as pd from calendar import monthrange from dateutil.relativedelta import relativedelta from pywr.parameters import Parameter from utilities.converter import convert import random class FlowPeriods(object): DRY_SEASON = 'dry season' FALL_PULSE = 'fall pulse' WET_SEASON = 'wet season' SPRI...
null
pywr_models/parameters/__init__.py
__init__.py
py
20,411
python
en
code
null
code-starcoder2
83
[ { "api_name": "pywr.parameters.Parameter", "line_number": 23, "usage_type": "name" }, { "api_name": "dateutil.relativedelta.relativedelta", "line_number": 82, "usage_type": "call" }, { "api_name": "calendar.monthrange", "line_number": 93, "usage_type": "call" }, { ...
163821031
import numpy as np import scipy.signal as s import matplotlib.pyplot as plt import pandas as pd import scipy.signal as sig import src.models.analytical_sdof_model as an_sdof import scipy.interpolate as interp class Dataset_Plotting(object): """This function generates plots from certain attributes that a dataset m...
null
src/features/proc_lib.py
proc_lib.py
py
45,724
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.vlines", "line_number": 20, "usage_type": "call" }, { "api_name": "m...
379069851
from config.dbconfig import pg_config import psycopg2 class CompanyDAO: def __init__(self): connection_url = "dbname=%s user=%s password=%s" % (pg_config['dbname'], pg_config['user'], p...
null
dao/company.py
company.py
py
3,513
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.dbconfig.pg_config", "line_number": 8, "usage_type": "name" }, { "api_name": "config.dbconfig.pg_config", "line_number": 9, "usage_type": "name" }, { "api_name": "config.dbconfig.pg_config", "line_number": 10, "usage_type": "name" }, { "api_n...
137621428
import numpy import scipy.constants as constants import at import math import warnings __all__ = ['find_orbit4', 'find_sync_orbit', 'find_orbit6', 'find_m44', 'find_m66', 'get_twiss'] XYDEFSTEP = 6.055454452393343e-006 # Optimal delta? DPSTEP = 6.055454452393343e-006 # Optimal delta? DDP = 1e-8 STEP_SIZE = 1e-6 MAX...
null
pyat/at/physics.py
physics.py
py
20,646
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.uint32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 18, "usage_type": "attribute" }, { "api_name": "numpy.float64", "line_number": 19, "usage_type": "attribute" }, { "api_name": "numpy.float64...
635827058
import pathlib import numpy as np from dambreak import Experiment2D from plot import plot2D, plot3D, quiver #%% def h0_(x, y, x0, y0, h0, hd): H = np.ones_like(x) * hd # 1e-16 idx = np.array((x <= x0) & (y <= y0)) H[idx] = h0 return H #%% h_0 = 40 h_d = 1 x0 = 1000 y0 = 1000 L = 2000 T = 40 Nx = 100 Ny = 1...
null
2/src/3_2D_stoker.py
3_2D_stoker.py
py
3,177
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ones_like", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 30, "usage_type": "call" }, { "api_name": "dambreak.Experiment2D", "lin...
429036070
import os import matplotlib.colors as colours from matplotlib import cm as colormap from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from astropy.modeling import models, fitting from scipy.ndimage import binary_dilation import numpy as np from copy imp...
null
pocs/focuser/focuser.py
focuser.py
py
22,690
python
en
code
null
code-starcoder2
83
[ { "api_name": "copy.copy", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.cm.inferno", "line_number": 22, "usage_type": "attribute" }, { "api_name": "matplotlib.cm", "line_number": 22, "usage_type": "name" }, { "api_name": "pocs.base.PanBase"...
619062947
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import sys sys.path.append('./models/research/slim/') from nets import nets_factory from utils.custom_preprocessing import preprocessing_factory from utils.dataset import GoogleDataset ...
null
CNNs/google-landmark/train.py
train.py
py
9,301
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "tensorflow.contrib", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tensorflow.app.fl...
461429857
import cv2 import numpy as np cap = cv2.VideoCapture(0) def count(x): x = x+1 cv2.namedWindow('tiltshift') cv2.createTrackbar('Alfa', 'tiltshift', 0, 100, count) cv2.createTrackbar('Center', 'tiltshift', 0, 100, count) cv2.createTrackbar('Height', 'tiltshift', 0, 100, count) bg = cv2.imread('./Imagens/ts.jpg') ...
null
tilt-shift-video.py
tilt-shift-video.py
py
1,231
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.createTrackbar"...
214808521
import webapp2 from google.appengine.api import users import jinja2 import os JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__),'templates'))) class MainPage(webapp2.RequestHandler): def get(self): user = users.get_current_user() ...
null
homeauth_gae/index.py
index.py
py
594
python
en
code
null
code-starcoder2
83
[ { "api_name": "jinja2.Environment", "line_number": 8, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "l...
520802701
import numpy as np import sqlite3 import numpy as np import pickle import re def data_parser(): ''' 针对每一个玩家的动作序列,制作相应的动作序列和标签 ''' conn = sqlite3.connect('./data/an.db2') c = conn.cursor() query_sql = "SELECT user_id, op, current_day, num_days_played, relative_timestamp \ FROM maidian O...
null
utils/pearson.py
pearson.py
py
5,174
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 49, "usage_type": "call" }, { "api_name": "pickle.dump", "line_number": 50, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_n...
166153612
import numpy as np import cv2 import matplotlib.pyplot as plt class Matcher: def __init__(self, keypoints_query, keypoints_test, lowe_tau=0.75, test_lowe=True, cross_check=True): self.keypoints_query = keypoints_query self.keypoints_test = keypoints_test self.lowe_tau = lowe_tau ...
null
new_matching.py
new_matching.py
py
2,762
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.count_nonzero", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm.get_cmap", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 26, "usage_type": "attribute" }, { "api_n...
105993892
import random import re import time import serial import platform from serial.tools import list_ports from Utilities import replace_value_with_definition, readify_data, string_me import datetime CHANNEL_TYPE_UNKNOWN = 0 CHANNEL_TYPE_SENSOR = 1 CHANNEL_TYPE_IMU = 2 CHANNEL_TYPE_GPS = 3 CHANNEL_TYPE_TIME = 4 CHANNEL_TY...
null
Process.py
Process.py
py
12,048
python
en
code
null
code-starcoder2
83
[ { "api_name": "serial.Serial", "line_number": 102, "usage_type": "call" }, { "api_name": "time.time", "line_number": 105, "usage_type": "call" }, { "api_name": "serial.tools.list_ports.comports", "line_number": 110, "usage_type": "call" }, { "api_name": "serial.to...
464576997
import argparse, json ''' import a json file, in each document, look for a lat, lon field, take it and export as kml file with points ''' def find_point_data(document, lat_field, lon_field): return (document[lat_field], document[lon_field]) def load_file(file_path): return json.loads(open(file_path, 'r').rea...
null
demographics_bar.py
demographics_bar.py
py
1,507
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 9, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 25, "usage_type": "call" } ]
334026471
import math import scipy.special def TemplateIon(xvect,c0,c1,c2,offset,ampl) : # convention: les c0/c1/c2 = parametres du fichier tmplt.txt xx = [x-offset for x in xvect] fprepulse=[0 for x in xx if x<0] fpostpulse=[ ampl*((1+scipy.special.erf(x/c2))/2.0)*(math.exp(-x/c0)-c1) for x in xx if x>=0] ...
null
Code/Run308_WIMP_searches/Run308_Analyse_ERA/ERA_manipulations/ERA/python/TemplateFct.py
TemplateFct.py
py
1,782
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.special.special.erf", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.special.special", "line_number": 9, "usage_type": "attribute" }, { "api_name": "scipy.special", "line_number": 9, "usage_type": "name" }, { "api_name": "math....
383611881
#!/usr/bin/env python import sys import rospy import cv2 from std_msgs.msg import String from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError import numpy as np class image_converter: def __init__(self): self.image_pub = rospy.Publisher("openCV_image", Image, queue_size=10) ...
null
src/bebop_fyp/scripts/image_converter.py
image_converter.py
py
2,170
python
en
code
null
code-starcoder2
83
[ { "api_name": "rospy.Publisher", "line_number": 13, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.Image", "line_number": 13, "usage_type": "argument" }, { "api_name": "cv_bridge.CvBridge", "line_number": 15, "usage_type": "call" }, { "api_name": "rospy.Su...
552336078
from django.shortcuts import render from django.http import HttpResponse import json from django.views.decorators.csrf import csrf_exempt from chatterbot import ChatBot import random chatbot = ChatBot('Norman') def home(request, template_name="home.html"): context = {'title': 'RemindMe'} return render(request, te...
null
mysite/remindme/views.py
views.py
py
1,036
python
en
code
null
code-starcoder2
83
[ { "api_name": "chatterbot.ChatBot", "line_number": 10, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 14, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "random.choice",...
324723144
import numpy as np import gym import random import tensorflow as tf from collections import deque import time REPLAY_MEMORY = 128 # number of previous transitions to remember BATCH_SIZE = 16 # size of minibatch EPISODES = 3000 GAMMA = 0.99 EPSILON = 0.1 EPSILON_MIN = 0.01 EPSILON_DECAY = 0.995 LEARNING_RATE = 0.1 TIME...
null
com/alodokter/learn/frozenDQN_experience_replay.py
frozenDQN_experience_replay.py
py
4,529
python
en
code
null
code-starcoder2
83
[ { "api_name": "gym.make", "line_number": 20, "usage_type": "call" }, { "api_name": "tensorflow.reset_default_graph", "line_number": 25, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 27, "usage_type": "call" }, { "api_name": "tensor...
648962329
from helper import HelperFunctions from selenium.common.exceptions import NoSuchElementException from driver_functions import DriverFunctions import time class Finder(): """ Holds the collections of methods that finds element of the instagram posts using selenium's webdriver's methods """ @...
null
instagram_scraping/element_finder.py
element_finder.py
py
19,574
python
en
code
null
code-starcoder2
83
[ { "api_name": "driver_functions.DriverFunctions._DriverFunctions__wait_for_element_to_appear", "line_number": 26, "usage_type": "call" }, { "api_name": "driver_functions.DriverFunctions", "line_number": 26, "usage_type": "name" }, { "api_name": "driver_functions.DriverFunctions._...
441537118
from sqlalchemy import inspect from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() #==========================================================================================# from sqlalchemy import Column, String,Integer,Sequence class django_migrations(Base): __tablena...
null
SQLachemy/transaction-query-update.py
transaction-query-update.py
py
2,138
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.ext.declarative.declarative_base", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.Column", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.Integer", "line_number": 12, "usage_type": "argument" }, { ...
74598225
#import matplotlib #matplotlib.use('tkAgg') import matplotlib.pyplot as plt #import pylab as plt mySamples=[] myLinear=[] myQuadratic=[] myCubic=[] myExponential=[] for i in range(0,30): mySamples.append(i) myLinear.append(i) myQuadratic.append(i**2) myCubic.append(i**3) myExponential.append(i**4)...
null
Unit7_Visualization/pylab.py
pylab.py
py
1,511
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 20, "usage_type": "call" }, { "api_name": "matp...
66962238
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 25 19:23:01 2019 @author: xuwanqian """ from __future__ import absolute_import, division, print_function import numpy as np import tensorflow as tf from tensorflow.keras import Model, layers from loadBasicEnv import NAMEDICT, IMGSHAPE, NET_SAVE_NA...
null
vgg.py
vgg.py
py
7,627
python
en
code
null
code-starcoder2
83
[ { "api_name": "loadBasicEnv.NAMEDICT", "line_number": 21, "usage_type": "argument" }, { "api_name": "tensorflow.keras.Model", "line_number": 30, "usage_type": "name" }, { "api_name": "tensorflow.keras.layers.Conv2D", "line_number": 35, "usage_type": "call" }, { "a...
99630156
# goal of this code is to use OpenCV's Blob detector to detector the washers using an # OpenCV's Canny edge detection filter (not color) # it needs the video frame as an input # outputs the x and y coordinate to the closest blob detected # the blob parameters are needed to limit the things that are detected as a "blob"...
null
subpartcode/Camera Vision/objcenter.py
objcenter.py
py
2,988
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.SimpleBlobDetector_Params", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.__version__.split", "line_number": 47, "usage_type": "call" }, { "api_name": "cv2.__version__", "line_number": 47, "usage_type": "attribute" }, { "api_name...
158036634
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
null
scripts/question_answering/data_process.py
data_process.py
py
11,811
python
en
code
null
code-starcoder2
83
[ { "api_name": "spacy.blank", "line_number": 53, "usage_type": "call" }, { "api_name": "json.load", "line_number": 88, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 89, "usage_type": "call" }, { "api_name": "random.shuffle", "line_number": 9...
628185988
#!/usr/bin/python import json import pprint from utils import * from db import * import web def city_search(req): name = req.params.getall('name')[0] cities = db_city_search(req, name) return web.JSONResponse(cities) def postcode_search(req): name = req.params.getall('name')[0] search_name = na...
null
src/py/cities.py
cities.py
py
1,232
python
en
code
null
code-starcoder2
83
[ { "api_name": "web.JSONResponse", "line_number": 14, "usage_type": "call" }, { "api_name": "web.JSONResponse", "line_number": 25, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 49, "usage_type": "call" }, { "api_name": "web.JSONResponse", "...
30604497
from models import Activator, ModelTools import activator_extension import json def build_application(app): app_dict = { 'id': app.id, 'name': app.name, 'env': app.env, 'status': app.status, 'description': app.description, 'resources': json.loads(app.resources or '[...
null
application_extension.py
application_extension.py
py
598
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "models.Activator.query.filter", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Activator.query", "line_number": 16, "usage_type": "attribute" }, { "api_name": "...
80872937
import json,time def sanitizar(cadena): resultado = "" diccionario= {"á":"a","é":"e","í":"i","ó":"o","ú":"u","Á":"A","É":"E","Í":"I","Ó":"o","Ú":"u","ñ":"n", " ": " "} for letra in cadena: lista_claves = diccionario.keys() if letra in lista_claves: resultado += diccionario[letra...
null
cgi-bin/datos.py
datos.py
py
2,922
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 24, "usage_type": "call" } ]
267115620
from django.shortcuts import render from django.http import HttpResponse import json import smtplib def index(request): return render(request, 'index.html', {}) def message(request): if request.method == 'POST': msg = request.POST.get('msg') formData= request.POST.get('formData') data = json.loads(formData)...
null
aedig/views.py
views.py
py
1,049
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" }, { "api_name": "smtplib.SMTP", "line_number": 28, "usage_type": "call" }, { "api_name": "django.http.HttpRespon...
7870144
import numpy as np from numpy import ndarray from NN.Dense import Dense from NN.Linear import Linear from NN.MeanSquaredError import MeanSquaredError from NN.NeuralNetwork import NeuralNetwork from NN.SGD import SGD from NN.Sigmoid import Sigmoid from sklearn.datasets import load_boston from sklearn.preprocessing imp...
null
NN/RunTraining.py
RunTraining.py
py
3,066
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.ndarray", "line_number": 18, "usage_type": "name" }, { "api_name": "numpy.mean", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.ndarray", "line_number":...
187196598
from PIL import Image from lego_sorter_server.analysis.classification.toolkit.transformations.transformation import Transformation class Simple(Transformation): @staticmethod def transform(img, desired_size=299): old_size = img.size ratio = float(desired_size) / max(old_size) new_size...
null
lego_sorter_server/analysis/classification/toolkit/transformations/simple.py
simple.py
py
627
python
en
code
null
code-starcoder2
83
[ { "api_name": "lego_sorter_server.analysis.classification.toolkit.transformations.transformation.Transformation", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.Image.ANTIALIAS", "line_number": 12, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_nu...
315782361
import scipy import numpy as np import matplotlib.pyplot as plt import math import time import random start = time.time() ################ OPPGAVE 1 ################ def makeGrid(N): # Lager en nxn matrise. N=lengde av polymer. n=N+2 grid = np.zeros((N + 2, N + 2)).astype(np.int16) n = len(grid) grid[in...
null
Prosjekt2/fullstendig/opg124.py
opg124.py
py
7,834
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.int16", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.round", "line_number"...
358051295
''' Copyright 2021 OpenDILab. All Rights Reserved: Description: ''' from functools import partial from easydict import EasyDict from ding.envs import SyncSubprocessEnvManager from ding.utils import set_pkg_seed from ding.utils.default_helper import deep_merge_dicts from core.envs import SimpleCarlaEnv, CarlaEnvWrapp...
null
demo/coil_demo/coil_eval.py
coil_eval.py
py
3,154
python
en
code
null
code-starcoder2
83
[ { "api_name": "easydict.EasyDict", "line_number": 77, "usage_type": "call" }, { "api_name": "core.envs.CarlaEnvWrapper", "line_number": 83, "usage_type": "call" }, { "api_name": "core.envs.SimpleCarlaEnv", "line_number": 83, "usage_type": "call" }, { "api_name": "...
312770324
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Mar 31 16:45:27 2018 @author: astricot """ import numpy as np from sklearn.cluster import KMeans from sklearn import cluster,datasets from sklearn.manifold import TSNE def tSNE_Nu(file1,file2): N = np.load(file1) N_embed = TSNE(n_components=2,...
null
Recommendation-System/clustering.py
clustering.py
py
1,281
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.load", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.manifold.TSNE", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.save", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.load", "line_nu...
638037647
######## # Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
null
cloudify_cli/tests/commands/test_deployment_update.py
test_deployment_update.py
py
6,272
python
en
code
null
code-starcoder2
83
[ { "api_name": "cloudify_cli.tests.commands.test_cli_command.CliCommandTest", "line_number": 28, "usage_type": "name" }, { "api_name": "mock.MagicMock", "line_number": 37, "usage_type": "call" }, { "api_name": "mock.MagicMock", "line_number": 39, "usage_type": "call" }, ...
139229922
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
null
models/match/dssm/model.py
model.py
py
3,938
python
en
code
null
code-starcoder2
83
[ { "api_name": "paddlerec.core.model.ModelBase", "line_number": 21, "usage_type": "name" }, { "api_name": "paddlerec.core.model.ModelBase.__init__", "line_number": 23, "usage_type": "call" }, { "api_name": "paddlerec.core.model.ModelBase", "line_number": 23, "usage_type": ...
589544617
#!/usr/bin/env python # coding: utf-8 from tkinter import * import numpy as np import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure from tkinter import filedialog from keras.models import load_model import h5py import csv class ...
null
gui.py
gui.py
py
5,784
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.figure.Figure", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "line_number": 42, "usage_type": "call" },...
100058546
import argparse import torch import torch.nn as nn import matplotlib.pyplot as plt import torch.nn.functional as F import numpy as np from datasets.mnist import mnist import os from torchvision.utils import make_grid def log_prior(x): """ Compute the elementwise log probability of a standard Gaussian, i.e. ...
null
assignment_3/templates/a3_nf_template.py
a3_nf_template.py
py
10,263
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.log", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.diag", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.normal", "line_number": ...
28391689
from django import forms from fas_questionnaire.forms.common import ListTextWidget from ..models.page5 import * class CroppingPatternAndCropScheduleForm(forms.ModelForm): class Meta: model = CroppingPatternAndCropSchedule fields = ['household', 'crop_number_first_digit', ...
null
fas_questionnaire_site/fas_questionnaire/forms/page5.py
page5.py
py
2,222
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "fas_questionnaire.forms.common.ListTextWidget", "line_number": 34, "usage_type": "call" }, { ...
408817433
import os os.environ['CUDA_VISIBLE_DEVICES'] = '2' # change GPU here import sys sys.path.extend(['/home/data2/rzf/KD']) import random import numpy as np import torch import torch.backends.cudnn as cudnn import math import torch.nn.functional as F import argparse from PIL import Image import matplotlib.py...
null
rzf_code_logs/907/train_sigma_stu_fc1.py
train_sigma_stu_fc1.py
py
23,140
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "sys.path.extend", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", ...
15880518
from flask import session, url_for from app import app, db import os from requests_oauthlib import OAuth2Session from datetime import datetime import time tablename_prefix = os.path.dirname(os.path.realpath(__file__)).split("/")[-1] class Base(db.Model): __abstract__ = True id = db.Column(db.Integer, primary...
null
app/authorize_qbo_blueprint/models.py
models.py
py
3,722
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "app.db.Model", "line_n...
61365081
from datetime import datetime import twitter from settings import Settings from db import JSON class TwitterUtils: def __init__(self): self.config = Settings() self.settings = self.config.load() self.jsonDB = JSON() self.load() self.api = twitter.Api( consume...
null
twitterUtils.py
twitterUtils.py
py
4,064
python
en
code
null
code-starcoder2
83
[ { "api_name": "settings.Settings", "line_number": 10, "usage_type": "call" }, { "api_name": "db.JSON", "line_number": 13, "usage_type": "call" }, { "api_name": "twitter.Api", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "li...
351830027
# from pyecharts import Map # # value = [155,10,66,78,33,80,190,53,49.6] # attr = ['福建','山东','北京','甘肃','新疆','河南','广西','西藏'] # map = Map("Test", width=1200, height=600) # map.add("",attr,value,maptype='china',is_visualmap=True,visual_text_color='#000') # map.show_config() # map.render() # from pyecharts import Map # #...
null
Test_pyecharts.py
Test_pyecharts.py
py
2,361
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyecharts.Map", "line_number": 56, "usage_type": "call" } ]
259213496
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
null
000_DOC/scripts_curso_ice/singlemax2.py
singlemax2.py
py
3,835
python
en
code
null
code-starcoder2
83
[ { "api_name": "deap.creator.create", "line_number": 23, "usage_type": "call" }, { "api_name": "deap.creator", "line_number": 23, "usage_type": "name" }, { "api_name": "deap.base.Fitness", "line_number": 23, "usage_type": "attribute" }, { "api_name": "deap.base", ...
498415362
import lib.alarm as alarm import lib.client as client import lib.peripherals as peripherals import lib.SoftwareTimer as SoftwareTimer import time REFRESH_RATE = 5 myClock = alarm.AlarmClock() client = client.Client() while not client.connect("192.168.2.3", 12345): time.sleep(REFRESH_RATE) refreshTime...
null
main.py
main.py
py
1,176
python
en
code
null
code-starcoder2
83
[ { "api_name": "lib.alarm.AlarmClock", "line_number": 10, "usage_type": "call" }, { "api_name": "lib.alarm", "line_number": 10, "usage_type": "name" }, { "api_name": "lib.client", "line_number": 12, "usage_type": "name" }, { "api_name": "lib.client.Client", "li...
179053761
""" APIs for storing and retrieving HTTP headers and cookies. """ from bisect import insort from cached_property import cached_property as calculated_once from characteristic import Attribute, attributes from future.moves.urllib.parse import ( parse_qs, unquote, unquote_plus, urlencode, ) from future.utils impor...
null
minion/http.py
http.py
py
13,536
python
en
code
null
code-starcoder2
83
[ { "api_name": "future.utils.raise_with_traceback", "line_number": 102, "usage_type": "call" }, { "api_name": "future.moves.urllib.parse.unquote", "line_number": 123, "usage_type": "call" }, { "api_name": "future.moves.urllib.parse.unquote", "line_number": 136, "usage_type...
602321713
import csv import pymongo import json import urllib.request import time from datetime import datetime, timedelta conn = pymongo.MongoClient('127.0.0.1', 27017) db = conn.get_database('scsc') weather_col = db.get_collection('weather') score_col = db.get_collection('score') with open("../config/key.json", "r") as sk_j...
null
src/server/batch/shortRefresh.py
shortRefresh.py
py
5,948
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "...
589424042
#!/usr/bin/python # Copyright 2012 Kuno Woudt # All software related to the License Database project is licensed under # the Apache License, Version 2.0. See the file Apache-2.0.txt for more # information. # Unless required by applicable law or agreed to in writing, software # distributed under the License is distr...
null
src/build/turtle-cc.py
turtle-cc.py
py
6,598
python
en
code
null
code-starcoder2
83
[ { "api_name": "license.activate_virtualenv", "line_number": 25, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 36, "usage_type": "call" }, { "api_name": "rdflib.Graph", "line_number": 44, "usage_type": "call" }, { "api_name": "rdflib.term.URIR...
144310093
import re import urllib.request, urllib.parse, urllib.error from bs4 import BeautifulSoup import urllib.parse values={'q':'saranath history'} data=urllib.parse.urlencode(values) url='https://www.google.com/search?'+data headers={} headers['User-Agent']="Mozilla/5.0 (X11; Linux i686)" request=urllib.r...
null
1.py
1.py
py
1,552
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.parse.urlencode", "line_number": 8, "usage_type": "call" }, { "api_name": "urllib.request.parse", "line_number": 8, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 8, "usage_type": "name" }, { "api_name": "...