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
286015694
import json import re from rest_framework import serializers from .models import TestsuitsModel from projects.models import ProjectsModel from interfaces.models import InterfacesModel # 项目模型序列化器类 class TestsuitsModelSerializer(serializers.ModelSerializer): # 外键字段[必须加 因为原本定义的外键字段interface 因为要返回父表信息被占用后 未进行反序列化校验]...
null
apps/testsuites/serializers.py
serializers.py
py
2,217
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.serializers.ModelSerializer", "line_number": 11, "usage_type": "attribute" }, { "api_name": "rest_framework.serializers", "line_number": 11, "usage_type": "name" }, { "api_name": "rest_framework.serializers.PrimaryKeyRelatedField", "line_number":...
100143103
import urllib, urllib3, sys import certifi import pandas as pd import re import time # change the path to your ducument read_camping_site = pd.read_csv("E:\\Study\\20 semester 1\\Project\\Javascript_visulization\\datasets\\recweb_site.csv") all_lat = read_camping_site["LATITUDE"] all_lng = read_camping_site["L...
null
userstory1_fire&site_map/python_script/aquire_air_quality.py
aquire_air_quality.py
py
1,498
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "re.search", "line_number": 15, "usage_type": "call" }, { "api_name": "re.search", "line_number": 16, "usage_type": "call" }, { "api_name": "urllib3.PoolManager", "line_nu...
513375214
from django.shortcuts import render, redirect from django.http import JsonResponse from django.utils.translation import gettext as _ from django.core.exceptions import ObjectDoesNotExist #from django.utils.datastructures import MultiValueDictKeyError from .models import Sales from users.models import Users ...
null
sales/search_views.py
search_views.py
py
2,469
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Sales.objects.get", "line_number": 17, "usage_type": "call" }, { "api_name": "models.Sales.objects", "line_number": 17, "usage_type": "attribute" }, { "api_name": "models.Sales", "line_number": 17, "usage_type": "name" }, { "api_name": "djang...
318784193
"""common code for all experiments """ from __future__ import print_function from tensorflow.python.client import device_lib print(device_lib.list_local_devices()) import numpy as np np.random.seed(1337) import keras import medleydb as mdb import os import core import evaluate SAMPLES_PER_EPOCH = 256 NB_EPOCHS = 10...
null
deepsalience/experiment.py
experiment.py
py
2,763
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.python.client.device_lib.list_local_devices", "line_number": 6, "usage_type": "call" }, { "api_name": "tensorflow.python.client.device_lib", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.random.seed", "line_number": 9, "usage_typ...
645123276
""" tests.ext.commands.test_init ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests Init command. :copyright: (c) 2015 by the Holocron Team, see AUTHORS for details. :license: 3-clause BSD, see LICENSE for details. """ import os import mock from holocron.app import Holocron from holocron.ext.commands import in...
null
tests/ext/commands/test_init.py
test_init.py
py
1,213
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.HolocronTestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "holocron.ext.commands.init.Init", "line_number": 27, "usage_type": "call" }, { "api_name": "holocron.ext.commands.init", "line_number": 27, "usage_type": "name" }, { ...
420735940
import os import sys import pygame from pygame.locals import * from config.settings import * from src.plane import Plane from src.enemy import Enemy from src.bullet import Bullet # background music, image bg_size = 480, 852 screen = pygame.display.set_mode(bg_size) pygame.display.set_caption('飞机大战') background = pyga...
null
game/PlayPlane/bin/main.py
main.py
py
4,811
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.display.set_mode", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pygame.display.set_caption", "line_number": 14, "usage_type": "call" }, { "api_name":...
225604269
import requests import xml.etree.ElementTree as etree import datetime FUNCTION_GET_EVENTS = 'calevents_list' FUNCTION_GET_DETAILED_EVENT = 'calevents_details' FUNCTION_GET_ALL_CHARACTERS = 'points' def build_request(base, function, api_token, *opts): request = base + '?function=' + function for opt in opts: ...
null
inscriptions.py
inscriptions.py
py
4,670
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree.fromstring", "line_number": 25, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 25, "usage_type": "name" }, { "api_name": "d...
183640174
## 1. Data Exporaion ## Import library and data import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt ad = pd.read_csv("train.csv", parse_dates=['click_time']) ## Create functions def barplot(x, y, data): plt.figure(figsize=(15,15)) plt.subplot(3,1,1) plt.title('c...
null
01_Data_Exporation.py
01_Data_Exporation.py
py
2,575
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib....
622024731
from flask import Blueprint from flask_restx import Resource, reqparse from project import db from project.api import api from project.calendars import Calendars from project.models.appointment import Appointment from project.models.event import Event from project.models.user import User from project.services.google_ca...
null
server/project/api/calendar_handler.py
calendar_handler.py
py
2,507
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "project.db.session.query", "line_number": 27, "usage_type": "call" }, { "api_name": "project.mo...
531616815
import boto3 import hashlib import os class CheckIncompleteUpload: def __init__(self, bucket, prefix): self.bucket = bucket self.prefix = prefix session = boto3.Session() self.client = session.client(service_name='s3') self.incomplete_mpu = [] self.mpu_to_abort = {}...
null
finish_mpu.py
finish_mpu.py
py
4,976
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.Session", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "os.path.isfile", "line_nu...
588005627
import decimal import os import responses from monero.const import NET_STAGE from monero.daemon import Daemon from monero.backends.jsonrpc import JSONRPCDaemon from monero.transaction import Transaction from .base import JSONTestCase class JSONRPCDaemonTestCase(JSONTestCase): jsonrpc_url = 'http://127.0.0.1:1808...
null
tests/test_jsonrpcdaemon.py
test_jsonrpcdaemon.py
py
5,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "base.JSONTestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "monero.daemon.Daemon", "line_number": 20, "usage_type": "call" }, { "api_name": "monero.backends.jsonrpc.JSONRPCDaemon", "line_number": 20, "usage_type": "call" }, { "api_...
42596394
import base64, time, datetime from django.shortcuts import render from first.models import Resume_class, SessionClass, BlogPostClass from django.shortcuts import redirect def home(request): blogpost_obj = BlogPostClass.objects.all() blog_list = [] count =0 for obj in blogpost_obj: if count =...
null
first/views.py
views.py
py
7,671
python
en
code
null
code-starcoder2
66
[ { "api_name": "first.models.BlogPostClass.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "first.models.BlogPostClass.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "first.models.BlogPostClass", "line_number": 8, "usage_type":...
618710815
# -*- coding: utf-8 -*- '''Test of Folium basic markers''' import folium #Simple Markers with Stamen Terrain map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain') map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows') map_1.simple_marker([45.3311, -121...
null
examples/markers.py
markers.py
py
1,985
python
en
code
null
code-starcoder2
66
[ { "api_name": "folium.Map", "line_number": 7, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 14, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 23, "usage_type": "call" }, { "api_name": "folium.Map", "line_number": 29, ...
277656769
import pygame import math import random import sys # Save the Babies # + # Defeat the Bosses pygame.init() def debug(do=True): #print(game.frames) #print(Spawner.time) #print(game.bossfight) #print(str(game.lost) + ' ' + str(game.running)) pass def roundto(x, base): return base*round(float(x)/base...
null
SaveTheBabies/savethebabies.py
savethebabies.py
py
17,310
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.init", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.transform.scale", "line_number": 60, "usage_type": "call" }, { "api_name": "pygame.transform", "line_number": 60, "usage_type": "attribute" }, { "api_name": "pygame.image...
326859598
#!/usr/bin/python3 """View for the link between Place objects and Amenity objects""" from api.v1.views import app_views from flask import jsonify, abort, make_response, request from models import storage from models.place import Place from models.amenity import Amenity from models import * @app_views.route('/places/<...
null
api/v1/views/places_amenities.py
places_amenities.py
py
2,710
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.storage.get", "line_number": 16, "usage_type": "call" }, { "api_name": "models.place.Place", "line_number": 16, "usage_type": "argument" }, { "api_name": "models.storage", "line_number": 16, "usage_type": "name" }, { "api_name": "flask.abort"...
391806737
#!/usr/bin/env python # coding: utf-8 # # Tomas Costantino - A00042881 # # # Analysis on e-commerce logistics with EDA and SVM to predict target variable # # dataset extracted from: https://www.kaggle.com/prachi13/customer-analytics # In[1]: import pandas as pd # In[2]: #Read dataset df = pd.read_csv('Train.c...
null
IDS201_Assessment3.py
IDS201_Assessment3.py
py
8,027
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "warnings.filterwarnings", "line_number": 81, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.pie", "line_number": 93, "usage_type": "call" }, { "api_name": "matplot...
411340710
from django.conf.urls import url from .views import IndexView, PreviewView, ShowView app_name = 'posts' urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), url(r'^preview/(?P<slug>[\w-]+)/$', PreviewView.as_view(), name='preview'), url(r'^(?P<slug>[\w-]+)/$', ShowView.as_view(), name='show')...
null
src/posts/urls.py
urls.py
py
324
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "views.IndexView.as_view", "line_number": 10, "usage_type": "call" }, { "api_name": "views.IndexView", "line_number": 10, "usage_type": "name" }, { "api_name": "django.c...
407492929
# Transmitint bitplanes. import sounddevice as sd import numpy as np import struct from intercom import Intercom from intercom_buffer import Intercom_buffer if __debug__: import sys class Intercom_bitplanes(Intercom_buffer): def init(self, args): Intercom_buffer.init(self, args) self.packet_...
null
development/COPIES/intercom_bitplanes.py
intercom_bitplanes.py
py
1,720
python
en
code
null
code-starcoder2
66
[ { "api_name": "intercom_buffer.Intercom_buffer", "line_number": 12, "usage_type": "name" }, { "api_name": "intercom_buffer.Intercom_buffer.init", "line_number": 15, "usage_type": "call" }, { "api_name": "intercom_buffer.Intercom_buffer", "line_number": 15, "usage_type": "...
339656652
from __future__ import unicode_literals from django.shortcuts import render, HttpResponse, redirect from datetime import datetime from products import items def index(request): if "last_transaction" in request.session.keys(): del request.session['last_transaction'] context = { "items": items } return render...
null
j_chris_miller_python/Django/main/apps/amadon/views.py
views.py
py
1,116
python
en
code
null
code-starcoder2
66
[ { "api_name": "products.items", "line_number": 12, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "products.items", "line_number": 19, "usage_type": "name" }, { "api_name": "django.shortcut...
226538049
# -*- coding: utf-8 -*- import nltk import re import codecs from pythainlp.tokenize import word_tokenize from time import sleep tknzr = nltk.tokenize.TweetTokenizer() word_features = [] def get_words_in_reviews(all_reviews): all_words = [] for (words, sentiment) in all_reviews: all_words.extend(words) return al...
null
sentiment.py
sentiment.py
py
4,852
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.tokenize.TweetTokenizer", "line_number": 8, "usage_type": "call" }, { "api_name": "nltk.tokenize", "line_number": 8, "usage_type": "attribute" }, { "api_name": "nltk.FreqDist", "line_number": 20, "usage_type": "call" }, { "api_name": "codecs.op...
219020483
import requests import json import time import text_processing as tp import making_ImageFeedback as mif def search_dict(partial, key): """ A handy function that searches for a specific `key` in a partial dictionary/list """ if isinstance(partial, dict): for k, v in partial.items(): ...
null
getting_feedback_as_image_from_youtube_comments/main.py
main.py
py
4,639
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.Session", "line_number": 36, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 42, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 74, "usage_type": "call" }, { "api_name": "text_processing.processedText"...
561534073
import argparse import re import sys import xlrd from datetime import datetime from pathlib import Path from pymarc import Record, Field def parse_title(string): title = [] if ':' in string: t = re.sub(r'^(.*?): (.*?), (.*)$', r'\g<1>', string) b = re.sub(r'^(.*?): (.*?), (.*)$', r'\g<2>', str...
null
comics2marc.py
comics2marc.py
py
21,576
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 13, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 14, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 15, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 20, "usage_type"...
10061454
# https://www.practicepython.org/exercise/2014/06/06/17-decode-a-web-page.html import requests from bs4 import BeautifulSoup ny_times_url = 'https://www.nytimes.com/' r = requests.get(ny_times_url) soup = BeautifulSoup(r.text, features='html.parser') for story_heading in soup.find_all(class_ = 'css-1ez5fsm'): try...
null
Decode_A_Web_Page.py
Decode_A_Web_Page.py
py
422
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 6, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
181181792
import time import pandas as pd from selenium import webdriver from selenium.webdriver.common.keys import Keys from bs4 import BeautifulSoup driver = webdriver.Chrome('./chromedriver') driver.maximize_window() driver.get("http://www.opinet.co.kr/user/main/mainView.do") time.sleep(2) driver.find_element_by_css_selecto...
null
05.Crawling/opinet.py
opinet.py
py
1,144
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 7, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 10, "usage_type": "call" }, { "api_name": "time.sleep", ...
649977134
from __future__ import (absolute_import, division, print_function) from pyPRMS.Exceptions_custom import ParameterError from pyPRMS.ParameterSet import ParameterSet from pyPRMS.constants import DIMENSIONS_HDR, PARAMETERS_HDR, VAR_DELIM import functools class ParameterFile(ParameterSet): """Class to handle read...
null
pyPRMS/ParameterFile.py
ParameterFile.py
py
7,372
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyPRMS.ParameterSet.ParameterSet", "line_number": 11, "usage_type": "name" }, { "api_name": "pyPRMS.constants.DIMENSIONS_HDR", "line_number": 93, "usage_type": "name" }, { "api_name": "pyPRMS.constants.PARAMETERS_HDR", "line_number": 104, "usage_type": "nam...
551616439
import zipfile import os #Klasorlerin pathlerini cikaran fonksiyon def dirpaths(way): dirpaths=[] for(dirpath,dirnames,filenames) in os.walk(way): dirpaths.append(dirpath) return dirpaths #Klasorlerdeki dosyalari kopyalayan fonksiyon def extractor(patharr): for y,x in enumerate(patharr): ...
null
ExtractorCli.py
ExtractorCli.py
py
933
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.walk", "line_number": 7, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 13, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.expanduser", "line_numb...
617624280
# force keras to use the cpu becuase it's actually faster for this size network #.import os import numpy as np import pandas as pd from numpy import cos, sin, pi import matplotlib.pyplot as plt import scipy.integrate as integrate #import matplotlib.animation as animation #from ipython.display import html import tens...
null
cartpole/rnn_ffnn_comp.py
rnn_ffnn_comp.py
py
4,551
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.zeros", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.concatenate", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.transpose", "line...
316578209
#!/usr/bin/env python # coding=utf-8 # Author: Junjie Wang # Mail: dreamboy.gns@sjtu.edu.cn # Website:http://www.dbgns.com # Blog:http://www.dbgns.com/blog import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import numpy as np import cv2 def imshow_grid(imgs, sqrtimg=32): """ visualize t...
null
pynn/utils/vis.py
vis.py
py
919
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ceil", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 26, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line...
345692766
import requests from bs4 import BeautifulSoup import smtplib #TESTED USING : https://www.amazon.sg/UltraShell-QuietComfort-Headphones-Replacement-Accessories/dp/B07R5LMJ2S/ref=pd_sim_23_3/357-5779832-6503746?_encoding=UTF8&pd_rd_i=B07R5LMJ2S&pd_rd_r=0c352e66-8284-40f3-880d-d3060fc5e7ee&pd_rd_w=j1M16&pd_rd_wg=YSMMM&pf...
null
scraper.py
scraper.py
py
3,383
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
439826783
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. from __future__ import annotations __all__ = ['Alignment'] import bisect from typing import Iterable, List, Optional, Tuple, cast, overload from ._typing import Bounds, Range class Alignment: """ An alignment bet...
null
python/bistring/_alignment.py
_alignment.py
py
8,741
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Iterable", "line_number": 24, "usage_type": "name" }, { "api_name": "_typing.Bounds", "line_nu...
347413096
import cv2 import sys import os import numpy as np import tflearn from tflearn.data_utils import shuffle from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.conv import conv_2d, max_pool_2d from tflearn.layers.normalization import batch_normalization from tflearn.layers.estimator ...
null
tensorflow/evaluate.py
evaluate.py
py
3,563
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 23, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 28, "usage_type": "call" }, { "api_name": "cv2.COLOR_RGB2GRAY", "line_number": 28, "usage_type": "attribute" }, { "api_name": "cv2.cvtC...
256512882
import configparser import ctypes as ct import numpy as np import sharpy.utils.exceptions as exceptions import sharpy.utils.cout_utils as cout import sharpy.utils.cout_utils as cout class DictConfigParser(configparser.ConfigParser): def as_dict(self): d = dict(self._sections) for k in d: ...
null
sharpy/utils/settings.py
settings.py
py
6,753
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sharpy.utils.cout_utils.cout_wrap", "line_number": 26, "usage_type": "call" }, { "api_name": "sharpy.utils.cout_utils", "line_number": 26, "usage_type": "name" }, ...
227576399
import unittest from unittest import TestCase from datetime import datetime from stack import Stack class PushTest(TestCase): ''' push: add an element to the class ''' def test_inserted_element(self): instance = Stack() element = 'element' instance.push(element) self.assertIn...
null
stack/stack_test.py
stack_test.py
py
3,684
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "stack.Stack", "line_number": 11, "usage_type": "call" }, { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "stack.Stack", "lin...
409297332
"""@package integration_test_fixtures Base classes for Nighthawk integration tests """ import json import logging import os import requests import socket import subprocess import sys import threading import time import pytest from test.integration.common import IpVersion, NighthawkException from test.integration.nigh...
null
test/integration/integration_test_fixtures.py
integration_test_fixtures.py
py
7,826
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ.get", "line_number": 22, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 22, "usage_type": "attribute" }, { "api_name": "test.integration.common.IpVersion.IPV4", "line_number": 24, "usage_type": "attribute" }, { "api_na...
88367230
""" Build and install the package. """ #from __future__ import division, print_function, absolute_import from setuptools import setup, find_packages NAME = 'ML_Train' FULLNAME = NAME AUTHOR = "Daniel Newman" AUTHOR_EMAIL = 'danielnewman09@gmail.com' LICENSE = "GNU GPLv3.0" URL = "https://github.com/danielnewman09/ML_...
null
.ipynb_checkpoints/setup-checkpoint.py
setup-checkpoint.py
py
2,304
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.find_packages", "line_number": 21, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 75, "usage_type": "call" } ]
275326476
import sqlite3 import matplotlib from os import path import numpy as np import matplotlib.pyplot as plt from matplotlib import ticker matplotlib.rcParams['text.usetex'] = True matplotlib.rcParams['text.latex.unicode'] = True plt.rc('font', family='serif') def flatten(l): """ inefficiently flattens a lis...
null
figures/vpn/vpn_dct_cdf.py
vpn_dct_cdf.py
py
5,713
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.rcParams", "line_number": 9, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 10, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 11, "usage_type": "call" }, { "api_name": ...
140913599
from django.urls import path from .views import ( BaseSpecView, CreateNewFeature, CreateNewCategory, CreateNewFeatureValidator, FeatureChoiceView, CreateFeatureView, NewProductFeatureView, SearchProductAjaxView, AttachNewFeatureToProduct, ProductFeatureChoicesAjaxView, Creat...
null
specs/urls.py
urls.py
py
1,789
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 21, "usage_type": "call" }, { "api_name": "views.BaseSpecView.as_view", "line_number": 21, "usage_type": "call" }, { "api_name": "views.BaseSpecView", "line_number": 21, "usage_type": "name" }, { "api_name": "django...
2044186
import numpy as np import pandas as pd import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--input', default='./analyze_padding_data.tcl') parser.add_argument('--output', default='../output_data/analyze_slack_time.csv') parser.add_argument('--time', defaul...
null
analyze_slack_time/transfer_to_csv.py
transfer_to_csv.py
py
732
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.float32", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pandas.DataFram...
274136262
import numpy as np import torch, pdb import pickle import matplotlib.pyplot as plt from tqdm import trange from utils.reinforcement_learning import get_returns, plot_trajectories, plot_rewards class Solver : def __init__(self, config, policy, sampler, metalearner) : self.config = config self.policy = policy se...
null
cuda/solver/solver.py
solver.py
py
6,765
python
en
code
null
code-starcoder2
66
[ { "api_name": "pickle.load", "line_number": 18, "usage_type": "call" }, { "api_name": "pickle.load", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.reinforcement_learning.get_returns", "line_number": 55, "usage_type": "call" }, { "api_name": "util...
142800542
from flask import Flask, render_template, request, redirect, json import requests from jinja2 import Template app = Flask(__name__) @app.route('/report', methods=['POST']) def report(): pcode = request.form['pcode'] post_code = requests.get('https://api.postcodes.io/postcodes/' + pcode) # return str(pos...
null
backend.py
backend.py
py
1,514
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask.request.form", "line_number": 11, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 11, "usage_type": "name" }, { "api_name": "requests.get", "...
506597977
from factory import database class CategoryModel(object): def __init__(self): self.db = database.Database() self.collection = 'genesys_categories' self.fields = { "knowledge_name": "string", "category": "string", "doc_type": "string", "questio...
null
assignment/src/models/category_model.py
category_model.py
py
800
python
en
code
null
code-starcoder2
66
[ { "api_name": "factory.database.Database", "line_number": 5, "usage_type": "call" }, { "api_name": "factory.database", "line_number": 5, "usage_type": "name" } ]
588576633
import sys import os import re import time import math import numpy as np import nltk from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer stopWords = set(stopwords.words('english')) snowStemmer = SnowballStemmer(language='english') docCount = 0 ans = "" def indexToJson(doc): fields =...
null
search.py
search.py
py
5,646
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 11, "usage_type": "name" }, { "api_name": "nltk.stem.snowball.SnowballStemmer", "line_number": 12, "usage_type": "call" }, { ...
351526276
#encoding: utf-8 import requests from bs4 import BeautifulSoup import json def get_page(): # 1. url url = "https://movie.douban.com/cinema/nowplaying/changsha/" # 2. 请求页面的时候应该发送什么数据 headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chro...
null
python_crawler/vastdata/douban_spider/douban_2.py
douban_2.py
py
863
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" } ]
299920559
from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.forms.models import model_to_dict from rest_framework.authentication imp...
null
test_script/update/views.py
views.py
py
12,647
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.search", "line_number": 58, "usage_type": "call" }, { "api_name": "re.search", "line_number": 63, "usage_type": "call" }, { "api_name": "django.http.JsonResponse", "line_number": 68, "usage_type": "call" }, { "api_name": "django.http.JsonResponse...
77308408
from itertools import product from operator import add, sub from Bio import SeqIO import sys def CarilloLippmanMSA(seqs): # Number of sequences dims = len(seqs) # Sequences lengths lengths = [ len(seq) for seq in seqs] # Cartesian product of "dims" dimension. # Each dimension has two elements: 0 and 1. Ele...
null
Lippman.py
Lippman.py
py
6,743
python
en
code
null
code-starcoder2
66
[ { "api_name": "itertools.product", "line_number": 16, "usage_type": "call" }, { "api_name": "itertools.product", "line_number": 22, "usage_type": "call" }, { "api_name": "operator.sub", "line_number": 173, "usage_type": "argument" }, { "api_name": "operator.sub", ...
211464142
# -*- coding: utf-8 -*- ''' Created on May 23, 2017 @author: joro ''' import os import sys import numpy as np import contextlib import wave import re from src.utilsLyrics.Utilz import loadTextFile from src.align.SectionLink import _SectionLinkBase from src.align.Lyrics import Lyrics, LyricsLine from src.for_englis...
null
src/align/GenericRecording.py
GenericRecording.py
py
14,330
python
en
code
null
code-starcoder2
66
[ { "api_name": "ParametersAlgo.ParametersAlgo.FOR_JINGJU", "line_number": 28, "usage_type": "attribute" }, { "api_name": "ParametersAlgo.ParametersAlgo", "line_number": 28, "usage_type": "name" }, { "api_name": "os.path.splitext", "line_number": 55, "usage_type": "call" ...
388714398
#!/usr/bin/env python3 # naive_stereo.py # This program performs block-based matching to create a depth map # given 2 stereo images. #Import the Image class from PIL (Pillow) from PIL import Image, ImageOps, ImageDraw import numpy as np import math ########### ########### MAX_DISPARITY = 50 ### PLAY AROUND WITH T...
null
lab5/stereo.py
stereo.py
py
3,434
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "PIL.Image.open", "line_number": 20, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number"...
91799247
""" Crop images around major object with set padding Note, that using these scripts for 1+GB images take several tens of GB RAM EXAMPLE ------- >> python crop_dataset_images.py \ -i "/datagrid/Medical/dataset_ANHIR/images/COAD_*/scale-100pc/*.png" \ --padding 0.1 --nb_jobs 2 Copyright (C) 2016-2018 Jiri Boro...
null
bm_dataset/crop_dataset_images.py
crop_dataset_images.py
py
3,769
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "multiprocessing.cpu_count"...
507043187
"""Implements SeismicBatch class for processing a small subset of seismic gathers""" import numpy as np from .gather import Gather from .semblance import Semblance, ResidualSemblance from .decorators import create_batch_methods, apply_to_each_component from .utils import to_list from ..batchflow import Batch, action,...
null
seismicpro/src/batch.py
batch.py
py
14,126
python
en
code
null
code-starcoder2
66
[ { "api_name": "batchflow.Batch", "line_number": 13, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 64, "usage_type": "attribute" }, { "api_name": "utils.to_list", "line_number": 73, "usage_type": "call" }, { "api_name": "batchflow.DatasetInd...
159969270
#!/usr/bin/env python # coding: utf-8 # In[1]: # -*- coding: utf-8 -*- """ Created on Thu May 27 2021 @author: Laique Abbas """ import os, numpy as np import cv2 import random import torch import torch.utils.data as data import xml.etree.ElementTree as ET from abc import ABCMeta, abstractmethod import scipy.cluster...
null
codebase/LabelSpreading.py
LabelSpreading.py
py
18,177
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 34, "usage_type": "call" }, { "api_name": "torch.utils.data.Dataset", "line_number": 41, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 41, "usage_type": "name" }, { "api_name":...
287208041
import os import json import glob from clarifai.rest import ClarifaiApp from clarifai.rest import Image as ClImage import secrets app = ClarifaiApp(secrets.CLARIFAI_APP_ID, secrets.CLARIFAI_APP_SECRET) model = app.models.get("general-v1.3") colorModel = app.models.get("color") # path to imgs os.chdir("../src/data/te...
null
python/run_clarifai.py
run_clarifai.py
py
2,101
python
en
code
null
code-starcoder2
66
[ { "api_name": "clarifai.rest.ClarifaiApp", "line_number": 9, "usage_type": "call" }, { "api_name": "secrets.CLARIFAI_APP_ID", "line_number": 9, "usage_type": "attribute" }, { "api_name": "secrets.CLARIFAI_APP_SECRET", "line_number": 9, "usage_type": "attribute" }, { ...
256506592
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import time import os import threading from copy import copy import rospy import tf from controller import Controller from std_msgs.msg import Empty from nav_msgs.msg import Odometry from sensor_msgs.msg import LaserScan from geometry_msgs.msg ...
null
src/t2.py
t2.py
py
12,866
python
en
code
null
code-starcoder2
66
[ { "api_name": "rospy.init_node", "line_number": 24, "usage_type": "call" }, { "api_name": "rospy.loginfo", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.repeat", "line_nu...
619919406
""" Tests for dit.pid.idownarrow. """ import pytest from dit.pid.idownarrow import i_downarrow, PID_downarrow from dit.pid.distributions import bivariates, trivariates def test_idownarrow1(): """ Test idownarrow on redundant distribution. """ d = bivariates['redundant'] uniques = i_downarrow(d, (...
null
dit/pid/tests/test_idownarrow.py
test_idownarrow.py
py
1,992
python
en
code
null
code-starcoder2
66
[ { "api_name": "dit.pid.distributions.bivariates", "line_number": 14, "usage_type": "name" }, { "api_name": "dit.pid.idownarrow.i_downarrow", "line_number": 15, "usage_type": "call" }, { "api_name": "pytest.approx", "line_number": 16, "usage_type": "call" }, { "api...
267244419
'''dm-nn stack for education/age/gender''' from datetime import datetime import numpy as np import pandas as pd from gensim.models import Doc2Vec from keras.layers.core import Dense, Dropout, Activation from keras.models import Sequential from keras.utils import np_utils from sklearn.cross_validation import KFold im...
null
dm_nn_stack.py
dm_nn_stack.py
py
2,602
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_pickle", "line_number": 16, "usage_type": "call" }, { "api_name": "cfg.data_path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 18, "usage_type": "call" }, { "api_name": "gensim.models.Doc2V...
370573130
import cv2 import matplotlib.pyplot as plt import numpy as np from PIL import Image as imag from PIL import ImageFilter, ImageEnhance import pytesseract as pt import os from tkinter import * import requests #load the cascade bottle_cascade=cv2.CascadeClassifier() #make the tkinter ui def make_window()...
null
dataset_automate_1.8.py
dataset_automate_1.8.py
py
3,252
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 58, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 60, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_...
269445436
"""MyDjango URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
null
MyDjango/urls.py
urls.py
py
2,323
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 22, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 22, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 22, "usage_type": "name" }, { "api_name...
399104562
# coding=UTF-8 # ----------------------------------------------------------------------------------------- # @author: plutoese # @date: 2015.10.10 # @class: AdminDatabase # @introduction: 类AdminDatabase表示行政区划数据库。 # @property: # - period: 数据库覆盖的年份 # @method: # - find(self,**conds):查询数据,参数conds是一系列参数。返回值是pymongo.cursor。...
null
application/DataWarehouse/database/class_admindatabase.py
class_admindatabase.py
py
2,429
python
en
code
null
code-starcoder2
66
[ { "api_name": "DataWarehouse.database.class_database.Database", "line_number": 19, "usage_type": "name" }, { "api_name": "DataWarehouse.database.class_database.Database.__init__", "line_number": 27, "usage_type": "call" }, { "api_name": "DataWarehouse.database.class_database.Data...
48314094
__author__ = 'Joe' import numpy as np import sys import cv2 import sharedmem as shmem import numexpr as ne from concurrent.futures import ThreadPoolExecutor def get_log_kernel(siz, std): x = y = np.linspace(-siz, siz, 2*siz+1) x, y = np.meshgrid(x, y) arg = -(x**2 + y**2) / (2*std**2) h =...
null
Miccai_challenge/fstack.py
fstack.py
py
5,716
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.meshgrid", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.float_info", "line_nu...
522406909
# Time: O(nlogn), n is the max of A # Space: O(n) # 982 # Given an array of integers A, find the # of triples of indices (i, j, k) such that: # # 0 <= i < A.length # 0 <= j < A.length # 0 <= k < A.length # A[i] & A[j] & A[k] == 0, where & represents the bitwise-AND operator. # # # Example 1: # # Input: [2,1,3] # Outp...
null
Python/triples-with-bitwise-and-equal-to-zero.py
triples-with-bitwise-and-equal-to-zero.py
py
2,006
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.Counter", "line_number": 56, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 74, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 75, "usage_type": "call" } ]
615661564
## nltk.download() script is broken; manually pull in required folders from http://www.nltk.org/nltk_data/ into 'nltk_data' folder in home directory import nltk from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords from nltk.stem import PorterStemmer from nltk.corpus import state_uni...
null
NLTKbasics.py
NLTKbasics.py
py
4,582
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.tokenize.sent_tokenize", "line_number": 27, "usage_type": "call" }, { "api_name": "nltk.tokenize.word_tokenize", "line_number": 32, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 45, "usage_type": "call" }, { ...
639959400
import cv2 import json import socket import numpy as np from io import BytesIO import struct # Capture frame cap = cv2.VideoCapture(0) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('localhost', 9998)) while cap.isOpened(): _, frame = cap.read() dim = (128, 128) frame = cv2.resize(fram...
null
src/webcamClient.py
webcamClient.py
py
626
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.VideoCapture", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 12, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 12, "usage_type": "attribute" }, { "api_name": "socket.SOCK_STREAM...
76143777
import pandas as pd from sklearn.model_selection import train_test_split, KFold, cross_val_score # Kfold : 교차 검증 from sklearn.model_selection import GridSearchCV # CV = cross validation from sklearn.metrics import accuracy_score from sklearn.svm import SVC # gridSearch # 내가 정해놓은 조건들을 충족하는 것을 전부다 가져온다. #1. dat...
null
ml/m11_gridSearch.py
m11_gridSearch.py
py
1,792
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 22, "usage_type": "call" }, { "api_name": "sklearn.model_selection.KFold", "line_number": 30, "usage_type": "call" }, {...
139896112
""" Scraper data structure Game contains game name, game id, items Item contains name, icon url, price history Price history contains date, median price, volume, rsi, macd, percentage change, turnover """ # Standard library from datetime import timedelta # To find all dates from sys import setrecursionlimit # To allow...
null
Minimum Viable Product/back_end/scraper_data.py
scraper_data.py
py
14,374
python
en
code
null
code-starcoder2
66
[ { "api_name": "scraper_support.get_game_name_from_id", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 161, "usage_type": "call" }, { "api_name": "scraper_support.sort_objects_by_date", "line_number": 164, "usage_type": "call"...
234983145
r""" Test utility functions ================== """ # Author: Nicholas Cain # License: 3-clause BSD import sphinx_gallery.utils as utils import pytest @pytest.mark.parametrize("file_name", ("some/file/name", "/corner.pycase")) def test_replace_py_ipynb(file_name): # Test behavior of function with expected input...
null
sphinx_gallery/tests/test_utils.py
test_utils.py
py
579
python
en
code
null
code-starcoder2
66
[ { "api_name": "sphinx_gallery.utils.replace_py_ipynb", "line_number": 17, "usage_type": "call" }, { "api_name": "sphinx_gallery.utils", "line_number": 17, "usage_type": "name" }, { "api_name": "pytest.raises", "line_number": 20, "usage_type": "call" }, { "api_name...
313167621
# Copyright 2019 Intel Corporation # # 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 wri...
null
tests/avalon_test_framework/tests/worker_tests/test_retrieve.py
test_retrieve.py
py
2,240
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "src.libs.avalon_test_base.AvalonBase", "line_number": 32, "usage_type": "call" }, { "api_name": "pytest.mark.setup_teardown_data", "line_number": 33, "usage_type": "call" }, {...
612423956
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from numpy import linalg as LA from multipledispatch import dispatch def sigmoid(z): """ The sigmoid function that returns the output of function for input z. This function will be used to predict the class for th...
null
logistic iris/logistic_IRIS.py
logistic_IRIS.py
py
8,195
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.exp", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 33, "usage_type": "call" }, { "api_name": "multipledispatch.dispatch", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.ndarray", "...
542574823
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Shoppingmall, Base, Cloth, User engine = create_engine('sqlite:///dresses.db') # Bind the engine to the metadata of the Base class so that the # declaratives can be accessed through a DBSession instance Bas...
null
clothes.py
clothes.py
py
3,272
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "database_setup.Base.metadata", "line_number": 9, "usage_type": "attribute" }, { "api_name": "database_setup.Base", "line_number": 9, "usage_type": "name" }, { "api_n...
149271559
#!/usr/bin/env python import argparse from matplotlib import pyplot as plt import datetime as dt parser = argparse.ArgumentParser(description="An implementation of the Boston Python Collatz Dash") parser.add_argument("-a", dest="a", type=int, required=True, help="Age of contestant A") parser.add_argument("-b", dest=...
null
scripts/Collatz Dash.py
Collatz Dash.py
py
1,874
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 58, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 58, "usage_type": "name" }, { "api_name": "dat...
391529171
import pygame import random import math from pygame import mixer pygame.init() #create a screen screen = pygame.display.set_mode((800,500)) background = pygame.image.load('bg3.jpg') # BACKGROUND SOUND mixer.music.load('background.wav') mixer.music.play(-1) #title and Icon pygame.display.set_caption('space invaders')...
null
spaceinvaders2.py
spaceinvaders2.py
py
3,848
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": 8, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.loa...
515447594
### pip install '/kaggle/input/dlibpkg/dlib-19.19.0' ### pip install '/kaggle/input/face-recognition/face_recognition_models-0.3.0/face_recognition_models-0.3.0' ### pip install '/kaggle/input/face-recognition/face_recognition-0.1.5-py2.py3-none-any.whl' ### pip install '/kaggle/input/imageio-ffmpeg/imageio_ffmpeg-...
null
sources/fake-detect-basic.py
fake-detect-basic.py
py
5,778
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.filterwarnings", "line_number": 29, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 31, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
650062178
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from numpy.random import rand from scipy import integrate import math #### NEED TO FIX ADAMS DISTRIBUTION### # 1: get random sets of points in galaxy -> copy procedure from randgalaxy file # 2: find relative location to sun (need...
null
mc_sn.py
mc_sn.py
py
5,782
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.rand", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.log", ...
321265176
# -*- coding: utf-8 -*- import scrapy from scrapy.spiders import CrawlSpider from scrapy import Selector import os import datetime from time import strftime #from scrapy.conf import settings from scrapy.utils.project import get_project_settings from ettoday.items import MoneyUDNItem import logging from tim...
null
money_udn_spider.py
money_udn_spider.py
py
8,651
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 19, "usage_type": "name" }, { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 28, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" },...
96673621
import os import csv import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier import pickle from sklearn.preprocessing import scale #set root directory rootdir = 'datasets' # def list_files(rootdir): list=[] for root, dirs, files in os.walk(rootdir): list=files pr...
null
real_time_engine/game-logic-master/model_training.py
model_training.py
py
1,582
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.walk", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 50, "usage_type": "call" }, { "api_name": "pickl...
575715438
import os import json from glob import glob data_folder = "/home/ubuntu/cs230_data" # bucket_dirs = glob("/home/ubuntu/cs230_data/*/") metadata_files = glob("/home/ubuntu/cs230_data/*/metadata.json") # Explore the Metadata Files Thoroughly def main(): # Metadata will be the concatenation of all the metadata.json ...
null
data_exploration/metadata_explore.py
metadata_explore.py
py
2,335
python
en
code
null
code-starcoder2
66
[ { "api_name": "glob.glob", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" } ]
174571354
import numpy as np import os import cv2 import tensorflow as tf import matplotlib.pyplot as plt import glob import keras_preprocessing import keras_applications from keras_preprocessing.image import ImageDataGenerator , array_to_img, img_to_array, load_img #DATADIR = "C:/aadhar" #gen = ImageDataGenerator(...
null
dection.py
dection.py
py
2,710
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.cvtColor", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 34, "usage_type": "attribute" }, { "api_name": "cv2.rectangle", "line_number": 40, "usage_type": "call" }, { "api_name": "cv2.putText", ...
29889074
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression train_data = pd.read_csv('Q4_train.csv') train_data = train_data.iloc[:,1:] test_data = pd.read_csv('Q4_test.csv') test_data = test_data.iloc[:,1:] x_train = np.array(train_data.iloc[:,0:-1]) y_tr...
null
9417exam/q4/q4.py
q4.py
py
3,848
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.array", "line_num...
338676574
''' Created on 2018年7月1日 @author: haogooder ''' import copy import json import logging import os import struct import time import sys current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(current_dir) from remote_call_client import RemoteCallClient class SangforIpcTool(object): ''' usage:...
null
remote_call_tools/remote_call_client/sangfor_remote_ipc_client.py
sangfor_remote_ipc_client.py
py
4,818
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path.append", "l...
198829076
from urllib.request import urlopen, quote import json import pandas as pd city = pd.read_csv("city.csv") ak = "" # 百度地图API密钥 def getlatlng(name): url = "http://api.map.baidu.com/geocoding/v3/" address = quote(name) url_com = url + '?' + 'address=' + address + '&output=json' + '&ak=' + ak ...
null
Wuhan_Road.py
Wuhan_Road.py
py
2,145
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "urllib.request.quote", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.request.urlopen", "line_number": 13, "usage_type": "call" }, { "api_name": "json.loads...
271392964
# ----------------------------------------------------------------------------- # IMPORT MODULES # ----------------------------------------------------------------------------- from pyomo.core import AbstractModel, Set, Param, PositiveReals from pyomo.core import NonNegativeIntegers, Binar...
null
models_RLT/constraints.py
constraints.py
py
13,583
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyomo.core.AbstractModel", "line_number": 18, "usage_type": "call" }, { "api_name": "pyomo.core.Set", "line_number": 26, "usage_type": "call" }, { "api_name": "pyomo.core.Set", "line_number": 27, "usage_type": "call" }, { "api_name": "pyomo.core.Set...
62124631
"""Main UI module, brings everything together.""" from tkinter import * # ui library from tkinter import ttk # themed ui components that match the OS from tkinter import messagebox # simple, standard modal dialogs import itertools import operator import random import math from srctools import Property from app impo...
null
src/app/UI.py
UI.py
py
64,451
python
en
code
null
code-starcoder2
66
[ { "api_name": "srctools.logger.get_logger", "line_number": 45, "usage_type": "call" }, { "api_name": "srctools.logger", "line_number": 45, "usage_type": "attribute" }, { "api_name": "BEE2_config.ConfigFile", "line_number": 77, "usage_type": "call" }, { "api_name":...
557739799
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from dateutil.relativedelta import relativedelta from frappe.utils import cint,...
null
erpnext/hr/doctype/payroll_entry/payroll_entry.py
payroll_entry.py
py
10,405
python
en
code
null
code-starcoder2
66
[ { "api_name": "frappe.model.document.Document", "line_number": 14, "usage_type": "name" }, { "api_name": "frappe.db.sql", "line_number": 31, "usage_type": "call" }, { "api_name": "frappe.db", "line_number": 31, "usage_type": "attribute" }, { "api_name": "frappe.db...
486137242
#!/usr/bin/env python3 #gruppe2 train dataset import json import numpy as np import cv2 import matplotlib.pyplot as plt import os from IPython import embed json_path = 'chongqigongmen/data_label/job-403751-4.json' train_anno_path = 'chongqigongmen/data_label/train_arch.json' test_anno_path = 'chongqigongmen/data_label...
null
data_group.py
data_group.py
py
3,715
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "line_number": 40, "usage_type": "attribute" }, { "api_name": "cv2.imread", "line_number": 5...
437081277
#! /usr/bin/python # -*- coding: utf-8 -*- """ Fixtures for Management Network As A Role test cases """ import pytest import art.rhevm_api.tests_lib.low_level.hosts as ll_hosts import art.rhevm_api.tests_lib.low_level.networks as ll_networks import art.rhevm_api.tests_lib.high_level.hosts as hl_hosts import rhevmtes...
null
art/tests/rhevmtests/networking/management_as_role/fixtures.py
fixtures.py
py
3,251
python
en
code
null
code-starcoder2
66
[ { "api_name": "rhevmtests.networking.config.HOSTS", "line_number": 23, "usage_type": "attribute" }, { "api_name": "rhevmtests.networking.config", "line_number": 23, "usage_type": "name" }, { "api_name": "rhevmtests.networking.config.VDS_HOSTS", "line_number": 24, "usage_t...
353620214
import logging from ..WKT import WKT from ..models.record import WKTRecord from ..models.record import Metadata from ..ographic.TriaxialOgraphicWKT import TriaxialOgraphicWKT from ..ographic.TriaxialOgraphicWKT import TriaxialOgraphicMetadata from ..ographic.OgraphicWKT import OgraphicWKT from ..ographic.OgraphicWKT im...
null
OGC_IAU2000_WKT_v2/Source_Python/wkt/ographic/OgraphicFactory.py
OgraphicFactory.py
py
8,962
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "models.record.Metadata.BODY", "line_number": 76, "usage_type": "attribute" }, { "api_name": "models.record.Metadata", "line_number": 76, "usage_type": "name" }, { "api_nam...
643827013
# -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Drafts-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Primary service for working with records and draf...
null
invenio_drafts_resources/services/records/service.py
service.py
py
18,522
python
en
code
null
code-starcoder2
66
[ { "api_name": "invenio_records_resources.services.RecordService", "line_number": 21, "usage_type": "name" }, { "api_name": "invenio_records_resources.services.ServiceSchemaWrapper", "line_number": 53, "usage_type": "call" }, { "api_name": "elasticsearch_dsl.query.Q", "line_nu...
228506660
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
null
src/scheduled-query/azext_scheduled_query/custom.py
custom.py
py
3,289
python
en
code
null
code-starcoder2
66
[ { "api_name": "vendored_sdks.azure_mgmt_scheduled_query.models.ConditionFailingPeriods", "line_number": 18, "usage_type": "call" }, { "api_name": "knack.util.CLIError", "line_number": 24, "usage_type": "call" }, { "api_name": "vendored_sdks.azure_mgmt_scheduled_query.models.Sched...
268765538
from keras.models import Model from keras.models import model_from_json from keras.layers import Input, Convolution2D, MaxPooling2D import numpy as np import matplotlib matplotlib.use("agg") import matplotlib.pyplot as plt # Import the model from the json file json_file = open('../data_out/model/model.json', 'r') load...
null
extra_point_1.py
extra_point_1.py
py
1,591
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 6, "usage_type": "call" }, { "api_name": "keras.models.model_from_json", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 20, "usage_type": "call" }, { "api_name": "keras.layers.In...
564032187
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html import pymysql from scrapy.utils.project import get_project_settings class mysqlPipeline(object): def __init__(self): settings = get_proje...
null
week13/spiders/spiders/pipelines.py
pipelines.py
py
1,150
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 10, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 11, "usage_type": "call" }, { "api_name": "pymysql.cursors", "line_number": 18, "usage_type": "attribute" } ]
590025163
from django.contrib.staticfiles.storage import HashedFilesMixin, ManifestStaticFilesStorage class StaticFiles(ManifestStaticFilesStorage): patterns = HashedFilesMixin.patterns + ( ("*.js", ( (r"""(['"](img\/.*?)['"])""", """\"%s\""""), )), ) def hashed_name(self, name, content...
null
storage.py
storage.py
py
583
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.staticfiles.storage.ManifestStaticFilesStorage", "line_number": 3, "usage_type": "name" }, { "api_name": "django.contrib.staticfiles.storage.HashedFilesMixin.patterns", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.stat...
401336876
""" Tests GLMRegressor converter. """ import unittest from sklearn import datasets from sklearn import linear_model from sklearn.svm import LinearSVR from onnxmltools import convert_sklearn from onnxmltools.convert.common.data_types import FloatTensorType class TestGLMRegressorConverter(unittest.TestCase): def _...
null
tests/sklearn/test_GLMRegressorConverter.py
test_GLMRegressorConverter.py
py
1,689
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sklearn.datasets.make_regression", "line_number": 15, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 15, "usage_type": "name" }, { "api_name...
634189638
# Copyright 2014 Kontron Europe GmbH # # 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 w...
null
src/HpiLibrary/__init__.py
__init__.py
py
19,654
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.Logging", "line_number": 31, "usage_type": "name" }, { "api_name": "utils.PerConnectionStorage", "line_number": 31, "usage_type": "name" }, { "api_name": "utils.PerConnectionStorage.__init__", "line_number": 33, "usage_type": "call" }, { "api_...
588476307
import nltk import re def bigramm(s): sentence = s.split() bigramed = list(nltk.bigrams(sentence)) # trigrammed =list(nltk.trigrams(sentence)) bigramlist = [('ነገር','ግን'),('ፊት','ለፍፊት'),('ፍርድ','ቤት'),('ትምህርት','ቤት'),('ሥነ','ቃል'),('ሥነ','ፅሁፍ'),('ሥነ','ጥበብ'), ('አዲሥ','አበባ'),('አዲስ','አበባ'),('ባህር','...
null
amharic_bigram_generator.py
amharic_bigram_generator.py
py
3,161
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.bigrams", "line_number": 5, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 94, "usage_type": "call" } ]
7151028
from django.conf.urls import url from djanalytics.charts.views import ( exit_page, page_visit, referrer, session, user, ) urlpatterns = [ url(r'^charts/session/$', session.SessionChart.as_view(), name='session_chart'), url(r'^charts/user/$', user.UserChart.as_view(), name='user_chart'), ...
null
djanalytics/charts/urls.py
urls.py
py
563
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "djanalytics.charts.views.session.SessionChart.as_view", "line_number": 11, "usage_type": "call" }, { "api_name": "djanalytics.charts.views.session.SessionChart", "line_number": 11,...
273908371
import logger as Informer from logger import Action import datetime import psutil import utils import os # ---- LOAD CONFIG ---- if not os.path.isfile('config.json'): CONFIG = utils.create_config_file() else: CONFIG = utils.load_config_file() try: PROCESS_NAME = CONFIG['DEFAULT']['PROCESS_NAME'] SLEEP...
null
main.py
main.py
py
2,430
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "utils.create_config_file", "line_number": 11, "usage_type": "call" }, { "api_name": "utils.load_confi...
406879183
from os import listdir, makedirs, path, system, popen import json from jsoncomment import JsonComment import time from shutil import copyfile, rmtree src_dir = 'data/test' incorrect_dir = 'data/incorrect' parser = JsonComment(json) total_count = 0 start = time.time() correct = {} incorrect = {} result = {} dirs = ...
null
check.py
check.py
py
2,029
python
en
code
null
code-starcoder2
66
[ { "api_name": "jsoncomment.JsonComment", "line_number": 10, "usage_type": "call" }, { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.isdir", "lin...
289969058
import os, logging, random, socket, time, select from .base import NBNS, NotConnectedError from .nmb_constants import TYPE_CLIENT, TYPE_SERVER, TYPE_WORKSTATION class NetBIOS(NBNS): log = logging.getLogger('NMB.NetBIOS') def __init__(self, broadcast = True, listen_port = 0): """ Instantiate ...
null
bin/lib/nmb/NetBIOS.py
NetBIOS.py
py
6,285
python
en
code
null
code-starcoder2
66
[ { "api_name": "base.NBNS", "line_number": 6, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 22, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_nu...
318382465
import os import lazy_dataset import numpy as np import torch from padertorch import Trainer from padertorch.contrib.je.data.transforms import Collate from padertorch.contrib.je.data.transforms import LabelEncoder from padertorch.contrib.je.modules.conv import CNN2d, CNN1d from padertorch.contrib.je.modules.global_poo...
null
sins/systems/asc/train.py
train.py
py
9,347
python
en
code
null
code-starcoder2
66
[ { "api_name": "sacred.Experiment", "line_number": 26, "usage_type": "call" }, { "api_name": "sins.paths.exp_dir", "line_number": 27, "usage_type": "name" }, { "api_name": "sins.utils.timestamp", "line_number": 27, "usage_type": "call" }, { "api_name": "sacred.obse...
106797878
from django.conf.urls import url from django.views.generic import RedirectView from . import views app_name = 'requests' urlpatterns = [ url(r'^$', RedirectView.as_view(url='my_requests/'), name='index'), url(r'^new_petty_cash_request/$', views.PettyCashFormView.as_view(), name='new_petty_cash_request'), ...
null
requests/urls.py
urls.py
py
504
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.views.generic.RedirectView.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "django.views.generic.RedirectView", "line_number": 9, "usage_type": "name" ...
136589085
from __future__ import unicode_literals import sys import os import time import subprocess import shlex from .instance import Rinstance from . import interface from . import api from . import callbacks from prompt_toolkit import Prompt from prompt_toolkit.eventloop import create_event_loop, set_event_loop, run_in_exec...
null
rice/application.py
application.py
py
6,985
python
en
code
null
code-starcoder2
66
[ { "api_name": "prompt_toolkit.Prompt", "line_number": 34, "usage_type": "name" }, { "api_name": "prompt_toolkit.formatted_text.ANSI", "line_number": 59, "usage_type": "call" }, { "api_name": "prompt_toolkit.formatted_text.ANSI", "line_number": 63, "usage_type": "call" }...
498246626
from django.shortcuts import render from rest_framework.views import APIView from rest_framework import permissions from rest_framework.response import Response from rest_framework import generics import django_filters.rest_framework from shop.models import Food from django.core import serializers as core_serializers f...
null
backend2/savefood/carts/views.py
views.py
py
7,537
python
en
code
null
code-starcoder2
66
[ { "api_name": "rest_framework.views.APIView", "line_number": 14, "usage_type": "name" }, { "api_name": "rest_framework.permissions.IsAuthenticated", "line_number": 15, "usage_type": "attribute" }, { "api_name": "rest_framework.permissions", "line_number": 15, "usage_type"...