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
534167126
import pyglet import time from pyglet.window import Window, mouse, gl platform = pyglet.window.get_platform() # Get an instance of current display display = platform.get_default_display() screen = display.get_default_screen() mygame = pyglet.window.Window(600, 710, resizable=False, # Make sure it is ...
null
projects/fqj/stacks.py
stacks.py
py
6,456
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyglet.window.get_platform", "line_number": 6, "usage_type": "call" }, { "api_name": "pyglet.window", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyglet.window.Window", "line_number": 12, "usage_type": "call" }, { "api_name": "pygl...
271061562
import tornado.web import json import time from dateutil import parser from status.util import dthandler, SafeHandler class QuotasHandler(SafeHandler): """ Serves a grid of time series plots for UPPNEX storage quotas. URL: /quotas """ def get(self): t = self.application.loader.load("quota_gri...
null
status/quotas.py
quotas.py
py
2,267
python
en
code
null
code-starcoder2
76
[ { "api_name": "status.util.SafeHandler", "line_number": 9, "usage_type": "name" }, { "api_name": "status.util.SafeHandler", "line_number": 18, "usage_type": "name" }, { "api_name": "status.util.SafeHandler", "line_number": 29, "usage_type": "name" }, { "api_name":...
77406254
import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn.linear_model import LinearRegression housing_prepared = np.load("housing_prepared.npy") housing_labels = np.load("housing_labels.npy") print(housing_prepared) print(housing_labels) lin_reg = LinearRegression() lin_reg.fit(housing_prep...
null
Chapter2_End2End_ML_project/select_model.py
select_model.py
py
1,463
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.met...
296825858
from fastapi import FastAPI from pororo import Pororo app = FastAPI() is_ready = False model = None model = Pororo(task="sentiment", model="brainbert.base.ko.shopping", lang="ko") if model: is_ready = True #endpoints @app.get("/") async def health(): if is_ready: output = {'code': 200} else: output - {'code'...
null
lina_nlp_hub/sentence_classification/pororo_sentiment_analysis/inferencer.py
inferencer.py
py
520
python
en
code
null
code-starcoder2
76
[ { "api_name": "fastapi.FastAPI", "line_number": 4, "usage_type": "call" }, { "api_name": "pororo.Pororo", "line_number": 8, "usage_type": "call" } ]
309159864
import os import time import resource import copy import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import tensorflow as tf from tensorflow.keras.callbacks import Callback from tensorflow.keras import backend from tensorflow.keras import Model from lib.classes.callback_classes...
null
lib/classes/callback_classes/MnistAutoencoderCallback.py
MnistAutoencoderCallback.py
py
3,926
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.classes.callback_classes.MyRecordingCallback.MyRecordingCallback", "line_number": 18, "usage_type": "name" }, { "api_name": "lib.classes.dataset_classes.MnistAutoencoderDataset.MnistAutoencoderDataset", "line_number": 25, "usage_type": "call" }, { "api_name": "...
206151994
import logging import re from core.models import AuthToken from django.conf import settings from django.utils import timezone from rest_framework import status from rest_framework.response import Response logger = logging.getLogger('vote') def error(reason, status=status.HTTP_400_BAD_REQUEST): logger.info('Statu...
null
core/views/utils.py
utils.py
py
1,581
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "rest_framework.status.HTTP_400_BAD_REQUEST", "line_number": 12, "usage_type": "attribute" }, { "api_name": "rest_framework.status", "line_number": 12, "usage_type": "name" }, {...
175059918
import django_filters import graphene import graphql_geojson from decimal import Decimal from django.contrib.gis.geos import Polygon from graphene.relay import Node from graphene_django import DjangoConnectionField, DjangoObjectType from graphene_django.converter import convert_django_field from db.types_revision impo...
null
occurrences/models_graphql.py
models_graphql.py
py
3,784
python
en
code
null
code-starcoder2
76
[ { "api_name": "graphene.ObjectType", "line_number": 24, "usage_type": "attribute" }, { "api_name": "graphene.Int", "line_number": 25, "usage_type": "call" }, { "api_name": "graphql_geojson.Geometry", "line_number": 26, "usage_type": "call" }, { "api_name": "graphe...
177659591
''' fmt = getattr(settings, 'LOG_FORMAT', None) lvl = getattr(settings, 'LOG_LEVEL', logging.DEBUG) logging.basicConfig(format=fmt, level=lvl) logging.debug(neprojectbject.OrderId.id) ''' from django.shortcuts import render from django.shortcuts import get_object_or_404 from django.http import JsonResponse from d...
null
cmms/views/projectview.py
projectview.py
py
3,473
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 34, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 48, "usage_type": "call" }, { "api_name": "django.template.loader.render_to_string", "line_number": 57, "usage_type"...
360185080
from solution import Solution from typing import List import math import functools class LargestNumber(Solution): """ Given a list of non negative integers, arrange them such that they form the largest number. LEVEL: M """ def testCases(self): return [ (([0, 0],), "0"),...
null
m_largest_number.py
m_largest_number.py
py
2,071
python
en
code
null
code-starcoder2
76
[ { "api_name": "solution.Solution", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 24, "usage_type": "name" }, { "api_name": "math.pow", "line_number": 35, "usage_type": "call" }, { "api_name": "math.log10", "line_number":...
484217890
import asyncio loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) import json import traceback from datetime import date, timedelta import alpaca_trade_api as tradeapi import matplotlib.pyplot as plt import nest_asyncio import pandas as pd import pygit2 import pytz import requests import streamlit as st imp...
null
analysis/backtester_ui.py
backtester_ui.py
py
11,589
python
en
code
null
code-starcoder2
76
[ { "api_name": "asyncio.new_event_loop", "line_number": 3, "usage_type": "call" }, { "api_name": "asyncio.set_event_loop", "line_number": 4, "usage_type": "call" }, { "api_name": "liualgotrader.common.config.build_label", "line_number": 28, "usage_type": "attribute" }, ...
563495072
# author:joketeng time:2018/10/29 import requests import re import os class kugou(object): def __init__(self): self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.6726.400 QQBrowser/1...
null
music_download/music.py
music.py
py
9,373
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.mkdir", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.get", "line_number"...
203094798
# This is a sample Python script. # Press Shift+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import sys from datetime import date import math def print_hi(name): # Use a breakpoint in the code line below to debu...
null
main.py
main.py
py
2,843
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.version_info", "line_number": 17, "usage_type": "attribute" }, { "api_name": "datetime.date.today", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 22, "usage_type": "name" }, { "api_name": "math.floor", ...
24993852
import os import cv2 import fun_NM import numpy as np ocekivaniIzlazi = [] slikeBrojevaZaTreniranje = [] for filename in os.listdir('data_set_brojeva\\trening'): #print(filename) brojZaTreniranje = filename[0] img = cv2.imread('data_set_brojeva\\trening\\' + filename) img = cv2.cvtColor(img, cv2.COLOR...
null
neuronskaM.py
neuronskaM.py
py
743
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numb...
140236933
from io import BytesIO from os import PathLike from tempfile import TemporaryFile from typing import Any, Dict, Generator, Mapping, Optional from xml.etree import ElementTree from zipfile import ZipFile from furl import furl try: import httpx except ImportError: httpx = False from pyopendart.api.http import ...
null
pyopendart/api/http/httpx.py
httpx.py
py
4,060
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyopendart.api.http.OpenApiClient", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 22, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Option...
303209623
"""Gather information from three gzipped input files - a tabular file with per-sample date info, a tabular file with pangolin lineage information, and a JSON file with encoded per-sample variant information - and write the combined data in tabular form to a zip file. Also creates an SQL init file with the instructions ...
null
scripts/generate_combined_table.py
generate_combined_table.py
py
3,136
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 19, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 38, "usage_type": "call" }, { "api_name": "gzip.open", "line_number": 60, "usage_type": "call" }, { "api_name": "json.load", "line_number": 61, ...
349571271
""" Copyright (c) 2013, Yohan Graterol All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the followin...
null
setup.py
setup.py
py
2,297
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 39, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 43, "usage_type": "call" } ]
338929564
from turtle import Screen from paddle import Paddle from ball import Ball import time from scoreboard import Scoreboard screen = Screen() right_paddle = Paddle((350, 0)) left_paddle = Paddle((-350, 0)) ball = Ball() scoreboard = Scoreboard() screen.title("PING-PONG GAME") screen.setup(width=800, height=600) screen....
null
main.py
main.py
py
1,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "turtle.Screen", "line_number": 8, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 9, "usage_type": "call" }, { "api_name": "paddle.Paddle", "line_number": 10, "usage_type": "call" }, { "api_name": "ball.Ball", "line_number"...
604011075
#API- K.E.A.T.O.N Parker import random, time, datetime while True: def openFileGreetings(): global greetingsPath, greetingsList, greetings greetingsPath = "/home/jasmine/Desktop/K.E.A.T.O.N Parker/greetings/greetings.txt" with open(greetingsPath, 'r+') as greetings: gree...
null
KP.py
KP.py
py
4,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 64, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 64, "usage_type": "attribute" }, { "api_name": "datetime.d...
201487930
import sys import pandas as pd from sqlalchemy import create_engine from sqlalchemy.types import Integer from decouple import AutoConfig from utils import ( expand_results, get_from_depara ) USAGE_STRING = """ usage: python upload_postgres.py INPUT_FILE TABLE_NAME """ if len(sys.argv) == 1: print(US...
null
projetos_vereadores_lupa/upload_postgres.py
upload_postgres.py
py
1,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 17, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 21, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 22...
26818569
# !/usr/bin/env python # -*- coding: utf-8 -*- # AI本体のコード # 画像認識分野で有名なCNN VGG-16の層を一部改変した物 # author Shoichi Tanaka # import宣言 使用するライブラリを宣言します(先頭大文字はライブラリ内の特定のクラスを指します) from __future__ import print_function import glob import os import sys import cv2 import numpy as np import pandas as pd from keras.models import Seq...
null
sample/AI/AI_torizukan.py
AI_torizukan.py
py
22,708
python
en
code
null
code-starcoder2
76
[ { "api_name": "optparse.OptionParser", "line_number": 29, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 91, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 97, "usage_type": "call" }, { "api_name": "numpy.random", "...
649662511
from flask import Flask, abort, request, session from flask.ext.sqlalchemy import SQLAlchemy from .model import User from .db import db app = Flask(__name__) app.secret_key = 'This is very very secret key.' db.init_app(app) @app.route('/users/', methods=['POST']) def create_user(): username = request.form.get(...
null
spp/app.py
app.py
py
1,055
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "db.db.init_app", "line_number": 10, "usage_type": "call" }, { "api_name": "db.db", "line_number": 10, "usage_type": "name" }, { "api_name": "flask.request.form.get", "line_nu...
295287396
"""Change kontaktId to beaconId and lastEventTimestamp to lastSeen Revision ID: 7650353b13df Revises: e0d7ac5bc693 Create Date: 2020-10-26 10:36:01.553936 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '7650353b13df' down_revision = 'e0d7ac5bc693' branch_label...
null
backend/database/alembic/versions/7650353b13df_change_kontaktid_to_beaconid_and_.py
7650353b13df_change_kontaktid_to_beaconid_and_.py
py
1,689
python
en
code
null
code-starcoder2
76
[ { "api_name": "alembic.op.add_column", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 21, "usage_type": "call" }, { "api_name": "sqlalchemy.String"...
16615515
#!/usr/bin/env python3 """ simple rancher ftscloud backup script which starts the backup stacks of the different customers proof of concept script """ import requests import logging import traceback import os # configure logger # http://docs.python-guide.org/en/latest/writing/logging/ logger = logging.getLog...
null
roles/ftscloudbackup/templates/usr/local/bin/ftscloud-backup.py
ftscloud-backup.py
py
6,091
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.Formatter", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INF...
620458111
from trueskill import Rating, quality, BETA, global_env, setup import itertools import math import random def win_probability(team1, team2): delta_mu = sum(r.mu for r in team1) - sum(r.mu for r in team2) sum_sigma = sum(r.sigma ** 2 for r in itertools.chain(team1, team2)) size = len(team1) + len(team2) ...
null
team/makeTeam.py
makeTeam.py
py
3,099
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.chain", "line_number": 8, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 10, "usage_type": "call" }, { "api_name": "trueskill.BETA", "line_number": 10, "usage_type": "name" }, { "api_name": "trueskill.global_env", "l...
329843356
import csv import matplotlib.pyplot as plt from datetime import datetime filename='death_valley_2014.csv' with open(filename) as f: reader=csv.reader(f) header_row=next(reader) # #使得更容易阅读 # for index,column_header in enumerate(header_row): # print(index,column_header) #获取最高...
null
csv_and_json/highs_lows.py
highs_lows.py
py
1,340
python
en
code
null
code-starcoder2
76
[ { "api_name": "csv.reader", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
590633402
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Lennard Jones Particles over a Sphere Created on Fri Aug 25 15:03:00 2017 @author: peter """ import numpy as np import math import random as rand from vpython import * import matplotlib.pyplot as plt import mpmath as mp import csv def placeParticles(N,r_sphere,r_p...
null
LJOnSphere.py
LJOnSphere.py
py
5,741
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.choice", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.linspace", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.pi", "line_number": 29, "usage_type": "attribute" }, { "api_name": "random.choice", "line_...
654198643
import pika import json def connection_rabbitmq(config): connection = pika.BlockingConnection( pika.ConnectionParameters(host=config.get('RABBITMQ', 'HOST'), port=config.get('RABBITMQ', 'PORT'))) channel = connection.channel() with open('queue_config.json') as js...
null
provider/rabbit_mq_provider.py
rabbit_mq_provider.py
py
1,044
python
en
code
null
code-starcoder2
76
[ { "api_name": "pika.BlockingConnection", "line_number": 6, "usage_type": "call" }, { "api_name": "pika.ConnectionParameters", "line_number": 7, "usage_type": "call" }, { "api_name": "json.load", "line_number": 12, "usage_type": "call" }, { "api_name": "json.dumps"...
500989518
import re import time import math import os import threading import ibm_db import unittest from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait # from sources.common import HTMLTestRunner from sources import test class A(unittest.TestCase, threading.Thread): def setUp(self): ...
null
sources/selenium/hello.py
hello.py
py
2,308
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 14, "usage_type": "attribute" }, { "api_name": "threading.Thread", "line_number": 14, "usage_type": "attribute" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api_name":...
275219423
import datetime from requests import get from bs4 import BeautifulSoup import io import re URL = 'url' TITLE = 'title' STATUS = 'status' ORIGIN = 'origin' ACT_NO = 'act_no' YEAR = 'year' TYPE = 'type' CARRIAGE_MEMBER = 'carriage_member' LONG_TITLE = 'long_title' BILL_TEXT = 'text' base_url = 'https://www.parliament.n...
null
ausbills/nsw_parliament.py
nsw_parliament.py
py
4,734
python
en
code
null
code-starcoder2
76
[ { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 30, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 64, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "...
644320540
import sys import json import pygame from bullet import Bullet from target import Target from time import sleep def check_events(ship, bullets, ai_settings, screen, stats, button, targets, sb): """Check key presses and releases.""" for event in pygame.event.get(): if event.type == pygame.QU...
null
game_functions.py
game_functions.py
py
5,849
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.event.get", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.event", "line_number": 11, "usage_type": "attribute" }, { "api_name": "pygame.QUIT", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.exit", "l...
525900237
#import libraries from psychopy import visual from psychopy import gui from psychopy import core from psychopy import data from psychopy import misc from psychopy import event from psychopy.visual import filters from psychopy import monitors import time, numpy, random #import retinotopyScans import math fro...
null
flasher.py
flasher.py
py
22,763
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number"...
271403339
from flask import Flask ,render_template from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate import requests from datetime import date app = Flask(__name__) app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///weather.sqlite" app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(...
null
weatherreport.py
weatherreport.py
py
2,001
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime...
104310889
import discord from discord.ext import commands from typing import Union, Optional, Dict from handler import slash_command, user_command, InteractionContext from handler import SlashCommandOption as Option from handler import SlashCommandChoice as Choice from cogs.error_handler import EphemeralContext from utils.except...
null
cogs/modmail.py
modmail.py
py
19,066
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.Cog", "line_number": 19, "usage_type": "attribute" }, { "api_name": "discord.ext.commands", "line_number": 19, "usage_type": "name" }, { "api_name": "utils.bot.ModMail", "line_number": 20, "usage_type": "name" }, { "api_name": "...
125741692
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import sys import itertools import six import numpy as np from phonopy.structure.atoms import Atoms from spglib import get_symmetry_dataset __author__ = "Yuji Ikeda" class StructureAnalyzer(object): def __init__(...
null
cmtools/structure/structure_analyzer.py
structure_analyzer.py
py
25,712
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.linalg.det", "line_number": 74, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 74, "usage_type": "attribute" }, { "api_name": "ph_unfolder.analysis.smearing.Smearing", "line_number": 79, "usage_type": "call" }, { "api_nam...
158003945
# The MIT License (MIT) # # Copyright (c) 2013 Fredrik Fjeldvaer # # 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,...
null
yaem/apps/yaem/models.py
models.py
py
6,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 32, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 32, "usage_type": "name" }, { "api_name": "django.db.models.ForeignKey", "line_number": 33, "usage_type": "call" }, { "api_name...
251821851
import numpy as np import os from easydict import EasyDict as edict import math # general config = edict() config.bn_mom = 0.9 config.wd = 0.0005 config.mom = 0.9 config.workspace = 64 config.emb_size = 512 #config.ckpt_embedding = True config.ckpt_embedding = False config.net_se = 0 config.net_act = 'prelu' config.ne...
null
train/config.py
config.py
py
10,273
python
en
code
null
code-starcoder2
76
[ { "api_name": "easydict.EasyDict", "line_number": 7, "usage_type": "call" }, { "api_name": "easydict.EasyDict", "line_number": 43, "usage_type": "call" }, { "api_name": "easydict.EasyDict", "line_number": 71, "usage_type": "call" }, { "api_name": "easydict.EasyDic...
612505771
from itertools import combinations from collections import Counter def solution(orders, course): res = [] for c in course: res1 = [] for order in orders: pair = combinations(sorted(order), c) res1 += pair cnt = Counter(res1) print(cnt) i...
null
junkyu/메뉴 리뉴얼.py
메뉴 리뉴얼.py
py
721
python
en
code
null
code-starcoder2
76
[ { "api_name": "itertools.combinations", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" } ]
576014343
#!/usr/bin/env python3 """DB module """ from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.session import Session from sqlalchemy.exc import InvalidRequestError from sqlalchemy.orm.exc import NoResultFound from user ...
null
0x08-user_authentication_service/db.py
db.py
py
2,189
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlalchemy.create_engine", "line_number": 23, "usage_type": "call" }, { "api_name": "user.Base.metadata.drop_all", "line_number": 24, "usage_type": "call" }, { "api_name": "user.Base.metadata", "line_number": 24, "usage_type": "attribute" }, { "api_...
285943108
#!/usr/bin/env python3 # ------------------------------- # projects/netflix/Testnetflix.py # Copyright (C) 2015 # Glenn P. Downing # ------------------------------- # ------- # imports # ------- from io import StringIO from unittest import main, TestCase from Netflix import netflix_read, netflix_eval, netflix...
null
et6482-TestNetflix.py
et6482-TestNetflix.py
py
2,609
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 22, "usage_type": "name" }, { "api_name": "io.StringIO", "line_number": 29, "usage_type": "call" }, { "api_name": "Netflix.netflix_read", "line_number": 31, "usage_type": "call" }, { "api_name": "io.StringIO", ...
3756509
# -*- coding: UTF-8 -*- ''' Created on 2014年8月1日 @author: genghb ''' #from com.zctt.iaap.services.cdrws.queryargs import DatabaseInfos #from com.zctt.iaap.paf.contrib.sql import DIALECT #from com.zctt.iaap.paf.contrib.db import dao #from datetime import datetime, timedelta #import time #import com.zctt.iaap.service.sy...
null
service/com/zctt/iaap/services/cmccticket/ticketauth.py
ticketauth.py
py
2,575
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.getLogger", "line_number": 19, "usage_type": "call" }, { "api_name": "com.zctt.iaap.paf.settings.TICKET", "line_number": 26, "usage_type": "attribute" }, { "api_name": "com.zctt.iaap.paf.settings", "line_number": 26, "usage_type": "name" }, { ...
482882360
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from django.shortcuts import render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from .forms import ProfileForm, UserF...
null
{{cookiecutter.project_name}}/apps/accounts/views.py
views.py
py
1,814
python
en
code
null
code-starcoder2
76
[ { "api_name": "forms.UserForm", "line_number": 19, "usage_type": "call" }, { "api_name": "forms.ProfileForm", "line_number": 20, "usage_type": "call" }, { "api_name": "urlparse.urlparse", "line_number": 33, "usage_type": "call" }, { "api_name": "django.core.urlres...
30980015
import matplotlib.pyplot as plt import pandas as pd import os.path from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent.parent model_1 = "detector/logs/model-1612398660-lr1e-06-factor0.1pat2-thr0.01-val_pct0.2-train_batch150-128-72-512-noSofm-Relu-mse.csv" model_2 = "detector/logs/model-161194539...
null
detector/graphs/loss_functions.py
loss_functions.py
py
1,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path", "line_n...
99011651
from django.db import models import datetime from ckeditor_uploader.fields import RichTextUploadingField # Create your models here. class TypeInfo(models.Model): t_title = models.CharField(max_length=20) is_delete = models.BooleanField(default=False) def __str__(self): return self.t_title class...
null
lecongpro/leongGoods/models.py
models.py
py
1,802
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 8, "usage_type": "call" }, { "api_name": "...
528028300
from __future__ import print_function import pymongo #import xml.etree.ElementTree as ET from lxml import etree as ET import bz2 import sys,pdb import time,re, nltk from Queue import Queue import threading dbcoll = pymongo.MongoClient().wikidb['pages'] ns = {"wiki": "http://www.mediawiki.org/xml/export-0.10/"} fi = b...
null
parse.py
parse.py
py
2,986
python
en
code
null
code-starcoder2
76
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "bz2.BZ2File", "line_number": 14, "usage_type": "call" }, { "api_name": "Queue.Queue", "line_number": 31, "usage_type": "call" }, { "api_name": "Queue.Queue", "line_n...
637154583
import pandas as pd from yahoofinancials import YahooFinancials import matplotlib.pyplot as plt from datetime import date #%% Funciones guays def prep_df(simbolo, d_valor, start='2020-01-01'): yf = YahooFinancials(simbolo) data= yf.get_historical_price_data( start_date=start, end_date=date.toda...
null
portfolio.py
portfolio.py
py
1,699
python
en
code
null
code-starcoder2
76
[ { "api_name": "yahoofinancials.YahooFinancials", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date.today", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 11, "usage_type": "name" }, { "api_name": "pand...
30294505
import os import json import subprocess import threading def encodeData(data, HEADER_LENGTH, fileBin=False): if fileBin: size = os.stat(r".\%s" % data).st_size with open(data, "rb") as dataBin: dataBin = dataBin.read() head = f"{size:<{HEADER_LENGTH}}".encode('utf-8') r...
null
Fun/Bomba/Server/sFuncs.py
sFuncs.py
py
1,702
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.stat", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 24, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 28, ...
429385723
#!/usr/bin/env python2.7 # # Copyright 2013 (c) Lei Xu <eddyxu@gmail.com> # # 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...
null
contrib/mvd/parser.py
parser.py
py
3,086
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.abspath", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path", "line_number": 41, "usage_type": "attribute" }, { "api_name": "os.path.ismount", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
503243476
# -------------- import time import pandas as pd import numpy as np import nltk from nltk import pos_tag import matplotlib.pyplot as plt # code starts here df=pd.read_csv(path) tagged_titles = df['nominee'].str.split().map(pos_tag) print(tagged_titles) tagged_titles_df=pd.DataFrame(tagged_titles) # code ends here ...
null
Text-Parsing/code.py
code.py
py
2,791
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "nltk.pos_tag", "line_number": 12, "usage_type": "argument" }, { "api_name": "pandas.DataFrame", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.s...
562933795
import pytest from Loggingmodule.ClassToTest import SomeClassToTest from Loggingmodule.AnotherCLassToTest import AnotherClass @pytest.mark.usefixtures("oneTimeSetUp", "setUp") #This fixture is defined for the whole CLass class TestClassDemo(): @pytest.fixture(autouse=True) #Since we need this object for all metho...
null
Pytestpackage/test_class1.py
test_class1.py
py
886
python
en
code
null
code-starcoder2
76
[ { "api_name": "Loggingmodule.ClassToTest.SomeClassToTest", "line_number": 10, "usage_type": "call" }, { "api_name": "Loggingmodule.AnotherCLassToTest.AnotherClass", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 8, "usage_type": ...
114738461
from django.contrib.auth.models import User from social.models import Connection from django.db.models import Q from profiles.models import Trait, UserProfile from pandas import DataFrame from random import shuffle def get_friends(user_instance, exclude_self=False): '''user, not userprofile''' me = Us...
null
neurosphere/social/utils.py
utils.py
py
3,336
python
en
code
null
code-starcoder2
76
[ { "api_name": "profiles.models.UserProfile.objects.get", "line_number": 10, "usage_type": "call" }, { "api_name": "profiles.models.UserProfile.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "profiles.models.UserProfile", "line_number": 10, "usage_...
607633322
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import io import textwrap import unittest from clkhash import clk, schema, randomnames, validate_data from future.builtins import range class TestChunks(unittest.TestCase): def test_simple_chunk(self): l = list(range(100)) res =...
null
tests/test_clk.py
test_clk.py
py
8,128
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 13, "usage_type": "attribute" }, { "api_name": "future.builtins.range", "line_number": 16, "usage_type": "call" }, { "api_name": "clkhash.clk.chunks", "line_number": 17, "usage_type": "call" }, { "api_name": "clkha...
645279930
from imutils.perspective import four_point_transform import numpy as np from imutils import contours import imutils,time import cv2 def read_image(img): """Read image from file""" image = cv2.imread(img) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray, (7,7), ...
null
prepocessing/preprocess.py
preprocess.py
py
6,097
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.GaussianBlur", ...
257562833
#!/usr/bin/env python # coding: utf-8 # In[ ]: from __future__ import print_function import itertools import numpy as np import pandas as pd import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as td import torchvision as tv from torch.a...
null
OurCycleGan_Large_Datasets.py
OurCycleGan_Large_Datasets.py
py
10,570
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.cuda.is_available", "line_number": 46, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 46, "usage_type": "attribute" }, { "api_name": "easydict.EasyDict", "line_number": 60, "usage_type": "call" }, { "api_name": "models.Gene...
360585845
#!/usr/bin/env python # Copyright (C) 2023 by eHealth Africa : http://www.eHealthAfrica.org # # See the NOTICE file distributed with this work for additional information # regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance...
null
aether-producer/setup.py
setup.py
py
1,210
python
en
code
null
code-starcoder2
76
[ { "api_name": "io.open", "line_number": 26, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 29, "usage_type": "call" } ]
566068666
try: from PIL import Image except ImportError: import Image import cv2 import numpy as np # import numpy as np # import math import pytesseract from detectron2.config import get_cfg from detectron2.data import MetadataCatalog from detectron2.engine import DefaultPredictor from detectron2.utils.visualizer import...
null
trans_probs.py
trans_probs.py
py
11,990
python
en
code
null
code-starcoder2
76
[ { "api_name": "pytesseract.pytesseract", "line_number": 19, "usage_type": "attribute" }, { "api_name": "onmt.translate.translation_im", "line_number": 25, "usage_type": "name" }, { "api_name": "pytesseract.image_to_data", "line_number": 67, "usage_type": "call" }, { ...
648904533
import os import argparse import random import time from tqdm import tqdm import yaml import shutil from psutil import virtual_memory import multiprocessing import numpy as np import torch from torch import nn, optim from torchvision import transforms from torch.cuda.amp import autocast, GradScaler import wandb from ut...
null
train_modules/train_single_opt.py
train_single_opt.py
py
21,624
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 38, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 39, "usage_type": "attribute" }, { "api_name": "torch.set_grad_enabled", "line_number": 55, "usage_type": "call" }, { "api_name": "tqdm.tqdm", ...
82774320
import gym from gym.wrappers import Monitor from lagom.envs import GymEnv def make_env(seed=None, monitor=False, monitor_dir=None): env = gym.make('CartPole-v1') if monitor: env = Monitor(env, directory=monitor_dir) env = GymEnv(env) if seed is not None: env.seed(seed) r...
null
examples/policy_gradient/utils.py
utils.py
py
329
python
en
code
null
code-starcoder2
76
[ { "api_name": "gym.make", "line_number": 8, "usage_type": "call" }, { "api_name": "gym.wrappers.Monitor", "line_number": 10, "usage_type": "call" }, { "api_name": "lagom.envs.GymEnv", "line_number": 11, "usage_type": "call" } ]
390975526
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import io """ Topology is a branch of mathematics that examines the shapes and structures of objects. The Euler characteristic is a topological label that we can determine for an item or collection of items. For a group of two dimensional objects, one way to...
null
python/ieeextreme/n09/thatssocharacteristicallyeuler/Xtreme9.0 - That's So Characteristically Euler!.py
Xtreme9.0 - That's So Characteristically Euler!.py
py
9,813
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.setrecursionlimit", "line_number": 23, "usage_type": "call" }, { "api_name": "io.open", "line_number": 324, "usage_type": "call" }, { "api_name": "sys.stdin.fileno", "line_number": 324, "usage_type": "call" }, { "api_name": "sys.stdin", "lin...
63172055
# -*- coding: utf-8 -*- # # Copyright (C) 2018-2020 CERN. # # invenio-app-ils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Test loans item permissions.""" from __future__ import absolute_import, print_function import json from ...
null
tests/api/test_loan_item_permissions.py
test_loan_item_permissions.py
py
5,403
python
en
code
null
code-starcoder2
76
[ { "api_name": "invenio_accounts.testutils.login_user_via_session", "line_number": 31, "usage_type": "call" }, { "api_name": "invenio_accounts.models.User.query.get", "line_number": 31, "usage_type": "call" }, { "api_name": "invenio_accounts.models.User.query", "line_number": ...
445528183
################################################################################ # IMPORTS ################################################################################ # Important preconfiguration. from gevent import monkey; monkey.patch_all() # Stdlib. from contextlib import closing from functools import reduce ...
null
proxy/main.py
main.py
py
5,822
python
en
code
null
code-starcoder2
76
[ { "api_name": "gevent.monkey.patch_all", "line_number": 6, "usage_type": "call" }, { "api_name": "gevent.monkey", "line_number": 6, "usage_type": "name" }, { "api_name": "os.environ.get", "line_number": 28, "usage_type": "call" }, { "api_name": "os.environ", "...
297456000
from django.urls import path from . import views app_name = 'accesscontrol' urlpatterns = [ path('grant/', views.add_access, name='grant'), path('edit/<int:pk>/', views.edit_access, name='edit'), path('revoke/<int:pk>/', views.delete_access, name='revoke'), path('list/', views.list_access, name='list'...
null
accesscontrol/urls.py
urls.py
py
587
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "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", ...
517580390
from __future__ import annotations from itertools import product from sys import stdin from typing import TypeVar from distance_matrix.DistanceMatrix import DistanceMatrix from graph.UndirectedGraph import Graph from helpers.InputUtils import str_to_list from phylogeny.UntrimTree import create_distance_matrix N = T...
null
docs/data/learn/Bioinformatics/input/ch7_code/src/phylogeny/UPGMA.py
UPGMA.py
py
6,453
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.TypeVar", "line_number": 13, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 14, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 15, "usage_type": "call" }, { "api_name": "graph.UndirectedGraph.Gr...
234915556
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('orders', '0002_remove_order_billing_address'), ] operations = [ migrations.AlterField( model_name='order', ...
null
orders/migrations/0003_auto_20150508_1032.py
0003_auto_20150508_1032.py
py
594
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 14, "usage_type": "call" }, {...
648055809
import sys import os from pymongo import MongoClient import socials.vk.parser as vk from settings import PUBLICS_LIST_FILE, MONGO_DB, MONGO_COLLECTION PARSERS = { 'vk': vk } mongo_client = MongoClient() mongo_db = mongo_client[MONGO_DB] mongo_posts_collection = mongo_db[MONGO_COLLECTION] def load_publics_li...
null
backend/parser.py
parser.py
py
2,244
python
en
code
null
code-starcoder2
76
[ { "api_name": "socials.vk.parser", "line_number": 11, "usage_type": "name" }, { "api_name": "pymongo.MongoClient", "line_number": 14, "usage_type": "call" }, { "api_name": "settings.MONGO_DB", "line_number": 15, "usage_type": "name" }, { "api_name": "settings.MONG...
29637045
from flask import Flask, request, jsonify from webapp.stations import hh_stations def create_app(): app = Flask(__name__) @app.route('/api/v1/metro/verificate', methods = ['POST']) def verificate_station(): stations_to_verify = [] unchanged = [] updated = [] deleted = [] ...
null
webapp/__init__.py
__init__.py
py
980
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.request.json", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 15, "usage_type": "name" }, { "api_name": "webapp.stations.hh_s...
139944588
""" Orchestrating the dwi-preprocessing workflow ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. autofunction:: init_fsl_dwi_preproc_wf """ import os import json from pkg_resources import resource_filename as pkgr_fn import nibabel as nb from nipype import logging from nipype.pipeline import engine as pe from nip...
null
qsiprep/workflows/dwi/fsl.py
fsl.py
py
9,921
python
en
code
null
code-starcoder2
76
[ { "api_name": "nipype.logging.getLogger", "line_number": 37, "usage_type": "call" }, { "api_name": "nipype.logging", "line_number": 37, "usage_type": "name" }, { "api_name": "nipype.pipeline.engine.Node", "line_number": 91, "usage_type": "call" }, { "api_name": "n...
92801451
import vk_api import data import random #import time from vk_api.longpoll import VkLongPoll, VkEventType #from datetime import datetime token = data.dt() vk_session = vk_api.VkApi(token = token) session_api = vk_session.get_api() longpoll = VkLongPoll(vk_session) #Стадия разговора с ботом. stage = 1 ...
null
main.py
main.py
py
4,989
python
en
code
null
code-starcoder2
76
[ { "api_name": "data.dt", "line_number": 8, "usage_type": "call" }, { "api_name": "vk_api.VkApi", "line_number": 9, "usage_type": "call" }, { "api_name": "vk_api.longpoll.VkLongPoll", "line_number": 12, "usage_type": "call" }, { "api_name": "vk_api.longpoll.VkEvent...
623417524
import sys from ezs3.command import do_cmd import commands import json import logging import traceback from ezs3 import storage from ezs3.log import EZLog from ezs3.remote import ASYNC_MODE from ezs3.cluster import ClusterManager, Role, RoleState, GW EZLog.init_handler(logging.DEBUG, "/var/log/ezcloud...
null
PYTHON/reformat-osd-final.py
reformat-osd-final.py
py
3,488
python
en
code
null
code-starcoder2
76
[ { "api_name": "ezs3.log.EZLog.init_handler", "line_number": 15, "usage_type": "call" }, { "api_name": "ezs3.log.EZLog", "line_number": 15, "usage_type": "name" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "ezs3.lo...
437179144
################################################################################ # #### Hiking_project_dbvisual.py ##### # # #### written by: Etienne Deneault ##### # ##########################################################################...
null
Hiking_project_dbvisual_4.py
Hiking_project_dbvisual_4.py
py
5,653
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.read_sql_query", "line_number": 23, "usage_type": "call" }, { "api_name": "bokeh.models.ColumnDataSource", "line_number": 27, "usage_type": "call" }, { "api_name": "g...
179739285
from pyecharts.charts import Bar # 配置图表 from pyecharts import options as opts c=Bar( Bar() .add_xaxis(['1','2','3','4','5','6']) .add_yaxis("好",[12,34,34,67,56,89]) .add_yaxis("坏",[13,37,109,56,47,79]) .set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=45)), ...
null
pyecharts教程/pyechar模块.py
pyechar模块.py
py
406
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyecharts.charts.Bar", "line_number": 5, "usage_type": "call" }, { "api_name": "pyecharts.charts.Bar", "line_number": 6, "usage_type": "call" }, { "api_name": "pyecharts.options.AxisOpts", "line_number": 10, "usage_type": "call" }, { "api_name": "py...
19713792
# -*- coding: utf-8 -*- """ Created on Sat Aug 8 13:09:42 2020 @author: yangy """ import torch import torchvision import torch.nn as nn from torchvision import transforms import torch.nn.functional as F from torchsummary import summary # device configuration device = torch.device("cuda:0" if torch.cuda.is_available(...
null
tutorial-contents/900_pytorch_Resnet.py
900_pytorch_Resnet.py
py
5,394
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 15, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torchvision.tran...
329757666
import re import dominate from dominate.tags import * #Creacion de los léxicos variables = "" operadores = "" enteros = "" flotante = "" strings = "" comentarios = "" comentariosMult = "" palabrasReservadas = "" lexico = [variables,operadores,enteros,flotante,strings,comentarios,comentariosMult,palabrasReservadas] #Se ...
null
resaltador.py
resaltador.py
py
4,363
python
en
code
null
code-starcoder2
76
[ { "api_name": "dominate.document", "line_number": 22, "usage_type": "call" }, { "api_name": "re.match", "line_number": 49, "usage_type": "call" }, { "api_name": "re.match", "line_number": 51, "usage_type": "call" }, { "api_name": "re.match", "line_number": 54,...
622829463
# -*- coding: utf-8 -*- """ Created on Sun Dec 3 23:36:59 2017 @author: Sharey """ import nltk from nltk.corpus import brown import collections import numpy as np import myHMM # Estimating P(wi | ti) from corpus data using Maximum Likelihood Estimation (MLE): # P(wi | ti) = count(wi, ti) / count(ti) # add an art...
null
assignment/assign2_code_v2/hmmpostag.py
hmmpostag.py
py
3,982
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 24, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 26, "usage_type": "call" }, { "api_name": "nltk.corpus.brown.tagged_sents", "line_number": 29, "usage_type": "call" }, { "api_name":...
78941381
import sys from collections import deque input = sys.stdin.readline M, N, H = map(int, input().split()) t = [[[] for _ in range(N)] for _ in range(H)] ripen = deque() for i in range(H): for j in range(N): tmp = list(input().split()) t[i][j] = tmp for k in range(M): if tmp[k] == ...
null
algo_py/boj/bj7569.py
bj7569.py
py
1,266
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" } ]
418882627
from zope import schema from zope.component import getMultiAdapter from zope.formlib import form from zope.interface import implements from plone.memoize.compress import xhtml_compress from plone.app.portlets.portlets import base from plone.memoize.instance import memoize from plone.portlets.interfaces import IPortlet...
null
agsci/ExtensionExtender/portlet/similar.py
similar.py
py
10,159
python
en
code
null
code-starcoder2
76
[ { "api_name": "zope.interface.implements", "line_number": 26, "usage_type": "call" }, { "api_name": "zope.schema.interfaces.IVocabularyFactory", "line_number": 26, "usage_type": "argument" }, { "api_name": "zope.schema.vocabulary.SimpleVocabulary", "line_number": 29, "usa...
581300610
from django.conf.urls import url from . import views urlpatterns = [ url( regex=r'^enroll/(?P<user_id>[0-9]+)/$', view=views.EnrollMembershipBySuper.as_view(), name='Enroll_by_super', ), url( regex=r'^(?P<user_id>[0-9]+)/(?P<payment_id>[0-9]+)/enroll/$', view=views.E...
null
space_manager/membership/urls.py
urls.py
py
799
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 15, "usage_type": "call" }, { "api_name": "django....
527015886
#Kamyar Ghiam 15-112 Term Project "Deciduo" Animation Framework from Supporting_Documents.TermProjectFinalMath import * import pygame import random import string from Supporting_Documents.Shift_Letters import findShift from Databases.Final_Databases.SQL_Database.SQL_Support import * #Food Database import Databases.Fi...
null
RunProgram.py
RunProgram.py
py
82,979
python
en
code
null
code-starcoder2
76
[ { "api_name": "pygame.font.init", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.font", "line_number": 32, "usage_type": "attribute" }, { "api_name": "pygame.font.Font", "line_number": 33, "usage_type": "call" }, { "api_name": "pygame.font", ...
3748399
import os, sys, re, signal, IPython from IPython.utils import io from IPython.core.autocall import IPyAutocall import snappy snappy_path = os.path.dirname(snappy.__file__) icon_file = os.path.join(snappy_path, 'info_icon.gif') if sys.platform == 'win32': mousewheel_factor = -120 else: mousewheel_factor = 1 try...
null
venv/Lib/site-packages/snappy-2.3.1-py2.7-win32.egg/snappy/tkterminal.py
tkterminal.py
py
26,680
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "snappy.__file__", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "li...
225916444
import http.client class RESTClient(object): def __init__(self, ip_addr, user_name): self.user_name = user_name self.__conn = http.client.HTTPConnection(ip_addr) def get_groups(self): headers = {'cache-control': "no-cache"} url = "/api/" + self.user_name + "/groups" s...
null
src/api/client.py
client.py
py
1,227
python
en
code
null
code-starcoder2
76
[ { "api_name": "http.client.client.HTTPConnection", "line_number": 7, "usage_type": "call" }, { "api_name": "http.client.client", "line_number": 7, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 7, "usage_type": "name" } ]
599178426
import json from django.shortcuts import render from django.http import HttpResponse class JsonResponse(HttpResponse): def __init__(self, content, **kwargs): kwargs['content_type'] = 'application/json' if(isinstance(content, list)): super(JsonResponse, self).__init__(json.dumps([ob.__di...
null
hello/views.py
views.py
py
1,506
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 5, "usage_type": "name" }, { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 11, "usage_type": "call" }, { "api_name": "json.dumps", "line_n...
229056926
import numpy as np import scipy.special class NeuralNetwork: def __init__(self, input_node, hidden_node, output_node, initial_wih, initial_who, learn_rate): self.i_nodes = input_node self.h_nodes = hidden_node self.o_nodes = output_node self.wih = initial_wih self.who = in...
null
NeuralNetwork.py
NeuralNetwork.py
py
2,118
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.special.special.expit", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.special.special", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scipy.special", "line_number": 15, "usage_type": "name" }, { "api_name": "...
281986998
from __future__ import print_function import select import socket import sys import termios import utils class BasicClient(object): def __init__(self, name, address, port): self.name = name self.address = address self.port = int(port) self.socket = socket.socket() def conne...
null
projects/proj1_chat/client.py
client.py
py
3,067
python
en
code
null
code-starcoder2
76
[ { "api_name": "socket.socket", "line_number": 17, "usage_type": "call" }, { "api_name": "socket.error", "line_number": 30, "usage_type": "attribute" }, { "api_name": "utils.CLIENT_CANNOT_CONNECT.format", "line_number": 31, "usage_type": "call" }, { "api_name": "ut...
164945470
import os import datetime import pathlib import codecs totalSites = 0 totalBCC = 0 index = 1 dirPath = os.path.join("..","..","_data") filename = os.listdir(dirPath) def countFile(dir, filename): path = os.path.join(dir, filename) #print("Testing site: " + path) if ".yml" in path: file = codecs....
null
scripts/python/bccAccepted.py
bccAccepted.py
py
1,613
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
249135161
import argparse from tokenizer import Tokenizer import sys #Next few lines parse the command line arguments. Number of Jack files (1st Argumument) is essentially ignored, and the rest of the arguments are proccessed as files. parser = argparse.ArgumentParser() parser.add_argument('nFiles', type = int, help = 'Number ...
null
projects/11/mines/src/compiler.py
compiler.py
py
23,442
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "tokenizer.Tokenizer", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 127, "usage_type": "call" }, { "api_name": "sys.exit", "...
51432155
import matplotlib.pyplot as plt import sqlite3 import numpy as np import matplotlib.patches as mpatches from graphs_common import RESTAURANTS_DB from graphs_common import get_grade_color ''' Supply a list of category aliases to fetch. Returns a tuple of (A, B, C, Category_Names) lists. ''' def _load_breakdown_data(ca...
null
graphs/category_barplot.py
category_barplot.py
py
2,803
python
en
code
null
code-starcoder2
76
[ { "api_name": "sqlite3.connect", "line_number": 14, "usage_type": "call" }, { "api_name": "graphs_common.RESTAURANTS_DB", "line_number": 14, "usage_type": "argument" }, { "api_name": "numpy.arange", "line_number": 55, "usage_type": "call" }, { "api_name": "matplot...
484058992
#!/usr/bin/env python from canari.maltego.utils import debug, progress from canari.framework import configure from common.entities import Hash from canari.maltego.entities import Domain from common.vt import bsearch from canari.maltego.message import UIMessage __author__ = 'Keith Gilbert - @digital4rensics' __copyrig...
null
src/Malformity/transforms/vt_priv_domain2hash.py
vt_priv_domain2hash.py
py
1,108
python
en
code
null
code-starcoder2
76
[ { "api_name": "common.vt.bsearch", "line_number": 33, "usage_type": "call" }, { "api_name": "common.entities.Hash", "line_number": 38, "usage_type": "call" }, { "api_name": "canari.maltego.message.UIMessage", "line_number": 40, "usage_type": "call" }, { "api_name"...
466016955
import unittest import os from click.testing import CliRunner from goji.client import JIRAClient from goji.commands import cli from goji.models import User, Issue, Transition, Issue from tests.server import ServerTestCase class TestClient(object): base_url = 'https://goji.example.com/' username = 'kyle' ...
null
tests/test_commands.py
test_commands.py
py
9,617
python
en
code
null
code-starcoder2
76
[ { "api_name": "goji.models.Transition", "line_number": 21, "usage_type": "call" }, { "api_name": "goji.models.Transition", "line_number": 22, "usage_type": "call" }, { "api_name": "goji.models.Transition", "line_number": 23, "usage_type": "call" }, { "api_name": "...
379857614
from django.shortcuts import render, render_to_response from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext from django.contrib.auth.decorators import login_required from datetime import datetime from .models import List, Link, UserExtra from .forms import NewListForm, ...
null
BookMarks/views.py
views.py
py
4,544
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.http.HttpResponse", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 13, "usage_type": "call" }, { "api_name": "models.List.objects.all", "line_number": 16, "usage_type": "call" }, { "api_name": "models.Li...
603701469
from __future__ import print_function import numpy as np from scipy.linalg import lu_factor, lu_solve from openmdao.api import ImplicitComponent class SolveMatrix(ImplicitComponent): def initialize(self): self.options.declare('surfaces', types=list) def setup(self): surfaces = self.options[...
null
openaerostruct/aerodynamics/solve_matrix.py
solve_matrix.py
py
2,317
python
en
code
null
code-starcoder2
76
[ { "api_name": "openmdao.api.ImplicitComponent", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.outer", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.ones", ...
331099521
import torch as t import torch.nn.functional as F import numpy as np from functools import reduce from copy import deepcopy def get_output_shape(input_shape, module): """Takes an input_shape and a module, and returns the shape that the module would return given a tensor of shape input_shape. Assumes that ...
null
stn/models/model_classes.py
model_classes.py
py
9,871
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.tensor", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 27, "usage_type": "attribute" }, { "api_name": "torch.nn.functional.interpolat...
423413797
# -*- coding: utf-8 -*- """ @author: alepouze """ # ============================================================================= # ### The dataset must begin at 00:00 ### # ============================================================================= import pandas as pd import numpy as np from statistics import mean...
null
bin/DataFeaturesCluster.py
DataFeaturesCluster.py
py
8,767
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "lin...
597720671
from flask import Blueprint, render_template, redirect, url_for, request, flash import mysql.connector from flask import jsonify, json, Response users = Blueprint('assignment11', __name__, static_folder='static', static_url_path='/pages/assignment11/assignment11/users'...
null
pages/assignment11/users.py
users.py
py
2,156
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Blueprint", "line_number": 5, "usage_type": "call" }, { "api_name": "mysql.connector.connector.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 13, "usage_type": "attribute" }, { "a...
478822362
from django.conf import settings from django.contrib.auth.models import AnonymousUser from threading import local from accounts.models import Org,OrgMembers from sequences import get_range from django.http.response import HttpResponse from rest_framework.response import Response from rest_framework import status from k...
null
orgMiddleWare/middleware.py
middleware.py
py
3,445
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.settings", "line_number": 12, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 13, "usage_type": "argument" }, { "api_name": "django.conf.settings", "line_number": 14, "usage_type": "argument" }, { "api_na...
52019444
from flight_scraper.solution_model import Solution, CalendarSolution, SeatQuery from engines.ita_matrix.driver import ItaMatrixDriver, CalendarItaMatrixDriver class FlightScraper(object): def __init__(self, origin, destination, depart_date, return_date, max_stops=0, day_range=None, airlines...
null
flight_scraper/scraper.py
scraper.py
py
2,686
python
en
code
null
code-starcoder2
76
[ { "api_name": "engines.ita_matrix.driver.ItaMatrixDriver", "line_number": 18, "usage_type": "call" }, { "api_name": "engines.ita_matrix.driver.CalendarItaMatrixDriver", "line_number": 22, "usage_type": "call" }, { "api_name": "flight_scraper.solution_model.CalendarSolution.object...
413543513
from __future__ import print_function import sys from flask import Flask, jsonify, request, render_template, redirect, url_for, flash from flask_cors import CORS from flask_bcrypt import Bcrypt import flask_login as flask_login from flask_login import login_required, current_user, LoginManager, login_user, logout_user,...
null
backend.py
backend.py
py
11,680
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 12, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 17, "usage_type": "call" }, { "api_name": "flask_bcrypt....
308697279
__authors__ = 'Nourou-Dine Ahohoue et Deep Dhanak' __date__ = "Vendredi, 24 Avril 2015" """Ce fichier permet d'initaliser le plateau de jeu ainsi que de débuter une partie d'Ultimate Tic Tac Toe. Ce fichier initialise le plateau de jeu et nous donne des fonctions associées à des boutons et des menus.""" from tkinter ...
null
interface/jeu_utictactoe.py
jeu_utictactoe.py
py
48,468
python
en
code
null
code-starcoder2
76
[ { "api_name": "tkinter.Canvas", "line_number": 18, "usage_type": "name" }, { "api_name": "tkinter.Canvas", "line_number": 52, "usage_type": "name" }, { "api_name": "tkinter.Tk", "line_number": 79, "usage_type": "name" }, { "api_name": "tictactoe.partie.Partie", ...
601291047
#!/usr/bin/env python3 import subprocess from argparse import ArgumentParser, RawDescriptionHelpFormatter def main(args): temp_file = 'temp.net' subprocess.call('python3 randommodel.py ' + args.network + ' ' + temp_file, shell=True) subprocess.call('python3 modeltocpp.py ' + temp_file + ' ' + args.output, s...
null
quicknet/createANN.py
createANN.py
py
741
python
en
code
null
code-starcoder2
76
[ { "api_name": "subprocess.call", "line_number": 9, "usage_type": "call" }, { "api_name": "subprocess.call", "line_number": 10, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "argparse.RawDe...
329638400
# -*- coding: utf-8 -*- import pytest from wemake_python_styleguide.visitors.wrong_keyword import ( BareRiseViolation, WrongRaiseVisitor, ) bare_raise_module = """ raise """ bare_raise_function = """ def function(): raise """ @pytest.mark.parametrize('code', [ bare_raise_module, bare_raise_fun...
null
tests/test_visitors/test_wrong_keyword/test_bare_raise.py
test_bare_raise.py
py
1,259
python
en
code
null
code-starcoder2
76
[ { "api_name": "wemake_python_styleguide.visitors.wrong_keyword.WrongRaiseVisitor", "line_number": 28, "usage_type": "call" }, { "api_name": "wemake_python_styleguide.visitors.wrong_keyword.BareRiseViolation", "line_number": 31, "usage_type": "name" }, { "api_name": "pytest.mark.p...
73047429
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup(name='graphRL', version='0.0.1', author='Laura D\'Arcy', author_email='luludarcy@gmail.com', description='a directed acyclic graph environment for use with openAI gym', long_description=long_description, long_...
null
setup.py
setup.py
py
677
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 14, "usage_type": "call" } ]
510951583
import json import os from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from skilletlib import SkilletLoader from cnc.models import RepositoryDetails from cnc.models import Skillet from pan_cnc.lib import cnc_utils from pan_cnc.lib.exceptions import DuplicateSkilletException def...
null
pan_cnc/lib/db_utils.py
db_utils.py
py
9,864
python
en
code
null
code-starcoder2
76
[ { "api_name": "pan_cnc.lib.cnc_utils.get_app_config", "line_number": 23, "usage_type": "call" }, { "api_name": "pan_cnc.lib.cnc_utils", "line_number": 23, "usage_type": "name" }, { "api_name": "cnc.models.RepositoryDetails.objects.get_or_create", "line_number": 46, "usage...