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
618407604
from PIL import Image import os,sys import shutil if(len(sys.argv)==1): print("ファイルが存在しないよ!") input("ボタンを押してね!") sys.exit() count=0 for i in sys.argv[1:]: count=count+1 print(str(count)+"枚目は「"+i+"」") file=i if(os.path.exists(os.path.dirname(file)+"\Resize")==False): os.mkdir(os.path.dirname(file)+...
null
ワンクリック軽量.py
ワンクリック軽量.py
py
1,685
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number":...
167508745
"""empty message Revision ID: 26bec75584e5 Revises: bc5e7cba581f Create Date: 2018-04-03 13:50:26.021794 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '26bec75584e5' down_revision = 'bc5e7cba581f' branch_labels = None depends_on = None def upgrade(): # ...
null
migrations/versions/26bec75584e5_.py
26bec75584e5_.py
py
1,608
python
en
code
null
code-starcoder2
83
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
304524391
from django.shortcuts import render from django.template.loader import get_template from django.http import HttpResponse from .models import Expentry,Expcategory import logging logger = logging.getLogger('application') # Create your views here. def expenses_index(request): entries = Expentry.objects.all() so...
null
expenses/views.py
views.py
py
2,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Expentry.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Expentry.objects", "line_number": 12, "usage_type": "attribute" }, { "api_nam...
524448802
#run the code in 虛擬環境 #在指定頁面進行爬蟲 #database import codecs import mysql.connector import time import serial #spider import requests from bs4 import BeautifulSoup import serial from time import sleep mydb = mysql.connector.connect( host = "localhost", # Database IP address user = "# Database username", ...
null
ES/Python/Crawler.py
Crawler.py
py
3,038
python
en
code
null
code-starcoder2
83
[ { "api_name": "mysql.connector.connector.connect", "line_number": 15, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 15, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 15, "usage_type": "name" }, { "...
519058921
#!/usr/bin/python3 ''' state view module ''' from flask import jsonify, abort, request from models import storage, classes from api.v1.views import app_views @app_views.route('/states', methods=['GET']) def all_states(): ''' function returns all state objects ''' return jsonify([v.to_dict() for k, v i...
null
AirBnB_clone_v3/api/v1/views/states.py
states.py
py
1,968
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.jsonify", "line_number": 15, "usage_type": "call" }, { "api_name": "models.storage.all", "line_number": 15, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 15, "usage_type": "name" }, { "api_name": "api.v1.views.app_view...
323868325
import skvideo.io from skvideo.io import FFmpegWriter import cv2 import numpy as np if __name__ == '__main__': model_A = "faster_rcnn_inception_v2_coco_2017_11_08" model_B = "rc1_180k" video_names = ["bike2.mp4", "bus_motorbike.mp4", "cat_dog.mp4", "suitcase_person.mp4", "truck_car.mp4"] for vide...
null
research/object_detection/video_merger.py
video_merger.py
py
1,566
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.VideoCapture", "line_number": 14, "usage_type": "attribute" }, { "api_name": "cv2.VideoCapture", "line_number": 17, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 18, "usage_type": "call" }, { "api_name": "skvideo.io.FF...
619422657
import cv2 import serial print("Versão do OpenCV:", cv2.__version__) classificador = cv2.CascadeClassifier( "cascades/haarcascade_frontalface_default.xml") webCam = cv2.VideoCapture(1) porta = 'COM3' # linux ou mac em geral -> '/dev/ttyS0' velocidadeBaud = 115200 #ligarArduino = False ligarArduino = True i...
null
enxergar/POCs/video3_2_arduino/assistenteMilGrauVisaoDetectarArduino.py
assistenteMilGrauVisaoDetectarArduino.py
py
2,311
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.__version__", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.CascadeClassifier", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 8, "usage_type": "call" }, { "api_name": "serial.Seria...
371462863
from discord.ext import commands, menus import utils import random , discord, os, importlib, mystbin, typing, aioimgur, functools, tweepy import traceback, textwrap from discord.ext.menus.views import ViewMenuPages class Owner(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(brief="a c...
null
cogs/owner.py
owner.py
py
20,373
python
en
code
null
code-starcoder2
83
[ { "api_name": "discord.ext.commands.Cog", "line_number": 7, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 7, "usage_type": "name" }, { "api_name": "utils.BetterUserconverter", "line_number": 12, "usage_type": "attribute" }, { "a...
522490840
# coding: utf-8 import scrapy from urllib.parse import urlparse, parse_qs class AllStocks(scrapy.Spider): name = "allStocks" def start_requests(self): pages = 464 urls = [] for i in range(0, 464): x = i + 1 url = 'http://stock.finance.sina.com.cn/usstock/api...
null
tutorial/tutorial/spiders/allStock.py
allStock.py
py
951
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.parse.parse_qs", "line_number": 21, "usage_type": "call" }, { "api_name": "urllib.parse.u...
530887272
#!/usr/bin/env python # -*- coding: utf-8 -*- import httplib import urllib import json import os tempData = { "data": [ { "TOTAL_CAL": "825", "MENU": [ { "LUNCH_MENU_NM": "뚝배기어묵탕*어묵사리", "LUNCH_MENU_ESTIMATION": 0, "LUNCH_ROOM_NM": "가마" }, { ...
null
reply_local.py
reply_local.py
py
6,283
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 187, "usage_type": "call" } ]
386195789
import csv import io import json import pickle from base64 import b64decode from datetime import datetime from flask import g, make_response from crc import db, session from crc.api.common import ApiError from crc.models.approval import Approval, ApprovalModel, ApprovalSchema, ApprovalStatus from crc.models.workflow ...
null
crc/api/approval.py
approval.py
py
5,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.g.user", "line_number": 21, "usage_type": "attribute" }, { "api_name": "flask.g", "line_number": 21, "usage_type": "name" }, { "api_name": "crc.db.session.query", "line_number": 23, "usage_type": "call" }, { "api_name": "crc.models.approval.Ap...
616464747
from typing import List from http import HTTPStatus from kentik_api.api_calls import custom_dimensions from kentik_api.api_resources.base_api import BaseAPI from kentik_api.public.types import ID from kentik_api.public.custom_dimension import CustomDimension, Populator from kentik_api.requests_payload import custom_di...
null
kentik_api_library/kentik_api/api_resources/custom_dimensions_api.py
custom_dimensions_api.py
py
5,888
python
en
code
null
code-starcoder2
83
[ { "api_name": "kentik_api.api_resources.base_api.BaseAPI", "line_number": 13, "usage_type": "name" }, { "api_name": "kentik_api.public.custom_dimension.Populator", "line_number": 16, "usage_type": "name" }, { "api_name": "kentik_api.api_calls.custom_dimensions.create_populator", ...
350127618
import os.path as osp import collections as col import numpy as np import mastic.molecule as masticmol import mastic.features as masticfeat import mastic.config.features as masticfeatconfig from rdkit import RDConfig from rdkit import Chem from rdkit.Chem import ChemicalFeatures class RDKitMoleculeWrapper(object):...
null
mastic/interfaces/rdkit.py
rdkit.py
py
16,231
python
en
code
null
code-starcoder2
83
[ { "api_name": "mastic.molecule.AtomType", "line_number": 203, "usage_type": "call" }, { "api_name": "mastic.molecule", "line_number": 203, "usage_type": "name" }, { "api_name": "mastic.molecule.AtomType", "line_number": 211, "usage_type": "call" }, { "api_name": "...
236043080
"""Definition of the ImageAnnex content type """ from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import image from Products.ATContentTypes.content import schemata from collective.book import BookMessageFactory as _ from collective.book.interfaces impo...
null
packages/collective.book/tags/0.2/collective/book/content/imageannex.py
imageannex.py
py
1,316
python
en
code
null
code-starcoder2
83
[ { "api_name": "Products.ATContentTypes.content.image.ATImageSchema.copy", "line_number": 15, "usage_type": "call" }, { "api_name": "Products.ATContentTypes.content.image.ATImageSchema", "line_number": 15, "usage_type": "attribute" }, { "api_name": "Products.ATContentTypes.content...
400626726
import os import sys import numpy as np from sleeplearning.lib.models.single_chan_expert import SingleChanExpert root_dir = os.path.abspath(os.path.join(os.path.dirname('__file__'), '..')) sys.path.insert(0, root_dir) import torch from torch import nn import sleeplearning.lib.base class Ensembler(nn.Module): def ...
null
sleeplearning/lib/models/ensembler.py
ensembler.py
py
1,702
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_nu...
184444072
from Bio import SeqIO import ahocorasick import logging def load_data(fasta_file, kmer_file): logging.info("Loading fasta file") fasta_list = list(SeqIO.parse(fasta_file,"fasta")) logging.info("Loading kmer list") kmer_list = [line.rstrip('\n') for line in open(kmer_file)] return fasta_list, kmer_l...
null
U3.1_PreQualifiedMinSet.py
U3.1_PreQualifiedMinSet.py
py
1,426
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.info", "line_number": 6, "usage_type": "call" }, { "api_name": "Bio.SeqIO.parse", "line_number": 7, "usage_type": "call" }, { "api_name": "Bio.SeqIO", "line_number": 7, "usage_type": "name" }, { "api_name": "logging.info", "line_number":...
128219063
from operator import itemgetter import pygame from bird import Bird from pipe import Pipe import numpy as np import random SHAPE = (500, 500) BLACK = (0, 0, 0) WHITE = (255, 255, 255) WIDTH = SHAPE[0] HEIGHT = SHAPE[1] POPULATION = 30 np.random.seed(1) random.seed(1) pygame.init() screen = pygame.display.set_mode(SHA...
null
main.py
main.py
py
7,151
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 15, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.init", "li...
39434165
import json U = 'UP' D = 'DOWN' L = 'LEFT' R = 'RIGHT' with open('configuration.json', 'r') as configuration: data = json.load(configuration) START = data['start'] END = data['end'] N = int(pow(len(START), 1/2)) if len(START) == len(END) else None node_goal = None class PuzzleState: def __init__(s...
null
puzzle/iterative_deepening_search.py
iterative_deepening_search.py
py
2,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 119, "usage_type": "call" } ]
238679679
from django.db import models from users.models import Person from ticker.models import ticker, Sector, Industry from django.db.models import Q, Sum from decimal import Decimal from resources.views import StockPriceReturner import datetime class Portfolio(models.Model): Name=models.CharField(max_length=512, blank...
null
portfolios/models.py
models.py
py
11,274
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 12, "usage_type": "call" }, { "api_name"...
120731195
from matplotlib.text import Text import matplotlib.pyplot as plt from matplotlib import transforms, lines import numpy as np import pandas as pd from scipy import stats def pvalAnnotation_text(x, pvalueThresholds): singleValue = False if type(x) is np.array: x1 = x else: x1 = np.array([x]...
null
statannot.py
statannot.py
py
5,789
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 12, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.Series", "li...
546866021
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ import pytest from crime_data.resources.meta import FAMILIES class TestCodesEndpoint: @pytest.mark.parametrize('endpoint', FAMILIES) def test_meta_endpoint_exists(self, testapp, endpoint): res = testapp...
null
tests/functional/test_meta.py
test_meta.py
py
655
python
en
code
null
code-starcoder2
83
[ { "api_name": "crime_data.resources.meta.FAMILIES", "line_number": 16, "usage_type": "name" }, { "api_name": "pytest.mark.parametrize", "line_number": 10, "usage_type": "call" }, { "api_name": "crime_data.resources.meta.FAMILIES", "line_number": 10, "usage_type": "argumen...
472123909
# #!/usr/bin/env python # # -*- coding: utf-8 -*- # # ''' # Created on 26 Jul 2019 # # @author: Ajay # ''' # from pp_final import preprocessor from sklearn.naive_bayes import BernoulliNB pp = preprocessor("topic", "bnb") clf = BernoulliNB() model = clf.fit(pp.X_train, pp.y_train) predicted_y = mode...
null
BNB_topics.py
BNB_topics.py
py
839
python
en
code
null
code-starcoder2
83
[ { "api_name": "pp_final.preprocessor", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.naive_bayes.BernoulliNB", "line_number": 14, "usage_type": "call" } ]
338558519
# 线性回归 import tensorflow as tf import numpy as np import random import matplotlib.pyplot as plt # 获得数据 / 10 只是让数据好看一点 def getBatch(batchSize,start=None): if start==None: start = random.randint(1, 10000) n = np.linspace(start, start+batchSize, batchSize, endpoint=True).reshape((batchSize,1)) / 10 ...
null
Linear Regression/3.1.py
3.1.py
py
2,770
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randint", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number"...
583990275
#!/usr/bin/env python """ Provides functionality to configure environment variables for agent. """ __copyright__ = '(c) Webyog, Inc' __author__ = 'Vishal P.R' __email__ = 'hello@sealion.com' import os import sys import getopt import re import json import subprocess #add module lookup paths to sys.path so that impo...
null
code/bin/configenv.py
configenv.py
py
5,867
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path.insert", "...
568778118
import sqlite3 from employee import Employee def insert_emp(conn, cursor, emp): with conn: cursor.execute( "INSERT INTO employees VALUES (:first, :last, :pay)", {'first': emp.first, 'last': emp.last, 'pay': emp.pay} ) def get_emps_by_name(cursor, lastname): cursor.ex...
null
main.py
main.py
py
1,575
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 33, "usage_type": "call" }, { "api_name": "employee.Employee", "line_number": 49, "usage_type": "call" } ]
330572394
#!/usr/bin/env python # coding: utf-8 #Testing chipping part#!/usr/bin/env python # coding: utf-8 from keras.models import load_model import os import keras from keras.layers import Dense, Input, Reshape, Flatten, Dropout from keras import models import matplotlib.pyplot as plt import numpy as np from keras.layers im...
null
working_gan/team_gmu_chip.py
team_gmu_chip.py
py
6,064
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 17, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_num...
67449781
from py_komoran3.komoran3py import KomoranPy ko = KomoranPy() ko.set_user_dictionary('./py_komoran3/user_dictionary.txt') # 채팅로그 불러오는 함수 def openlog( bj_code, filename, platform = 'twitch_live_chat') : """ '../../data/{0}/{1}/{2}'.format(platform, bj_code, filename) platform : 플랫폼 폴더명 (기본 : twitch_live_c...
null
lib/analysis/chat_wordcount.py
chat_wordcount.py
py
4,932
python
en
code
null
code-starcoder2
83
[ { "api_name": "py_komoran3.komoran3py.KomoranPy", "line_number": 2, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 26, "usage_type": "call" }, { "api_name": "nltk.Text", "line_number": 51, "usage_type": "call" }, { "api_name": "pickle.dump", ...
139187466
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from typing import Optional from PyQt5.QtCore import QCoreApplication, pyqtSlot, Qt from PyQt5.QtWidgets import QApplication, QComboBox from window import Window, Dialog class MainWindow(Window): def __init__(self): super().__init__("../MainWindow...
null
PyQt5/main.py
main.py
py
2,228
python
en
code
null
code-starcoder2
83
[ { "api_name": "window.Window", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QComboBox", "line_number": 25, "usage_type": "name" }, { "api_name": "PyQt5.QtCore....
471615803
from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty,\ ObjectProperty from kivy.vector import Vector from kivy.clock import Clock from kivy.uix.button import Button from kivy.core.window import Window from kivy.uix.label import Label import s...
null
game.py
game.py
py
3,403
python
en
code
null
code-starcoder2
83
[ { "api_name": "kivy.uix.widget.Widget", "line_number": 18, "usage_type": "name" }, { "api_name": "kivy.properties.NumericProperty", "line_number": 20, "usage_type": "call" }, { "api_name": "kivy.properties.NumericProperty", "line_number": 21, "usage_type": "call" }, {...
98837974
from __future__ import absolute_import import io import pandas as pd from dask.bytes import open_files, read_bytes import dask from ..utils import insert_meta_param_description, make_meta def to_json( df, url_path, orient="records", lines=None, storage_options=None, compute=True, encoding...
null
downloadable-site-packages/dask/dataframe/io/json.py
json.py
py
7,327
python
en
code
null
code-starcoder2
83
[ { "api_name": "dask.bytes.open_files", "line_number": 64, "usage_type": "call" }, { "api_name": "dask.delayed", "line_number": 75, "usage_type": "call" }, { "api_name": "dask.compute", "line_number": 79, "usage_type": "call" }, { "api_name": "pandas.read_json", ...
395430693
import boto3 file=open(r"C:\Users\vikash.kumar67\Desktop\instance.txt","r") session =boto3.Session(profile_name='default') ec2=session.client(service_name='ec2') ssm=session.client(service_name='ssm') for each in file: #ec2.stop_instances(InstanceIds=each) print(each) #each=str(each).strip('\n')...
null
stopping services.py
stopping services.py
py
501
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.Session", "line_number": 5, "usage_type": "call" } ]
453090071
from django import forms from django.utils.safestring import mark_safe import re import string from stars.apps.credits.models import (CreditSet, Category, Subcategory, Credit, ...
null
stars/apps/institutions/data_displays/forms.py
forms.py
py
6,943
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.Form", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 23, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 25, "usage_type": "call" }, { "api_name": "django.for...
165473543
# -*- coding: utf-8 -*- """ This module manages all pip processes. """ import os import logging from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QProcess from PyQt5.QtWidgets import QApplication logger = logging.getLogger(__name__) #]=========================================================================...
null
venvipy/manage_pip.py
manage_pip.py
py
4,560
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QProcess", "line_number": 24, "usage_type": "call" }, { "api_name": "PyQt5.QtCore.QProcess.NormalExit", "line_number": 29, "usage_type": "attribute" }, { "api...
68522467
"""eshop_grigoris URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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') Cl...
null
eshop_grigoris/urls.py
urls.py
py
7,184
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 25, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 25, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 25, "usage_type": "name" }, { "api_name...
131462249
import tensorflow as tf import numpy as np import sklearn as sk from sklearn.linear_model import SGDClassifier from sklearn.datasets import fetch_openml from sklearn.model_selection import train_test_split import xgboost as xgb from sklearn import svm, naive_bayes import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' np....
null
tf_mnist.py
tf_mnist.py
py
4,774
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.random.seed", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sklearn.datasets....
617183754
"""Registry URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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
registry/urls.py
urls.py
py
2,583
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 27, "usage_type": "call" }, { "api_name": "views.registry.home", "line_number": 27, "usage_type": "attribute" }, { "api_name": "views.registry", "line_number": 27, "usage_type": "name" }, { "api_name": "django.c...
300879573
import logging import re import semver import sys import reconcile.queries as queries from reconcile.status import ExitCodes from utils.aws_api import AWSApi from utils.aws.route53 import State, Account, Record, Zone from utils.aws.route53 import DuplicateException QONTRACT_INTEGRATION = 'aws-route53' QONTRACT_INT...
null
reconcile/aws_route53.py
aws_route53.py
py
14,031
python
en
code
null
code-starcoder2
83
[ { "api_name": "semver.format_version", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 34, "usage_type": "call" }, { "api_name": "logging.info", "line_number": 52, "usage_type": "call" }, { "api_name": "logging.info", "l...
556760686
import numpy as np import zmes_hook_helpers.common_params as g import zmes_hook_helpers.log as log import sys import cv2 import time import datetime import re # Class to handle Yolo based detection class Yolo: # The actual CNN object detection code # opencv DNN code credit: https://github.com/arunponnusamy/...
null
hook/zmes_hook_helpers/yolo.py
yolo.py
py
8,038
python
en
code
null
code-starcoder2
83
[ { "api_name": "zmes_hook_helpers.common_params.config", "line_number": 24, "usage_type": "attribute" }, { "api_name": "zmes_hook_helpers.common_params", "line_number": 24, "usage_type": "name" }, { "api_name": "zmes_hook_helpers.common_params.config", "line_number": 25, "...
166514249
from collections import namedtuple import networkx as nx import matplotlib.pyplot as plt Chemin = namedtuple('Chemin', ['Trajet', 'Cout', 'Autonomie']) def creerGraphe(nomFichier): fichierTexte = open(nomFichier, "r") blocks = fichierTexte.read().rsplit('\n\n') sommets = [] for line in blocks[0].spli...
null
perso/graphe_lotfi.py
graphe_lotfi.py
py
8,289
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.namedtuple", "line_number": 5, "usage_type": "call" }, { "api_name": "networkx.Graph", "line_number": 213, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 215, "usage_type": "call" }, { "api_name": "matplot...
393485838
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import from __future__ import division import matplotlib matplotlib.use( 'Agg' ) # use Agg backend to run on servers import matplotlib.pyplot as plt import numpy as np import scipy.io import tensorflow...
null
run_vae.py
run_vae.py
py
10,994
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.use", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.empty", "line_n...
214711115
import traceback from unittest import TestCase import asyncio import time from multicp.pool.TransactionPool import Transaction from multicp.query.Query import Query from injection.Boostrap import Bootstrap from injection.Facades import inject from multicp.Facades import Multicp from multicp.util.DateUtil import ti...
null
multicp/tests/TBTest.py
TBTest.py
py
2,108
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "injection.Boostrap.Bootstrap", "line_number": 20, "usage_type": "name" }, { "api_name": "asyncio.get_event_loop", "line_number": 21, "usage_type": "call" }, { "api_name": ...
328838796
import os import sys from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer sys.path.append(os.pardir) from Notebooks.LinkDatabases.FacebookData import FacebookDataDatabase class SentimentAnalyzer: analyser = SentimentIntensityAnalyzer() @staticmethod def GetPostSentiment(postId): ...
null
graphs/qq_plots/PostVsCommentSentiment/Regression.py
Regression.py
py
1,424
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.pardir", "line_number": 6, "usage_type": "attribute" }, { "api_name": "vaderSentiment.vaderSentime...
179213678
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time    : 2019/9/2 23:49 # @Author  : Paulson # @File    : day3.py # @Software: PyCharm # @define : function import numpy as np import pandas as pd from sklearn.datasets import load_boston from sklearn.linear_model import LinearRegression, SGDRegressor, Ridge, Logistic...
null
sklearn_base/day3.py
day3.py
py
4,290
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_boston", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.StandardScaler", "line_number": 33, "usage_ty...
413730152
import os import sys import healpy as hp import matplotlib.pyplot as plt import numpy as np import pylab import requirements as req #pylab.rc('text', usetex=True) #pylab.rc('font', family='serif') telescope = "LAT" bands = "LFL1", "LFL2", "MFL1", "MFL2", "HFL1", "HFL2" nband = len(bands) site = "chile" nside = 4096...
null
reference_tool_round_2/validation/validate_chlat.apod.py
validate_chlat.apod.py
py
7,534
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.genfromtxt", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.genfromtxt", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "lin...
39051373
from django.contrib import admin from cisuba.account.models import Account, Hello from cisuba.models import PartnerProduct, Board from cisuba.models import PartnerProduct_Image, ProductTag, ProductDivsion from web.models import Anounce, Faq, Event, PartnerJoin # Register your models here. """ class PartnerbranchProd...
null
cisuba/admin.py
admin.py
py
2,503
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.TabularInline", "line_number": 33, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 33, "usage_type": "name" }, { "api_name": "cisuba.models.PartnerProduct_Image", "line_number": 34, "usage_type": "name"...
215381946
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager import time...
null
test/test_conduit.py
test_conduit.py
py
8,618
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.chrome.options.Options", "line_number": 15, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 17, "usage_type": "name" }, {...
382472416
from django.shortcuts import render, get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from .models import Category, Product, Brand from cart.forms import CartAddProductForm from .forms import PriceForm from blog.forms import CommentForm from blog.models import Comment def bas...
null
shop/views.py
views.py
py
4,117
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Category.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Category.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Category", "line_number": 11, "usage_type": "name" }, { "api_name...
459568341
# -*- coding: utf-8 -*- ''' import subprocess #p = subprocess.check_output(["python", "/Users/shrey/test.py"]) #p = subprocess.check_output(["echo" "hi"]) #p = subprocess.run(["echo $(python /Users/shrey/test.py)"], shell=True, stdout=subprocess.PIPE) p1 = subprocess.run(['C:/Python27/python.exe', 'C:/Users/Amanul/Do...
null
CODE/.ipynb_checkpoints/interface-checkpoint.py
interface-checkpoint.py
py
8,587
python
en
code
null
code-starcoder2
83
[ { "api_name": "stanfordcorenlp.StanfordCoreNLP", "line_number": 28, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 36, "usage_type": "call" }, { "api_name": "skip_thought_vector.skip_thought_vector", "line_number": 127, "usage_type": "call" } ]
519800689
# -*_ coding:utf-8 _*- import openpyxl class DoExcel: # def __init__(self,ExcelName,SheetName): # #ExcelReadName,SheetReadName,ExcelWriteName,SheetWriteName): # self.ExcelName = ExcelName # self.SheetName = SheetName # # self.ExcelWriteName = ExcelWriteName # # self...
null
homework/homework_1108/DoExcel.py
DoExcel.py
py
2,888
python
en
code
null
code-starcoder2
83
[ { "api_name": "openpyxl.load_workbook", "line_number": 14, "usage_type": "call" }, { "api_name": "openpyxl.load_workbook", "line_number": 35, "usage_type": "call" } ]
353183196
__author__ = 'salamio' import configparser class RConfig(configparser.RawConfigParser): def as_dict(self): d = dict(self._sections) for k in d: d[k] = dict(self._defaults, **d[k]) d[k].pop('__name__', None) return d if __name__ == "__main__": f = RConfig() ...
null
aliens/PythonProjects/RedshiftDeployment/core/RConfig.py
RConfig.py
py
415
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.RawConfigParser", "line_number": 7, "usage_type": "attribute" } ]
393366134
from collections import defaultdict, deque input = [line.strip() for line in open("../Inputs/day12", "r")] map = defaultdict(list) for line in input: left, right = line.split("-") if right != "start": map[left].append(right) if left != "start": map[right].append(left) def singleVisit(map):...
null
2021/AoC2021Day12/AoC2021Day12.py
AoC2021Day12.py
py
1,638
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.defaultdict", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 14, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 31, "usage_type": "call" } ]
328548779
# Given a set of n jobs where each job i has a deadline di >=1 and profit pi>=0. # Only one job can be scheduled at a time. Each job takes 1 unit of time to complete. # We earn the profit if and only if the job is completed by its deadline. # The task is to find the subset of jobs that maximizes profit. import itert...
null
python/disjoint_set/job_sequencing_problem.py
job_sequencing_problem.py
py
1,659
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.count", "line_number": 9, "usage_type": "call" } ]
54741425
import sys from cx_Freeze import setup, Executable from sportorg import config base = None if sys.platform == 'win32': base = 'Win32GUI' include_files = [config.LOCALE_DIR, config.TEMPLATE_DIR, config.IMG_DIR, config.SOUND_DIR, config.base_dir('LICENSE'), config.base_dir('changelog.md'), config.b...
null
setup.py
setup.py
py
1,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.platform", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sportorg.config.LOCALE_DIR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sportorg.config", "line_number": 9, "usage_type": "name" }, { "api_name": "sporto...
295819976
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np mnist = tf.keras.datasets.mnist #28*28 images of hand-written digits 0-9 (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = tf.keras.utils.normalize(x_train, axis=1) #normalization x_test = tf.keras.utils.normalize(x_test, axi...
null
sentdex tutorial/tensorflow/trying_tensorflow.py
trying_tensorflow.py
py
2,039
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.keras", "line_number": 5, "usage_type": "attribute" }, { "api_name": "tensorflow.keras.utils.normalize", "line_number": 9, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 9, "usage_type": "attribute" }, { "api_nam...
636782877
#!/usr/bin/env python3 #SenseHatLogger. Author: kurtd5105 from sense_hat import SenseHat import argparse import sys import time from datetime import datetime from datetime import timedelta from itertools import product #Create a dictionary for the representation of the numbers in a pixel array numbers = {...
null
logger.py
logger.py
py
12,544
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.product", "line_number": 108, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 246, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 287, "usage_type": "call" }, { "api_name": "sense_hat.Sen...
448022421
""" Handler ------------------- Basic tfs-to-pandas io-functionality. :author: Jaime :module: handler """ import logging from collections import OrderedDict from contextlib import suppress from os.path import basename, dirname from typing import Union import numpy as np import pandas from pandas import DataFrame L...
null
tfs/handler.py
handler.py
py
11,262
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.floating", "line_number": 28, "usage_type": "attribute" }, { "api_name": "numpy.integer", "line_number": 29, "usage_type": "attribute" }, { "api_name": "numpy.bool_"...
510142583
'''https://www.kaggle.com/crawford/resize-and-save-images-as-hdf5-256x256 This code can be used to convert images into ONE h5 file where the Key address will be "train_img" or change it in line 49 ''' import cv2 import datetime as dt import h5py import matplotlib.pyplot as plt import matplotlib.pylab as plb import num...
null
read_and_conver_images_to_h5/testing.py
testing.py
py
1,357
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path"...
485377736
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import logging import threading from time import sleep from datetime import datetime, timedelta import urlparse import requests import urllib from requests.exceptions import ConnectionError from selenium import webdriver from selenium.webdriver....
null
digger/management/commands/get_items.py
get_items.py
py
7,648
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 41, "usage_type": "attribute" }, { "api_name": "digger.utils.UtilsMixin", "line_number": 41, "usage_type": "name" }, { "api_name": "threa...
517218316
""" # Copyright 2020 ABHINAV RAWAT # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
null
pyembedded/gps_module/gps.py
gps.py
py
4,446
python
en
code
null
code-starcoder2
83
[ { "api_name": "serial.Serial", "line_number": 28, "usage_type": "call" } ]
525891851
from django.conf.urls import url, include from rest_framework import routers from apps.api.views.lessons import LessonSetViewSet, LessonViewSet, PageViewSet, FavoriteViewSet, \ LogLessonViewSet from apps.api.views.question import QuestionViewSet, AnswerViewSet, UserAnswerViewSet fro...
null
apps/api/urls.py
urls.py
py
1,054
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 10, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 10, "usage_type": "name" }, { "api_name": "apps.api.views.userprofile.UserViewSet", "line_number": 11, "usage_type": "ar...
96914998
import os import sys from PIL import Image if __name__ == '__main__': dataset_path = ['val', 'test'] input_dir_name = 'face_dataset_RGB' target_dir_name = 'face_dataset_depth_8bit' result_dir_name = 'result' for dataset in dataset_path: count = 1 input_dir_path = os.path.join(os....
null
datasets/preprocess_pandora_dataset.py
preprocess_pandora_dataset.py
py
1,586
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.join", "line_number":...
323761261
# -*- coding: utf-8 -*- import datetime from time import sleep import os def timer(time=25): now = datetime.datetime.now() after = now + datetime.timedelta(minutes = time) while datetime.datetime.now() < after: sleep(1) os.system('clear') now = datetime.datetime.now() de...
null
days/01-03-datetimes/pomodoro.py
pomodoro.py
py
648
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "attribute" }, { "api_name": "datetime.timedelta", "line_number": 12, "usage_type": "call" }, { "api_name": "datet...
85164171
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np from numpy.linalg import solve from scipy.linalg import eigvals, logm, norm def is_stable(A, domain='z'): """Determines if a linear state-space model is stable from eigenvalues of `A` Parameters ---------- A : ndarray(n,n) sta...
null
pyvib/lti_conversion.py
lti_conversion.py
py
4,954
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.linalg.eigvals", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.real", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.linalg.eigvals", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.vstack", ...
250976533
from ref_caradisiac.spiders.caradisiac import RefModeleSpider, RefMarqueSpider from scrapy.crawler import CrawlerProcess import re, io, json, os, time os.environ.setdefault('SCRAPY_SETTINGS_MODULE', 'ref_caradisiac.settings') #add path to scrapy settings to the project from scrapy.utils.project import get_project_set...
null
main.py
main.py
py
1,244
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.setdefault", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 5, "usage_type": "attribute" }, { "api_name": "scrapy.utils.project.get_project_settings", "line_number": 8, "usage_type": "call" }, { "api_...
255130111
import requests from bs4 import BeautifulSoup session = requests.Session() url = "https://en.wikipedia.org/wiki/List_of_Nobel_laureates" page = session.get(url).text nobelList = BeautifulSoup(page, "html.parser") # Print the birthdays of all the nobel laureates trows = nobelList.find('table', {'class' : ["wikitable...
null
BS4/wiki_table.py
wiki_table.py
py
939
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.Session", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 23, "usage_type": "call" } ]
229058160
from flask import Flask,request app = Flask(__name__) from flask import json import sqlite3 from flask import g import urllib import requests import json from flask.ext.mysql import MySQL mysql = MySQL() # MySQL configurations app.config['MYSQL_DATABASE_USER'] = 'root' app.config['MYSQL_DATABASE_PASSWORD'] = 'ronnie...
null
ServerApp/Quotr/home.py
home.py
py
8,045
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 3, "usage_type": "call" }, { "api_name": "flask.ext.mysql.MySQL", "line_number": 11, "usage_type": "call" }, { "api_name": "urllib.urlencode", "line_number": 27, "usage_type": "call" }, { "api_name": "urllib.urlopen", ...
337202070
import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch import numpy as np from tqdm import tqdm # from torch_lr_finder import LRFinder # def __new__(self): # return self # def train(trainloader, device, model,EPOCH): # criterion = nn.CrossEntropyLo...
null
train_and_validate/train_and_validate.py
train_and_validate.py
py
10,102
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.no_grad", "line_number": 81, "usage_type": "call" }, { "api_name": "torch.nn.functional.nll_loss", "line_number": 85, "usage_type": "call" }, { "api_name": "torch.nn.functional", "line_number": 85, "usage_type": "name" }, { "api_name": "torch....
159687290
import unittest from synthesis import PerformanceHistorySynthesizer from sklearn.model_selection import ParameterGrid import numpy as np class Test(unittest.TestCase): def setUp(self): pass #def tearDown(self): # pass def testPerformanceHistorySynthesizer(self): ''' Test...
null
change_point_identification/synthesis_test.py
synthesis_test.py
py
1,281
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.arange", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.linspace", ...
341546158
from django.core.management.base import BaseCommand, CommandError import csv from starcatalogue.models import Star, FoldedLightcurve class Command(BaseCommand): help = 'Imports folded lightcurve data (results_total.dat)' def add_arguments(self, parser): parser.add_argument('file', nargs=1, type=ope...
null
starcatalogue/management/commands/importlightcurves.py
importlightcurves.py
py
1,572
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "csv.reader", "line_number": 15, "usage_type": "call" }, { "api_name": "starcatalogue.models.Star.objects.get", "line_number": 31, "usage_type": "call" }, ...
350558898
from django.urls import path from . import views app_name = "life" urlpatterns = [ path("list/", views.DiaryListView.as_view(), name="list"), path("create/", views.DiaryCreateView.as_view(), name="create"), path("list/<int:pk>/", views.DiaryDetailView.as_view(), name="detail"), path("list/<int:pk>/up...
null
life/urls.py
urls.py
py
462
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
510274535
from domain.application import Application from domain.model import Model import json import os from os import listdir from os.path import isfile, join def parse_applications(app_path: str): """ Function that parse app_path file. app_path (String): Path to a json file. """ applications = {} ...
null
util/parse_json.py
parse_json.py
py
6,019
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "domain.application.Application", "line_number": 46, "usage_type": "call" }, { "api_name": "domain.application.Application", "line_number": 64, "usage_type": "name" }, { "api_name"...
104746798
#!/usr/bin/env python # -*- coding: utf-8 -*- from openpyxl import Workbook import sqlserver cursor_sql = sqlserver.get_cursor() sql = " select contrato, lote.datacadastro , "\ " (SELECT nomefantasia FROM FILIAL emp WHERE emp.idfilial= lote.idfilial) as nome_filial, "\ " (SELECT TOP 1 CD.Nome "\ " FROM LOTE_ENDEREC...
null
rel_lotesocultos.py
rel_lotesocultos.py
py
1,492
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlserver.get_cursor", "line_number": 6, "usage_type": "call" }, { "api_name": "openpyxl.Workbook", "line_number": 26, "usage_type": "call" } ]
55979723
## ## B8IT106 Tools for Data Analytics CA_TWO ## October 2019 ## Added to GitHub - October 8th 2019 ## October9 Branch Created ## ## Module Imports for Machine Learning in Python import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import Standa...
null
IrisML/CA2.py
CA2.py
py
15,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.set_option", "line_number": 40, "usage_type": "call" }, { "api_name": "numpy.set_printoptions", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 42, "usage_type": "call" }, { "api_name": "pandas.rea...
312817033
import matplotlib.pyplot as plt import numpy as np indata = np.loadtxt("indata.dat") time_size = indata[0] grid_size = indata[1] end_time = indata[2] periodic_start_fig = plt.figure() plt.title("Periodic 2D-rossby wave at T = 0") periodic_start = np.loadtxt("benchmarks/2dperstart.dat") X = np.linspace(0,1,len(periodi...
null
project5/plot3.py
plot3.py
py
997
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.loadtxt", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 9, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
623181890
from nltk.corpus import stopwords class Exhaustive: """ Exhaustive (statistical) method for text summarization """ def __init__(self, **kwargs): self.text = None self.wfreq = {} self.tokens = [] self.wstop = set(stopwords.words("english")) if "tokens" in kwargs.keys() ...
null
Algorithms/weightedfreq/Hindi/first.py
first.py
py
3,478
python
en
code
null
code-starcoder2
83
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 10, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 10, "usage_type": "name" } ]
491332647
import numpy as np import argparse import json import time from torch import nn from torch import optim import torch.utils.data as tdata import torch.nn.functional as F import os import cv2 import torch import torchvision WIDTH = 1920 HEIGHT = 1208 path = "/local/temporary/audi/camera/" # path_pic = "/local/temporar...
null
first_model.py
first_model.py
py
4,168
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.cuda.is_available", "line_number": 21, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 21, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 21, "usage_type": "call" }, { "api_name": "time.time", ...
293270471
import os import numpy as np import cv2 import random def make_data(filepath ): fo = open(os.path.join(filepath, "lables.txt"), "w", encoding="UTF-8") for i in range(0, 10): picture_names = os.listdir(os.path.join(filepath, str(i))) for name in picture_names: fo.write(na...
null
data_process.py
data_process.py
py
1,383
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": ...
220255642
from beaker.middleware import SessionMiddleware from bottle import Bottle, request, HTTPResponse from jumpscale.packages.threebot_deployer.bottle.utils import ( list_threebot_solutions, stop_threebot_solution, delete_threebot_solution, ) from jumpscale.loader import j from jumpscale.packages.auth.bottle.au...
null
jumpscale/packages/threebot_deployer/bottle/solutions.py
solutions.py
py
4,604
python
en
code
null
code-starcoder2
83
[ { "api_name": "bottle.Bottle", "line_number": 15, "usage_type": "call" }, { "api_name": "jumpscale.loader.j.data.serializers.json.loads", "line_number": 21, "usage_type": "call" }, { "api_name": "jumpscale.loader.j.data", "line_number": 21, "usage_type": "attribute" }, ...
537324419
''' @author: katiepfleger ''' from __future__ import print_function import sqlite3 import webbrowser import requests from logout import check_input CONN = sqlite3.connect("bpm.db") C = CONN.cursor() CLIENT_ID = '482102fb45cb45fdb465ef73801f4665' CLIENT_SECRET = 'dc7269e0e5a84e71b9b27f857055b41f' REDIRECT_URI = 'ht...
null
src/auth.py
auth.py
py
5,237
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "logout.check_input", "line_number": 38, "usage_type": "call" }, { "api_name": "logout.check_input", "line_number": 53, "usage_type": "call" }, { "api_name": "logout.check_in...
106623030
# -*- coding: utf-8 -*- ''' @File : linkagePage.py @Time : 2018/10/23 14:18 @Author : Chenzd @Project : 联动页面类 @Software: PyCharm ''' import random import time from page.LeeBus.curtain.curtain_editPage import Curtain_editPage from page.basePage import BasePage from selenium.webdriver.common.by import By fro...
null
page/LeeBus/linkage/linkagePage.py
linkagePage.py
py
13,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "public.configLog.Logger", "line_number": 17, "usage_type": "call" }, { "api_name": "page.basePage.BasePage", "line_number": 18, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.by.By.ID", "line_number": 20, "usage_type": "attribute" }, {...
307872856
''' Moudle that contains the two main data types `target_extraction.data_types.TargetText` and `target_extraction.data_types.TargetTextCollection` where the later is a container for the former. classes: 1. `target_extraction.data_types.TargetText` 2. `target_extraction.data_types.TargetTextCollection` ''' from coll...
null
target_extraction/data_types.py
data_types.py
py
56,357
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.abc.MutableMapping", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 88, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 88, "usage_type": "name" }, { "api_name": "typing.List", ...
426385174
""" import matplotlib.pyplot as plt x_values = [1, 2, 3, 4, 5] y_values = [1, 4, 9, 16, 25] plt.scatter(x_values, y_values, s=100) # 设置图表标题并给坐标轴加上标签 plt.title("Square Number", fontsize=24) plt.xlabel("Value", fontsize=14) plt.ylabel("Square of Value", fontsize=14) # 设置刻度标记的大小 plt.tick_params(axis='both', which='majar'...
null
matplotlib_demo/scatter_squares.py
scatter_squares.py
py
692
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.scatter", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 21, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.cm", "line_number": 21, "usage_type": "attribute" }, { "api_name": ...
124439770
#import matplotlib as mpl #mpl.use('Agg') import matplotlib.pyplot as plt import pickle from operator import itemgetter __author__ = 'fuatbasik' plt.rcParams['font.size'] = 25 plt.rcParams['ytick.labelsize'] = 22 plt.rcParams['xtick.labelsize'] = 22 plt.rcParams['legend.fontsize'] = 20 #plt.rcParams['axes.titlesize'] =...
null
code/draw/drawLearningTimes.py
drawLearningTimes.py
py
1,184
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 7, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 8, "usage_type": "attribute" }, { "ap...
297492134
import pysat.solvers import pysat.formula solvers = ['cadical', 'glucose30', 'glucose41', 'lingeling', 'maplechrono', 'maplecm', 'maplesat', 'minicard', 'minisat22', 'minisat-gh'] clauses = ([1, 2, 3], [-1, 2], [-2]) ...
null
test/test_sat.py
test_sat.py
py
660
python
en
code
null
code-starcoder2
83
[ { "api_name": "pysat.solvers.formula.CNF", "line_number": 18, "usage_type": "call" }, { "api_name": "pysat.solvers.formula", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pysat.solvers", "line_number": 18, "usage_type": "name" }, { "api_name": "py...
202505081
#coding: utf-8 -*- #This is just a proof of concept with probably a lot of bugs, use at your own risks! #It creates a new tab in the MS Word ribbon, with buttons calling docCleaner scripts from inside Word #To uninstall it, launch it with the --unregister argument #You can also remove it from Word (in the "Developer"...
null
dc_winword/wordaddin.py
wordaddin.py
py
24,079
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.split", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": ...
514916179
import webbrowser from python_helper import Constant as c from python_helper import log, StringHelper from flask import Response, request import flask_restful from python_framework.api.src.annotation.MethodWrapper import Function, overrideSignatures from python_framework.api.src.helper import Serializer from python_fra...
null
python_framework/api/src/service/flask/FlaskManager.py
FlaskManager.py
py
25,290
python
en
code
null
code-starcoder2
83
[ { "api_name": "python_helper.Constant.DOT_SPACE", "line_number": 41, "usage_type": "attribute" }, { "api_name": "python_helper.Constant", "line_number": 41, "usage_type": "name" }, { "api_name": "python_helper.Constant.LOG_CAUSE", "line_number": 41, "usage_type": "attribu...
424346879
# -*- coding: utf-8 -*- import pytest from chocolatepy import ChocolateApp, ChocolateServer, NonChocolateAppError from webtest import TestApp @pytest.fixture def app_one(): app = ChocolateApp("one") @app.route("/") def index(): return "one" return app @pytest.fixture def app_two(): ap...
null
tests/test_server.py
test_server.py
py
2,216
python
en
code
null
code-starcoder2
83
[ { "api_name": "chocolatepy.ChocolateApp", "line_number": 10, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": "attribute" }, { "api_name": "chocolatepy.ChocolateApp", "line_number": 21, "usage_type": "call" }, { "api_name": "...
631909505
import array as arr import re from matplotlib import pyplot as plt from matplotlib import style #creating an array with 'd' as double float time = arr.array('d',[]); #array for time value = arr.array('d',[]); #array for voltage/current #reading file filename = "rangkaian_RC.csv"; file = open(filename,'r'...
null
plotting_math_graph.py
plotting_math_graph.py
py
1,185
python
en
code
null
code-starcoder2
83
[ { "api_name": "array.array", "line_number": 7, "usage_type": "call" }, { "api_name": "array.array", "line_number": 8, "usage_type": "call" }, { "api_name": "re.split", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.style.use", "line_numbe...
185123426
from django.contrib import admin from .models import Post, Category, Tag, Product # Register your models here. class PostAdmin(admin.ModelAdmin): list_display = ['title','created_time','modified_time','category','author',] class ProductAdmin(admin.ModelAdmin): list_display = ['name','excerpt',] admin.site.register...
null
blog/admin.py
admin.py
py
513
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 8, "usage_type": "attribute" }...
528888459
from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.http import Http404 from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.urls import reverse from django.utils import timezone ...
null
wagtail/admin/views/pages/create.py
create.py
py
8,112
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 19, "usage_type": "call" }, { "api_name": "wagtail.core.models.Page", "line_number": 19, "usage_type": "argument" }, { "api_name": "django.core.exceptions.PermissionDenied", "line_number": 21, "usage_type"...
624926750
from tqdm import tqdm import textdistance as tt import pandas as pd import concurrent.futures import math def AdjustYear(x): if 100 > x > 20: x = 1900 + x elif x < 20: 2000 + x return x def sim_chooserController(sim_chooser, simple,dif_sim_per_column=False): if sim_chooser is None and...
null
Prep/features_utills.py
features_utills.py
py
12,223
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 145, "usage_type": "attribute" }, { "api_name": "tqdm.tqdm", "line_number": 159, "usage_type": "call" }, { "api_name": "textdistance.hamming.normalized_similarity", "line_number": 182, "usage_type": "call" }, { "api...
103334059
# encoding: utf-8 from __future__ import unicode_literals import os import tempfile import unittest from mock import Mock from pdefc import CompilerException from pdefc.lang.packages import PackageInfo from pdefc.sources import UrlPackageSource, FilePackageSource, InMemoryPackageSource, PackageSources, UTF8, \ Pack...
null
src/pdefc/tests/test_sources.py
test_sources.py
py
4,299
python
en
code
null
code-starcoder2
83
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.remove", "line_number": 19, "usage_type": "call" }, { "api_name": "pdefc.lang.packages.PackageInfo", "line_number": 22, "usage_type": "call" }, { "api_name": "pdef...
336246661
import json import os import datetime import argparse from duplocli.terraform.aws.common.tf_utils import TfUtils from duplocli.terraform.aws.step1.aws_create_tfstate_step1 import AwsCreateTfstateStep1 from duplocli.terraform.aws.step1.get_aws_object_list import GetAwsObjectList from duplocli.terraform.aws.step2.aws_tf_...
null
duplocli/terraform/aws/aws_parse_params.py
aws_parse_params.py
py
9,444
python
en
code
null
code-starcoder2
83
[ { "api_name": "duplocli.terraform.aws.common.tf_file_utils.TfFileUtils", "line_number": 44, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 66, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 66, "usage_type": "attri...
392625329
""" Holds handling functions for user operations. Uses a floating instance of the database client that is instanciated in the `config.db` module like all other `util` modules. """ from config.db import get_database, get_database_client_name from models import exceptions import models.users as user_models # instancia...
null
util/users.py
users.py
py
1,757
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.db.get_database", "line_number": 14, "usage_type": "call" }, { "api_name": "config.db.get_database_client_name", "line_number": 14, "usage_type": "call" }, { "api_name": "models.users.UserRegistrationForm", "line_number": 18, "usage_type": "attribute...
367157607
from sklearn import neighbors import pickle import ProcessImage as image from matplotlib.colors import ListedColormap import numpy as np import matplotlib.pyplot as plt #k-legkozelebbi szomszed modszere class train(object): def __init__(self, neigh_numbers, first_two=False, features=[]): self.neigh_numbe...
null
beadando-tovabbi-modszerekkel/train_k_neighbours.py
train_k_neighbours.py
py
3,621
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.neighbors", "line_number": 21, "usage_type": "name" }, { "api_name": "ProcessImage.ProcessImages", "line_number": 35, "usage_type": "call" }, { ...
243717432
# coding: utf-8 # Author: F. Alex Wolf (http://falexwolf.de) """tSNE Notes ----- This module automatically choose from three t-SNE versions from - sklearn.manifold.TSNE - Dmitry Ulyanov (multicore, fastest) https://github.com/DmitryUlyanov/Multicore-TSNE install via 'pip install psutil cffi', get code from github ...
null
scanpy/tools/tsne.py
tsne.py
py
4,394
python
en
code
null
code-starcoder2
83
[ { "api_name": "tools.pca.pca", "line_number": 67, "usage_type": "call" }, { "api_name": "MulticoreTSNE.MulticoreTSNE", "line_number": 86, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 88, "usage_type": "attribute" }, { "api_name": "sklearn....
80493053
from collections import Counter from decimal import Decimal from ouretf.accounts.brokerage_account import BrokerageAccount from ouretf.accounts.exceptions import NotEnoughFundsException, NotEnoughHoldingsException, OrderAlreadyCanceled, \ OrderDoesNotExist from ouretf.accounts.mock.orders import MockBuyOrder, Moc...
null
ouretf/accounts/mock/account.py
account.py
py
4,536
python
en
code
null
code-starcoder2
83
[ { "api_name": "ouretf.accounts.brokerage_account.BrokerageAccount", "line_number": 12, "usage_type": "name" }, { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 28, "usage_type": "call" },...
261816346
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import json import logging import click import requests import yamale import yaml from betterboto import client as betterboto_client from servicecatalog_puppet import asset_helpers from servicecatalog_pu...
null
servicecatalog_puppet/commands/manifest.py
manifest.py
py
9,189
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 22, "usage_type": "call" }, { "api_name": "servicecatalog_puppet.manifest_utils.load", "line_number": 23, "usage_type": "call" }, { "api_name":...
557626240
from flask import jsonify, request, url_for from models import User from urlparse import urlparse, urljoin # USER AUTHENTICATION FUNCTIONS # Response handler for user info retrieved from Google OAuth # Declare local user based on authorized user data # Register new user if this user has never logged in to my site # S...
null
helpers.py
helpers.py
py
1,826
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.User", "line_number": 12, "usage_type": "argument" }, { "api_name": "models.User", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.url_for", "line_n...
30676078
import discord import datetime from database.entities.User import User from commands.utils import Status, get_emoji, mention_author async def run(db_config, ctx): author = str(ctx.message.author) content = ctx.message.content print("\nReceived message from '"+author+"' with content '"+content+"'") ...
null
DanMemoDiscordBot/commands/bento.py
bento.py
py
3,196
python
en
code
null
code-starcoder2
83
[ { "api_name": "database.entities.User.User.get_user", "line_number": 13, "usage_type": "call" }, { "api_name": "database.entities.User.User", "line_number": 13, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 15, "usage_type": "call" }, {...