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
467789865
import urllib.request import urllib.parse import json import re import redis import os def print_format(type, text, segment=False): print("============================================================") if segment == True else print("", end="") print("[%s] %s" % (type, text)) print("=======================...
null
cc98-api/cc98.py
cc98.py
py
11,552
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 26, "usage_type": "call" }, { "api_name": "redis.Redis", "line_number": 28, "usage_type": "call" }, { "api_name": "urllib.request.parse.urlencode", "line_number": 32, "usage_type": "call" }, { "api_name": "urllib.request....
507200327
import numpy as np np.random.seed(1337) import matplotlib.pyplot as plt from keras.datasets import mnist from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Activation, Convolution2D, MaxPooling2D, Flatten from keras.optimizers import SGD from ker...
null
CNN-MNIST/cnn-mnist.py
cnn-mnist.py
py
2,323
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 3, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 3, "usage_type": "attribute" }, { "api_name": "keras.datasets.mnist.load_data", "line_number": 22, "usage_type": "call" }, { "api_name": "kera...
337096241
#! /usr/bin/env python # coding=utf-8 #################################################### # Author : longbin # Created date: 2018-04-14 21:49:05 #################################################### import random import re import socket import time import csv import http.client import requests from bs4 import Bea...
null
toolkit/bin/weather/weather.py
weather.py
py
7,216
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.choice", "line_number": 34, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 37, "usage_type": "call" }, { "api_name": "socket.timeout", "line_number": 40, "usage_type": "attribute" }, { "api_name": "time.sleep", "line...
74337491
# -*- coding: utf-8 -*- """ Created on Sat Dec 17 00:15:10 2016 @author: Alexander Kuhn-Regnier """ from __future__ import print_function from AMR_system import Grid,build_from_segments import numpy as np import matplotlib.pyplot as plt from AMR_coaxial_cable import Cable from matplotlib.ticker import FuncFormatter fr...
null
coaxial_cable_different_Ns_convergence_time_jacobi_iter.py
coaxial_cable_different_Ns_convergence_time_jacobi_iter.py
py
10,088
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.ioff", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 30, "usage_type": "call" }, { "api_name": "numpy.int64",...
232547631
# -*- coding: utf-8 -*- """Globals.""" from equipy_main.models import Software, Hardware from settings import HW_OLD from django.db.models import F import datetime def warn(request): """ Global warning counter. """ hardware = Hardware.objects.filter(purchase_date__lte = \ (datetime.datetime.now()...
null
equipy_main/globals.py
globals.py
py
689
python
en
code
null
code-starcoder2
83
[ { "api_name": "equipy_main.models.Hardware.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "equipy_main.models.Hardware.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "equipy_main.models.Hardware", "line_number": 14, "usa...
466833553
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import pickle from PIL import Image from sklearn.neural_network import MLPClassifier import argparse import torch import torch.optim as optim from tqdm import * from termcolor import * from torch.autograd import Variable import torch.nn.f...
null
package/glcmnet.py
glcmnet.py
py
4,076
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.nn.Conv2d", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_nu...
484756879
import config import filecmp import io import os.path import pandas as pd import pickle import requests import urllib.request from pdfminer3.layout import LAParams, LTTextBox from pdfminer3.pdfpage import PDFPage from pdfminer3.pdfinterp import PDFResourceManager from pdfminer3.pdfinterp import PDFPageInterpreter from ...
null
main.py
main.py
py
7,993
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.request.urlopen", "line_number": 37, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 37, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 37, "usage_type": "name" }, { "api_nam...
519061441
import json, linecache, os, requests, smtplib, sys, time, yaml, logging import traceback import pyper as pr import sqlite3 from pyper import R from boto.s3.connection import S3Connection import boto3 from flask import Flask, json, jsonify, request, Response, send_from_directory from stompest.config import StompConfig f...
null
comets/comets.py
comets.py
py
21,634
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
377964035
from config import Config as cfg from detectors import TextDetector, TextProposalDetector from other import draw_boxes, resize_im, CaffeModel import sys if '/usr/local/caffe/python' in sys.path: sys.path.remove('/usr/local/caffe/python') sys.path.insert(0, cfg.caffe_root + 'python') import cv2, os, caffe import o...
null
textDetector/textRecognizer.py
textRecognizer.py
py
4,772
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.path.remove", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_...
253508324
from unittest import TestCase from babbage.cube import Cube from elasticsearch import Elasticsearch, NotFoundError from babbage_fiscal import config, loader, model_registry from .test_common import SAMPLE_PACKAGES, NUM_RECORDS, LOCAL_ELASTICSEARCH MODEL_NAME, SAMPLE_PACKAGE = SAMPLE_PACKAGES['md'] class RegistryTe...
null
tests/test_registry.py
test_registry.py
py
2,505
python
en
code
null
code-starcoder2
83
[ { "api_name": "test_common.SAMPLE_PACKAGES", "line_number": 9, "usage_type": "name" }, { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "elasticsearch.Elasticsearch", "line_number": 19, "usage_type": "call" }, { "api_name...
32836897
# -*- coding:utf-8 -*- __author__ = 'lincolnfz@gmail.com' import cv2 import numpy as np def canny_1(): def CannyThreshold(lowThreshold): detected_edges = cv2.GaussianBlur(gray,(3,3),0) detected_edges = cv2.Canny(detected_edges,lowThreshold,lowThreshold*ratio,apertureSize = kernel_size) ...
null
opencv-demo.py
opencv-demo.py
py
1,844
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.GaussianBlur", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.Canny", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.bitwise_and", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_numb...
467381606
from matplotlib import pyplot as plt from adjustAndClean.StackData import StackData from adjustAndClean.TAQAdjust import TAQAdjust from adjustAndClean.AdjustingHashmap import AdjustingHashmap from copy import deepcopy """ Program to plot differences between adjusted and non-adjusted series. """ def plotSeries(series1...
null
adjustAndClean/AdjustAndBefore.py
AdjustAndBefore.py
py
2,323
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 12, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 12, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 17, "usage_type": "call" }, { "api_name": "mat...
326250419
from . import admin from app import db,UP_DIR from app.models import * from flask import render_template,flash,request,redirect,url_for,session,make_response,current_app from werkzeug.security import generate_password_hash,check_password_hash from functools import wraps from app.admin.forms import AddAreaForm,LoginForm...
null
app/admin/views.py
views.py
py
22,578
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.session", "line_number": 18, "usage_type": "name" }, { "api_name": "flask.redirect", "line_number": 19, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 19, "usage_type": "call" }, { "api_name": "functools.wraps", "lin...
627747706
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
null
google/cloud/osconfig_v1/types/os_policy.py
os_policy.py
py
42,509
python
en
code
null
code-starcoder2
83
[ { "api_name": "proto.module", "line_number": 22, "usage_type": "call" }, { "api_name": "proto.Message", "line_number": 30, "usage_type": "attribute" }, { "api_name": "proto.Enum", "line_number": 69, "usage_type": "attribute" }, { "api_name": "proto.Message", "...
506297061
from PySide import QtCore, QtGui from ProjectDetailsViewUI import Ui_ProjectDetailsView from FluidExplorerPlugin.ui.Utils.DefaultUIValues import DefaultUIParameters from FluidExplorerPlugin.ui.Utils.ProjectDetailsViewUtils import ProjectDetailsViewUtils from FluidExplorerPlugin.ui.Utils.ProjectDetailsViewUtils import ...
null
Windows-Maya_2014_2016/FluidExplorerPlugin/ui/ProjectDetailsView.py
ProjectDetailsView.py
py
31,415
python
en
code
null
code-starcoder2
83
[ { "api_name": "PySide.QtGui.QDialog", "line_number": 21, "usage_type": "attribute" }, { "api_name": "PySide.QtGui", "line_number": 21, "usage_type": "name" }, { "api_name": "PySide.QtGui.QDialog.__init__", "line_number": 28, "usage_type": "call" }, { "api_name": "...
538580907
''' Created on Jan 18, 2011 @author: Christopher Glass <christopher.glass@divio.ch> ''' from django.db.models.fields import DecimalField class CurrencyField(DecimalField): ''' A CurrencyField is simply a subclass of DecimalField with a fixed format: max_digits = 12 and decimal_places=2 ''' def __...
null
shop/util/fields.py
fields.py
py
582
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.models.fields.DecimalField", "line_number": 9, "usage_type": "name" } ]
149986222
from django.urls import path from . views import * urlpatterns = [ path("savings-ledger/", SavingLog.as_view(), name="savings-ledger"), path("group-savings-ledger/", GroupSavingLog.as_view(), name="group-savings-ledger"), path("memberships-ledger/", MemberRegistrationLog.as_view(), name="memberships-ledger"), path...
null
ledger/urls.py
urls.py
py
889
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 5, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 7, "usage_type": "call" }, { "api_name": "django.urls.path", ...
450042268
import app.constants as c from flask import json import pytest from app.config.settings import config from app.database.model import TableModel from app.database.engine import Memberships from app.services.MembershipService import MembershipsServiceModel SITE_ID = config('SITE_ID') JOB_SEEKER = "83fa7e00-c94b-45cc-bed...
null
tests/test_membership.py
test_membership.py
py
3,132
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.config.settings.config", "line_number": 9, "usage_type": "call" }, { "api_name": "app.database.model.TableModel", "line_number": 19, "usage_type": "call" }, { "api_name": "app.database.engine.Memberships", "line_number": 19, "usage_type": "argument" }...
198372887
import numpy as np import funcs import matplotlib.pyplot as plt tMax = 300 repeats = 200 NLimit = 70 etas = np.arange(0.01,0.05,0.01) lambdaList = [] sList = [] for eta in etas: sigmas = np.arange(1.5,2.8,0.05)*eta for sigma in sigmas: lambdas = [] for i in range(repeats): x0 = np...
null
q4-3.py
q4-3.py
py
919
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 14, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.random", "line_n...
616351378
#!/usr/bin/python3 import requests,sys,webbrowser,os,re from bs4 import BeautifulSoup from fake_useragent import UserAgent from markdown import markdown if len(sys.argv[1:])==0: search_term = ' '.join(input("Enter the search term\n").split()) else: search_term = ' '.join(sys.argv[1:]) headers = {'User-Agent':...
null
gsearch.py
gsearch.py
py
2,198
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "fake_useragent.UserAgent", "line_number": 12, "usage_type": "call" }, { "api_name": "requests.get", ...
276840148
# -- coding: utf-8 -- from flask import Flask,url_for,render_template,redirect,session,request, make_response from flask_restful import Api, Resource from Model import dao from Controller import User, Main import config from flask_cors import CORS app = Flask(__name__) api = Api(app) CORS(app) api.add_resource(Main.M...
null
app.py
app.py
py
923
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_cors.CORS", "line_number": 11, "usage_type": "call" }, { "api_name": "Controller.Main.Main", ...
15933577
# -*- coding: utf-8 -*- from flask import Flask, render_template, flash, redirect, url_for, session, logging from flask_mysqldb import MySQL from wtforms import Form, StringField, IntegerField, DecimalField, PasswordField, validators app = Flask(__name__) # Config MySQL app.config['MYSQL_HOST'] = 'localhost' app.co...
null
__init__.py
__init__.py
py
4,708
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "flask_mysqldb.MySQL", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.render_tem...
427204759
#!/usr/bin/env python # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import os import platform import sys from setuptools import find_packages, setup try: from setuptools_rust imp...
null
setup.py
setup.py
py
6,394
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
265099571
import scipy.stats as stats import numpy as np import warnings from ecdfgof import adtest, kstest warnings.filterwarnings("ignore") _long = [ ("alpha", stats.alpha), ("anglit", stats.anglit), ("arcsine", stats.arcsine), ("argus", ...
null
funcsim/distfit.py
distfit.py
py
7,607
python
en
code
null
code-starcoder2
83
[ { "api_name": "warnings.filterwarnings", "line_number": 8, "usage_type": "call" }, { "api_name": "scipy.stats.alpha", "line_number": 12, "usage_type": "attribute" }, { "api_name": "scipy.stats", "line_number": 12, "usage_type": "name" }, { "api_name": "scipy.stats...
514226931
"""Action Module circuits component to execute simple REST API queries""" import logging import base64 import copy import json import requests from string import Template from pkg_resources import Requirement, resource_filename from circuits.six import string_types as string_types from resilient import SimpleHTTPExcept...
null
older/rc-query-rest/query_runner/components/rest_query.py
rest_query.py
py
4,115
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "pkg_resources.resource_filename", "line_number": 26, "usage_type": "call" }, { "api_name": "pkg_resources.Requirement", "line_number": 26, "usage_type": "call" }, { "api_n...
420360385
import os from setuptools import setup, find_packages version = "0.0.6" install_requires = [ "jinja2", "google-api-python-client>=1.7.4", "pyyaml>=3.13", "requests>=2.20.0", "google-cloud-pubsub>=0.38.0", "google-cloud-logging>=1.7.0", ] tests_require = ["pytest", "docker", "mock"] setup( ...
null
python/setup.py
setup.py
py
687
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 17, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 23, "usage_type": "call" } ]
531517953
# %% Define environment import numpy as np from numpy.core.fromnumeric import argmax from numpy.random import rand, randint import matplotlib.pyplot as plt import random #TODO: def environment(a, bandits): assert 0 <= a < len(bandits) mean, dev = bandits[a] return mean + (rand() * 2 - 1) * dev...
null
D1 agents/domaci1.py
domaci1.py
py
3,692
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.rand", "line_number": 13, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.random.rand", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.random.randint...
525395517
from pymongo import MongoClient import time import random #Import beautiful soup import requests import re from bs4 import BeautifulSoup import argparse client = MongoClient() database = client['capstone'] # Database name mongo_connect = database['onion_articles'] def scrape(start_link): ''' INPUT: ...
null
web_scraper.py
web_scraper.py
py
3,530
python
en
code
null
code-starcoder2
83
[ { "api_name": "pymongo.MongoClient", "line_number": 11, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 39, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 44, "usage_type": "call" }, { "api_name": "requests.get", ...
408610167
import requests from bs4 import BeautifulSoup import re import time #取到百思不得姐段子 里的 # 用户名,时间,标题,图片(保存名为标题) # 1 分析,各个数据的位置 def download(page=1): url="http://www.budejie.com/%d"%(page) headers={ "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.344...
null
spider/baisibudejie.py
baisibudejie.py
py
2,267
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "re.sub", "line_number...
386668499
""" Endpoints for feedback operations. Due to the nature of feedback being tied to events, lots of this code will have cross reference with `event_id`'s. This is as much coupling as should be allowed here; we need to leave the actual union of events and feedback to code in `util/` files to remain flexible and have th...
null
routes/feedback.py
feedback.py
py
2,212
python
en
code
null
code-starcoder2
83
[ { "api_name": "fastapi.APIRouter", "line_number": 19, "usage_type": "call" }, { "api_name": "models.events.EventId", "line_number": 30, "usage_type": "attribute" }, { "api_name": "models.events", "line_number": 30, "usage_type": "name" }, { "api_name": "models.fee...
186178544
#! /usr/bin/env python import os import sys def _release_path_test(curpath,*paths): testfile = os.path.join(curpath,*paths) if os.path.exists(testfile): if curpath != sys.path[0]: if curpath in sys.path: sys.path.remove(curpath) oldpath=sys.path ...
null
test/release/releasetest.py
releasetest.py
py
4,072
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8,...
482875144
from __future__ import absolute_import from .config import CONFIG from .util import esi, esi_client, name_to_id, HTTPError from .assets import Asset, Type, is_system_id from .pos_resources import pos_fuel import sys import math import datetime from decimal import Decimal import six from six.moves import range def ne...
null
structurebot/pos.py
pos.py
py
10,153
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.maxsize", "line_number": 17, "usage_type": "attribute" }, { "api_name": "six.iteritems", "line_number": 19, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 21, "usage_type": "call" }, { "api_name": "math.pow", "line_number"...
509797695
import requests,random class Api(): base_url='https://wger.de/api/v2/' def __init__(self,auth_token,username,password): self.auth_token = auth_token self.username=username self.password=password def __repr__(self): return f"User: {self.username}" def user_login(self):...
null
wger.py
wger.py
py
14,005
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "requests.post", "line_num...
165007795
# -*- coding: utf-8 -*- """ NLP Pipeline чатбота Содержит код для выполнения операций с текстом на русском языке (или на другом целевом), в частности - токенизация, лемматизация, частеречная разметка. Для этого грузит разнообразные пакеты, включая POS Tagger, чанкер etc. Различные словарные базы. Для проекта чатбота ...
null
ruchatbot/bot/text_utils.py
text_utils.py
py
13,056
python
en
code
null
code-starcoder2
83
[ { "api_name": "rutokenizer.Segmenter", "line_number": 59, "usage_type": "call" }, { "api_name": "ruchatbot.utils.tokenizer.Tokenizer", "line_number": 60, "usage_type": "call" }, { "api_name": "ruchatbot.bot.language_resources.LanguageResources", "line_number": 63, "usage_...
411671888
import torch from torch.utils.data import Dataset from loader.funcs import ensure_size class MaskedTrainDataset(Dataset): def __init__(self, user_to_seqs, max_len, mask_prob, token_mask, token_pad, num_items, rng): # user_with_items: dict, {user_id: [[item_id,...], [item_id,...]]} self.user_to_s...
null
loader/masked_dataset.py
masked_dataset.py
py
2,956
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.utils.data.Dataset", "line_number": 7, "usage_type": "name" }, { "api_name": "loader.funcs.ensure_size", "line_number": 57, "usage_type": "call" }, { "api_name": "loader.funcs.ensure_size", "line_number": 58, "usage_type": "call" }, { "api_nam...
291601588
from django.db.models.signals import post_save from django.contrib.auth.models import User from django.contrib.auth.models import Group from .models import EmplopyeeDetails def employee_profile(sender, instance, created, **kwargs): if created: group = Group.objects.get(name='employees') instance.groups.add(grou...
null
loginanddashboard/signals.py
signals.py
py
496
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.models.Group.objects.get", "line_number": 10, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.Group.objects", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.models.Group", "line_number": ...
74878705
import sys import xhtml2pdf.pisa as pisa from io import StringIO import re from inspect import getframeinfo, stack try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET """ G_ActionOutputCreateAccount = r'''<?xml version="1.0" encoding="UTF-8" ?><ScriptOutput><Data>...
null
STG/Guest_WIFI_Create_PDF.py
Guest_WIFI_Create_PDF.py
py
12,069
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.sub", "line_number": 44, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 45, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 46, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 47, "usage_type"...
60198393
from django.conf.urls import url from . import views app_name = 'courseselect' urlpatterns = [ url(r'^$', views.login, name='index'), url('logout', views.logout, name='logout'), url('student/index', views.stu_index, name='stu_index'), url('student/courseResult.html', views.selected, name='sel...
null
mysite/courseselect/urls.py
urls.py
py
2,045
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "django.co...
9807932
import numpy as np from scipy import misc import matplotlib.pyplot as plt from os import path from glob import glob from challenge_utils import * # The working directory where the data was dumped workdir = 'features' # n is the number of images along each image dimension n = 10 featurelist = ['border', 'border_pix5',...
null
sortbyfeatureplots.py
sortbyfeatureplots.py
py
1,603
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.load", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number": 16, "usage_type": "name" }, { "api_name": "glob.glob", "line_number": 19, ...
97202582
import time import sqlite3 import psutil connection = sqlite3.connect('/etc/iemlav/db.sqlite3') connection.execute('''CREATE TABLE IF NOT EXISTS USERS( ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME CHAR(100), IP CHAR(100), dt TIMESTAMP );''') class IemlAVUserLogger(): BOLD = '\033[1m' ...
null
iemlav/users.py
users.py
py
2,067
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 38, "usage_type": "call" }, { "api_name": "psutil.users", "line_number": 45, "usage_type": "call" }, { "api_name": "time.strftime", "line_n...
446613082
#coding:utf-8 import http; import json import urllib import signature as sg def invest(sid,productId,productCategory,amount,sessionId,coinNumm): if sid !="": num = "0123456789" randomStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ/" time, method = sg.getServerTime() t = time rd = sg.ra...
null
invest.py
invest.py
py
2,592
python
en
code
null
code-starcoder2
83
[ { "api_name": "signature.getServerTime", "line_number": 14, "usage_type": "call" }, { "api_name": "signature.random_str", "line_number": 16, "usage_type": "call" }, { "api_name": "signature.random_str", "line_number": 17, "usage_type": "call" }, { "api_name": "sig...
159088737
from django import forms from bhp066.apps.bcpp.base_model_form import BaseModelForm from edc_constants.constants import ALIVE, DEAD, NO, YES, UNKNOWN from ..models import CallLog, CallLogEntry class CallLogForm (BaseModelForm): class Meta: model = CallLog class CallLogEntryForm (BaseModelForm): ...
null
bhp066/apps/bcpp_subject/forms/call_log_form.py
call_log_form.py
py
4,962
python
en
code
null
code-starcoder2
83
[ { "api_name": "bhp066.apps.bcpp.base_model_form.BaseModelForm", "line_number": 9, "usage_type": "name" }, { "api_name": "models.CallLog", "line_number": 12, "usage_type": "name" }, { "api_name": "bhp066.apps.bcpp.base_model_form.BaseModelForm", "line_number": 15, "usage_t...
63931198
import re from collections import defaultdict from pathlib import Path from typing import Pattern, List, Callable, Dict, Any, Optional from pydantic import BaseModel, root_validator from releaseherald import templates DEFAULT_FRAGMENTS_DIR = Path("news_fragments") DEFAULT_VERSION_TAG_PATTERN = re.compile(r"(?P<vers...
null
releaseherald/releaseherald/configuration.py
configuration.py
py
2,017
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 14, "usage_type": "name" }, { "api_name": "typing.Dict", "line_numbe...
292145017
import pythoncom import PyHook3 import datetime # from savetime import Savetime def onMouseEvent(event): # 监听鼠标事件 print("MessageName:", event.MessageName) print(str(datetime.datetime.now())) # print("Message:", event.Message) # print("Time:", event.Time) print("Window:", event.Window) prin...
null
time/my-main-code/remoterecord-origial.py
remoterecord-origial.py
py
997
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 10, "usage_type": "attribute" }, { "api_name": "PyHook3.HookManager", "line_number": 27, "usage_type": "call" }, { "api_name": "pyth...
348063354
# -*- coding: utf-8 -*- import codecs import pprint import collections import hashlib #f1 = open('book.txt', 'w') #f1= codecs.open('book.txt', 'w',"utf-8") subindex = 0 # books map: key = название и автор, значения - массив цитат. books = {'title, author':['cit1', 'cit2']} key=''; lastModifiedStr = ""; with cod...
null
v1/clipingsParcer.py
clipingsParcer.py
py
2,230
python
en
code
null
code-starcoder2
83
[ { "api_name": "codecs.open", "line_number": 20, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 50, "usage_type": "call" }, { "api_name": "pprint.PrettyPrinter", "line_number": 52, "usage_type": "call" }, { "api_name": "hashlib.md5"...
103203503
import sys from PIL import Image, ImageChops import random import argparse import os argument_parser = argparse.ArgumentParser(description="Intensifies gifs poorly") argument_parser.add_argument("--file", "-f", action='store', help="file path", required=True) argument_parser.add_argument(...
null
_static/transcribing/intensify.py
intensify.py
py
2,947
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 22, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 22, "usage_type": "name" }, { "api_name": "random.choice", "...
376142000
# -*- coding: utf-8 -*- from datetime import datetime from dateutil import parser as parser_date def convert_date(date, parser=None): if date: if parser: try: date = datetime.strptime(date, '%d/%m/%Y') except Exception: date = parser_date.parse(date...
null
Allgoo/andbank-service/api/util/string.py
string.py
py
722
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 11, "usage_type": "name" }, { "api_name": "dateutil.parser.parse", "line_number": 13, "usage_type": "call" }, { "api_name": "da...
600660611
from Luna.modules.sql.night_mode_sql import add_nightmode, rmnightmode, get_all_chat_id, is_nightmode_indb from telethon.tl.types import ChatBannedRights from apscheduler.schedulers.asyncio import AsyncIOScheduler from telethon import functions from Luna.events import bot as register from Luna import tbot, CMD_HELP im...
null
Luna/modules/Night_Mode.py
Night_Mode.py
py
4,828
python
en
code
null
code-starcoder2
83
[ { "api_name": "telethon.tl.types.ChatBannedRights", "line_number": 10, "usage_type": "call" }, { "api_name": "telethon.tl.types.ChatBannedRights", "line_number": 23, "usage_type": "call" }, { "api_name": "Luna.tbot", "line_number": 48, "usage_type": "call" }, { "a...
73539881
from subprocess import Popen, PIPE import json import time import urllib2 import ssl from django.core.urlresolvers import reverse from django.http import HttpResponse from django.shortcuts import render from django.template import RequestContext from django.template.loader import render_to_string from django.utils imp...
null
plugins/sonarr/resources/sonarrUI/freenas/views.py
views.py
py
10,593
python
en
code
null
code-starcoder2
83
[ { "api_name": "jsonrpclib.jsonrpc", "line_number": 19, "usage_type": "attribute" }, { "api_name": "jsonrpclib.jsonrpc.SafeTransport.__init__", "line_number": 22, "usage_type": "call" }, { "api_name": "jsonrpclib.jsonrpc", "line_number": 22, "usage_type": "attribute" }, ...
172005
""" Run evaluation with saved models. """ import os import random import json import argparse import pickle import torch import torch.nn as nn import torch.optim as optim from global_random_seed import RANDOM_SEED from data.loader import DataLoader, KnowledgeLoader from model.rnn import RelationModel from utils impo...
null
eval.py
eval.py
py
4,880
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 21, "usage_type": "call" }, { "api_name": "global_random_seed.RANDOM_SEED", "line_number": 35, "usage_type": "name" }, { "api_name": "torch.cuda.is_available", "line_number": 36, "usage_type": "call" }, { "ap...
221857799
import mysql.connector from osmread import parse_file, Node, Way from path import Path from os import path class Handle: file_path = '' cnx = mysql.connector.connect(option_files="./mysql.cnf") cursor = cnx.cursor() def __init__(self, osm_file): if path.isfile(path.dirname(path.abspath(__fil...
null
handle.py
handle.py
py
2,706
python
en
code
null
code-starcoder2
83
[ { "api_name": "mysql.connector.connector.connect", "line_number": 10, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 10, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 10, "usage_type": "name" }, { "...
54989210
# -*- coding: utf-8 -*- from setuptools import setup, find_packages version = "1.0.0" setup(name="SamplePythonPackage", version=version, description="Python Sample Package", author="Kosei Himeno", author_email="k.himeno314@gmail.com", packages=find_packages(), license="", entry_points={ ...
null
setup.py
setup.py
py
468
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 12, "usage_type": "call" } ]
252410488
import argparse import os import numpy as np import torch import torch.optim as optim from numpy.core.defchararray import mod from torch import nn from torch.optim.lr_scheduler import StepLR from torch.utils.data import DataLoader from models.prototypical import Convnet4, Hallucination, Discriminator from src.dataset...
null
hw4-shuoenchang/training_code/train_q3.py
train_q3.py
py
8,962
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.LongTensor", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.LongTensor", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.empty", "line_number": 32, "usage_type": "call" }, { "api_name": "torch.cat", "line_n...
28202727
import requests import pandas as pd from bs4 import BeautifulSoup res = requests.get("http://roll.mil.news.sina.com.cn/col/zgjq/index.shtml") res.encoding = 'GB2312' # print(res.text) soup = BeautifulSoup(res.text,'html.parser') fList = soup.select('.fixList') # print(fList) for each in fList[0].select('li'): ...
null
code/新浪军事/新浪军事.py
新浪军事.py
py
807
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 24, "usage_type": "call" } ]
388412919
from src.extract_old_site.modules import excavation_details_page as exc_det import pathlib import os from unittest import mock import pytest # Structure 1, /dig/html/excavations/exc_is.html exc_is_html_str = """ <html><head><title>Excavating Occaneechi Town - [Excavations]</title></head> <frameset cols="408,*" border=...
null
tests/extract_old_site/modules/test_excavation_details_page.py
test_excavation_details_page.py
py
18,941
python
en
code
null
code-starcoder2
83
[ { "api_name": "pathlib.Path", "line_number": 407, "usage_type": "call" }, { "api_name": "os.path.normpath", "line_number": 407, "usage_type": "call" }, { "api_name": "os.path", "line_number": 407, "usage_type": "attribute" }, { "api_name": "src.extract_old_site.mo...
532826978
#!/usr/bin/env python #-*- coding: utf8 -*- from keras.datasets import mnist from keras import models from keras import layers from keras.utils import to_categorical import matplotlib.pyplot as plt (train_images, train_labels), (test_images, test_labels) = mnist.load_data() # neural network network = models.Seq...
null
ArtificialIntelligence/BasicsTensorFlow/Chapter3/mnist_digits_keras.py
mnist_digits_keras.py
py
1,387
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.datasets.mnist.load_data", "line_number": 12, "usage_type": "call" }, { "api_name": "keras.datasets.mnist", "line_number": 12, "usage_type": "name" }, { "api_name": "keras.models.Sequential", "line_number": 15, "usage_type": "call" }, { "api_n...
341156135
from pygame import Surface from Board import Board from colors import STANDARD_COLOR, WALL, PRIM_COLOR, LIGHTBLUE from config import screen, board, buttons def buttons_on_click(x: int, y: int) -> None: """check if the mouse click the button Parameters: x (int): x screen coordinate ...
null
GeraLabirintos/buttonsHelper.py
buttonsHelper.py
py
765
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.buttons", "line_number": 12, "usage_type": "argument" }, { "api_name": "config.buttons", "line_number": 13, "usage_type": "name" }, { "api_name": "config.screen.fill", "line_number": 14, "usage_type": "call" }, { "api_name": "colors.LIGHTBLUE...
104487933
import logging from logging import handlers import sys import traceback import datetime import re import socket log = logging.getLogger('ublogging.' + __name__) log.setLevel(logging.INFO) ch = logging.StreamHandler() log.addHandler(ch) RAW = 21 regformat = '%(asctime)s %(levelname)s %(message)s' detformat = '%(ascti...
null
ublogutils/ublogging.py
ublogging.py
py
2,124
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.StreamHandler", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.For...
68466813
#!/usr/bin/env python import sys import datetime import math """ isDatetime returns whether a string could represent a date according to the format %m%d%Y Input Arguments: 1. s - string Return Values: 1. True if s could represent a date (i.e. "01312018" represents January 31st, 2018); False otherwise """ def isDat...
null
src/donation-analytics.py
donation-analytics.py
py
6,070
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.strptime", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "math.ceil", "line_number": 72, "usage_type": "call" }, { "api_name": "sys.argv"...
245642662
import argparse import os import subprocess m4_code_root = "/home/xiaxingsuo/code/m4" m4_repo_init = "repo init -u ssh://xiaxingsuo@58.213.63.62:29418/discovery/manifest -b szjy-main -m m4.xml " \ "--repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable " m4_repo_sync = "repo sync -c -j4...
null
bin/crontab_build.py
crontab_build.py
py
6,809
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path", "line_number": 38, "usage_type": "attribute" }, { "api_name": "subprocess.Popen"...
489933888
#! /usr/bin/python3 import sys import os import os.path as path from pathlib import Path from pdfminer.pdfparser import PDFParser, PDFDocument from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.converter import PDFPageAggregator from pdfminer.layout import LAParams, LTTextBox, LTTextLi...
null
search_index_pdf_in_bd.py
search_index_pdf_in_bd.py
py
2,046
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.basename", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 12, "usage_type": "attribute" }, { "api_name": "pdfminer.pdfparser.PDFPar...
55904453
''' Created on July 22, 2013 @author: markg Purpose: Handling requests for data for the whiteclif investor report ''' import logging import datetime from HTMLParser import HTMLParser import tornado.web from genoa.utils import json_safe from kew.pe.utils.excel_sheet_creation import render_irr_xlsx c...
null
src/kew/pe/handlers/wir_handler.py
wir_handler.py
py
3,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "tornado.web.web", "line_number": 17, "usage_type": "attribute" }, { "api_name": "tornado.web", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime.strp...
46495989
#-*-coding:utf-8-*- # 1.py说明 将训练图片准华为TXT文件 import os from PIL import Image import numpy as np from imageDeel import * def img2txt(img_path, txt_name): #将图像数据转化为TXT文件 # img_path: 图像文件路径 # txt_name: 输出txt文件路径 # 将图片转换成灰度图片 im = Image.open(img_path).convert('L') # im.save(txt_name) # 将图片转...
null
1.py
1.py
py
975
python
en
code
null
code-starcoder2
83
[ { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.savetxt", "line_number...
356835262
import pickle import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl import seaborn as sns from scipy import stats def r2(x, y): return stats.pearsonr(x, y)[0] ** 2 soc_ts = pickle.load(open("data/forsen/forsen_ts.p","rb")) df = pd.DataFrame.from_dict(soc_ts,orient='index') sns.set(color_cod...
null
graph_soc.py
graph_soc.py
py
2,550
python
en
code
null
code-starcoder2
83
[ { "api_name": "scipy.stats.pearsonr", "line_number": 9, "usage_type": "call" }, { "api_name": "scipy.stats", "line_number": 9, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict...
115202879
from typing import Iterable from django.contrib import admin from .models import FirebaseDevice @admin.register(FirebaseDevice) class FirebaseDeviceAdmin(admin.ModelAdmin): list_display = ('uuid', 'cloud_messaging_token', 'device_type', 'version', 'safe_addresses') list_filter = ('device_type', 'version', '...
null
safe_transaction_service/notifications/admin.py
admin.py
py
708
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 9, "usage_type": "name" }, { "api_name": "models.FirebaseDevice", "line_number": 20, "usage_type": "name" }, { "api...
138819228
from pyftpdlib.filesystems import AbstractedFS, FilesystemError from io import BytesIO import django import sys import os import datetime import time # 将项目路径添加到系统搜寻路径当中,查找方式为从当前脚本开始,找到要调用的django项目的路径 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # 设置项目的配置文件 不做修改的话就是 settings 文件 os.enviro...
null
ftpserver/harbor_file_system.py
harbor_file_system.py
py
14,428
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_num...
488990622
from flask import Flask, render_template, request, jsonify, redirect, make_response, abort from ConectorApi import ConectorApi from ControladorCookies import ControladorCookies from ControladorVerificaciones import ControladorVerificaciones from PerfilUsuario import PerfilUsuario, getSha from PerfilMascota import Perfi...
null
Python/Servidor.py
Servidor.py
py
22,835
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 11, "usage_type": "call" }, { "api_name": "ConectorApi.ConectorApi", "line_number": 12, "usage_type": "call" }, { "api_name": "ControladorCookies.ControladorCookies", "line_number": 13, "usage_type": "call" }, { "api_nam...
558040026
import random import numpy as np import pygame class BirdSprite(pygame.sprite.Sprite): size = 5 v_max = 3 clusteringF = 10 repulsionF = 1 wallDodgingF = 10 speedMatchingF = 5 runAwayF = 10 forceFactor = 0.02 def __init__(self, ix, iy, predator): pygame.sprite.Sprite.__i...
null
flocking/Bird.py
Bird.py
py
2,835
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.sprite", "line_number": 7, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 20, "usage_type": "attribute" }, { "api_name": "nu...
23427225
import pygame,random pygame.init() class Pole_4(pygame.sprite.Sprite): def __init__(self,screen): pygame.sprite.Sprite.__init__(self) self.screen = screen self.image = pygame.image.load("Poles/pole2.png") self.image = self.image.convert() self.rect = self.image.g...
null
Game/Poles/pole_4_c.py
pole_4_c.py
py
751
python
en
code
null
code-starcoder2
83
[ { "api_name": "pygame.init", "line_number": 2, "usage_type": "call" }, { "api_name": "pygame.sprite", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pygame.sprite.Sprite.__init__", "line_number": 6, "usage_type": "call" }, { "api_name": "pygame.spri...
339277127
import torch import torch.nn as nn from torch.distributions import Categorical import torch.optim as optim from skimage.color import rgb2gray from skimage import transform import torch.nn.functional as F import gym from torch.autograd import Variable import numpy as np import matplotlib.pyplot as plt from tqdm import t...
null
policy_gradient_duckie.py
policy_gradient_duckie.py
py
6,349
python
en
code
null
code-starcoder2
83
[ { "api_name": "gym.make", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 24, "usage_type": "call" }, { "api_name": "skimage.color.rgb2gray", "line_number": 28, "usage_type": "call" }, { "api_name": "skimage.transform.r...
31556002
# -*- coding:utf-8 -*- import sys import os import glob import codecs from xml.dom.minidom import parse from xml.dom import Node from xml.sax.saxutils import escape from PyQt4 import QtGui as gui from PyQt4 import QtCore as core class MainWindow(gui.QWidget): def __init__(self): super(MainWindow, self)._...
null
python/qt4/6.py
6.py
py
4,173
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt4.QtGui.QWidget", "line_number": 14, "usage_type": "attribute" }, { "api_name": "PyQt4.QtGui", "line_number": 14, "usage_type": "name" }, { "api_name": "PyQt4.QtGui.QGridLayout", "line_number": 20, "usage_type": "call" }, { "api_name": "PyQt4.Qt...
113653107
#!pip install pytube import pytube from pytube import YouTube from tkinter import * root = Tk() root.geometry("300x400") root.title("YouTube Video Downloader") def youtube(): a = var.get()#https://youtu.be/9emx__jxcTE ytvideo = YouTube(a).streams.filter(progressive=True, file_extension='mp4').or...
null
Youtube Project.py
Youtube Project.py
py
756
python
en
code
null
code-starcoder2
83
[ { "api_name": "pytube.YouTube", "line_number": 12, "usage_type": "call" } ]
239378221
import requests import json import os import re from itertools import islice from bs4 import BeautifulSoup from .models.gist import Gist from .models.team import Team from .models.member import Member from .common import PATH, logger, oauth_credential, git_credential from .database import remote_db, local_db from col...
null
page/app.py
app.py
py
7,408
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "common.git_credential", "line_number": 36, "usage_type": "name" }, { "api_name": "re.sub", "line_num...
267804224
from django.views.generic import TemplateView from venkkat.web.models import ContactForm class HomeView(TemplateView): template_name = 'html/index.html' def get_context_data(self, **kwargs): context = super(HomeView, self).get_context_data(**kwargs) context.update({ 'name': 'ven...
null
venkkat/web/views.py
views.py
py
412
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.views.generic.TemplateView", "line_number": 6, "usage_type": "name" }, { "api_name": "venkkat.web.models.ContactForm.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "venkkat.web.models.ContactForm.objects", "line_number": 14, "...
184465056
# -*- coding: utf-8 -*- """ Created on Wed Oct 19 19:53:15 2016 @author: chaitanya """ import numpy as np from matplotlib import pyplot as plt from pyexcel_ods import get_data from scipy.stats import norm from matplotlib.mlab import PCA def gaussian(x, mu, sig): return np.exp(-np.power(x - mu, 2.) / (2 * np.powe...
null
Assignment/03/code/gaussian.py
gaussian.py
py
2,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.exp", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.power", "line_number": 15, "usage_type": "call" }, { "api_name": "scipy.stats.norm.fit", "line_number": 21, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "li...
570885988
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.macosx-10.7-x86_64/egg/airflow/operators/slack_operator.py # Compiled at: 2019-09-11 03:47:34 # Size of source mod 2**32: 5189 bytes import json from ...
null
pycfiles/apache_airflow_arup-1.10.5-py3.6/slack_operator.cpython-36.py
slack_operator.cpython-36.py
py
4,360
python
en
code
null
code-starcoder2
83
[ { "api_name": "airflow.models.BaseOperator", "line_number": 14, "usage_type": "name" }, { "api_name": "airflow.exceptions.AirflowException", "line_number": 22, "usage_type": "call" }, { "api_name": "airflow.exceptions.AirflowException", "line_number": 25, "usage_type": "c...
569296012
# This sample tests Pyright's handling of recursive type aliases # that are also generic. from typing import List, TypeVar, Union _T2 = TypeVar("_T2", str, int) GenericTypeAlias1 = List[Union["GenericTypeAlias1", _T2]] SpecializedTypeAlias1 = GenericTypeAlias1[str] a1: SpecializedTypeAlias1 = ["hi", ["hi", "hi"]] ...
null
packages/pyright-internal/src/tests/samples/typeAlias7.py
typeAlias7.py
py
599
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TypeVar", "line_number": 6, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 8, "usage_type": "name" } ]
647209276
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 13 12:35:03 2019 @author: calbert """ # %% import time import numpy as np import matplotlib.pyplot as plt from fffi import fortran_library, fortran_module from netCDF4 import Dataset from mpl_toolkits.mplot3d import Axes3D pi = np.pi libneo_orb =...
null
PLOT/plot_field.py
plot_field.py
py
6,994
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.pi", "line_number": 17, "usage_type": "attribute" }, { "api_name": "fffi.fortran_library", "line_number": 19, "usage_type": "call" }, { "api_name": "fffi.fortran_module", "line_number": 23, "usage_type": "call" }, { "api_name": "fffi.fortran_m...
637323455
from sklearn import neighbors, datasets import matplotlib.pyplot as plt n_neigh = 7 weights = 'uniform' iris = datasets.load_iris() X = iris.data[:,:2] y = iris.target clf = neighbors.KNeighborsClassifier(n_neigh, weights=weights) clf.fit(X,y) #print(clf.predict([[3.3,1]])) from sklearn.model_se...
null
2semana/SKLEARN/aula-SKLearn.py
aula-SKLearn.py
py
952
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.datasets.load_iris", "line_number": 8, "usage_type": "call" }, { "api_name": "sklearn.datasets", "line_number": 8, "usage_type": "name" }, { "api_name": "sklearn.neighbors.KNeighborsClassifier", "line_number": 13, "usage_type": "call" }, { "...
604940709
# Bar chart code has been borrowed from: https://matplotlib.org/2.0.2/examples/pylab_examples/barchart_demo.html # Akshay Pal and Antoine Thibaut have both contributed to this code import numpy as np import pandas as pd import matplotlib.pyplot as plt # generic mpg ratings: hybrid = 7 diesel = 5.3 # specific mpg ra...
null
Route modelling code/Gallons.py
Gallons.py
py
15,273
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.DataFrame", "line_number": 102, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 196, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 196, "usage_type": "name" }, { "api_name": "nump...
637207759
from flask import Flask, render_template, request from flask import json import pandas as pd import numpy as np import pickle import scipy import requests RAPIDAPI_KEY = "" RAPIDAPI_HOST = "" url = "https://imdb8.p.rapidapi.com/title/get-overview-details" headers = { 'x-rapidapi-host': RAPIDA...
null
app.py
app.py
py
2,607
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.load", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 44, "usage_type": "call" }, { "api_name": "pandas.Series", "line_number": 45, "usage_type": "call" }, { "api_name": "flask.Flask", "line_n...
182477886
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import ryu.contrib ryu.contrib.update_module_path() from ryu import cfg import logging import sys from ryu import log log.early_init_log(logging.DEBUG) from ryu import flags from ryu import version from ryu.lib import hub from ryu.a...
null
dragon_knight/daemon.py
daemon.py
py
2,405
python
en
code
null
code-starcoder2
83
[ { "api_name": "ryu.contrib.contrib.update_module_path", "line_number": 6, "usage_type": "call" }, { "api_name": "ryu.contrib.contrib", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ryu.contrib", "line_number": 6, "usage_type": "name" }, { "api_name...
637160541
import argparse import hashlib import json from pathlib import Path from typing import Union ALGO_DICT = { 'sha256': hashlib.sha256(), 'sha512': hashlib.sha512(), 'sha1': hashlib.sha1(), 'md5': hashlib.md5(), } SUPPORTED_ALGOS = list(ALGO_DICT) CHUNK_SIZE = 64 * 1024 def fileChecksum( file_path: Union[s...
null
py_essentials/hashing.py
hashing.py
py
2,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "hashlib.sha256", "line_number": 8, "usage_type": "call" }, { "api_name": "hashlib.sha512", "line_number": 9, "usage_type": "call" }, { "api_name": "hashlib.sha1", "line_number": 10, "usage_type": "call" }, { "api_name": "hashlib.md5", "line_numb...
504452832
import sys import os if __name__=='__main__': cur_path = sys.path[0] sys.path.insert(0, os.path.join(cur_path, '..', '..','PyDispatcher-2.0.3'))# PyDispatcher-2.0.3/ sys.path.insert(0, os.path.join(cur_path, '..', '..')) # openvisualizer/ sys.path.insert(0, os.path.join(cur_pat...
null
software/openvisualizer/bin/moteStateGui/moteStateGui.py
moteStateGui.py
py
9,219
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_num...
300420154
from setuptools import setup, find_packages from setuptools.extension import Extension from distanceclosure import __package__, __description__, __version__ from Cython.Build import cythonize from Cython.Distutils import build_ext import subprocess # Readme def readme(): with open('README.md') as f: retu...
null
setup.py
setup.py
py
1,991
python
en
code
null
code-starcoder2
83
[ { "api_name": "subprocess.Popen", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 18, "usage_type": "call" }, { "api_name": "subprocess.Popen", "line_number": 19, "usage_type": "call" }, { "api_name": "setuptools.extensi...
472448389
import json import re import bottle import sqlitedatastore as datastore @bottle.route('/') def index_html(): return bottle.static_file('sample_06_09.html', root='./static') @bottle.route('/file/<filename:path>') def static(filename): return bottle.static_file(filename, root='./static') @bottle.get('/get'...
null
sample_06_08.py
sample_06_08.py
py
2,130
python
en
code
null
code-starcoder2
83
[ { "api_name": "bottle.static_file", "line_number": 10, "usage_type": "call" }, { "api_name": "bottle.route", "line_number": 8, "usage_type": "call" }, { "api_name": "bottle.static_file", "line_number": 15, "usage_type": "call" }, { "api_name": "bottle.route", ...
230486897
# Standard Library Imports from typing import Any, Dict, List, Tuple # RAMSTK Package Imports from ramstk.configuration import ( RAMSTK_ACTIVE_ENVIRONMENTS as RAMSTK_ACTIVE_ENVIRONMENTS ) from ramstk.configuration import ( RAMSTK_DORMANT_ENVIRONMENTS as RAMSTK_DORMANT_ENVIRONMENTS ) from ramstk.configuration i...
null
src/ramstk/views/gtk3/hardware/workview.pyi
workview.pyi
pyi
11,469
python
en
code
null
code-starcoder2
83
[ { "api_name": "ramstk.views.gtk3.widgets.RAMSTKPanel", "line_number": 49, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 50, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 51, "usage_type": "name" }, { "api_name": "typing.An...
69256701
import alsaaudio import base64 from datetime import datetime from io import BytesIO import pyscreenshot as ImageGrab from subprocess import call import webbrowser from Xlib.error import DisplayNameError import os from tools.common import UPLOAD_DIRECTORY from tools.common import HISTORY_DIRECTORY try: ...
null
tools/system_calls.py
system_calls.py
py
4,917
python
en
code
null
code-starcoder2
83
[ { "api_name": "Xlib.error.DisplayNameError", "line_number": 17, "usage_type": "name" }, { "api_name": "subprocess.call", "line_number": 69, "usage_type": "call" }, { "api_name": "webbrowser.open", "line_number": 78, "usage_type": "call" }, { "api_name": "subproces...
626610905
import logging as log from itertools import product import numpy as np from spacy.tokens import Span from experiments.tags import CategoricalTags from experiments.ontology.symbols import POS_TAGS, DEP_TAGS, IOB_TAGS, NER_TAGS, ALL_ENT_CLASSES, WORDNET_HYPERNYM_CLASSES from experiments.ontology.linker import NERTypeRe...
null
experiments/ontology/ont_encoder.py
ont_encoder.py
py
10,345
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.info", "line_number": 34, "usage_type": "call" }, { "api_name": "spacy.tokens.Span", "line_number": 36, "usage_type": "call" }, { "api_name": "experiments.ontology.linker.NERTypeResolver", "line_number": 45, "usage_type": "call" }, { "api_na...
483559610
#!/usr/bin/env python import sys import os import json import math def isclose(a, b, rel_tol=1e-09, abs_tol=0): return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) if len(sys.argv) < 2: print("\nUsage: python3 compare_results.py reference_results_path current_results_path") sys.exit(1) ref_res_...
null
ci/scripts/compare_results.py
compare_results.py
py
1,807
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
651557929
import argparse import sys import xgitInit as init parser = argparse.ArgumentParser(description='some useful git operation.') subparsers = parser.add_subparsers(help='sub-command help') parser_init = subparsers.add_parser('init') parser_init.add_argument('initName') args = parser.parse_args() if hasattr(args, 'ini...
null
xgit.py
xgit.py
py
360
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 6, "usage_type": "call" }, { "api_name": "xgitInit.create", "line_number": 15, "usage_type": "call" } ]
461194253
from django.conf import settings from rest_framework import pagination from rest_framework.response import Response from django.utils.translation import gettext_lazy as _ class Pagination(pagination.PageNumberPagination): page_size_query_param = 'page_size' max_page_size = None last_page_strings = ('last'...
null
app/pagination.py
pagination.py
py
1,234
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.pagination.PageNumberPagination", "line_number": 7, "usage_type": "attribute" }, { "api_name": "rest_framework.pagination", "line_number": 7, "usage_type": "name" }, { "api_name": "django.utils.translation.gettext_lazy", "line_number": 11, "u...
519521830
from django.shortcuts import render, redirect, HttpResponse from applistion.models import UserInfo, Student, Class, Teacher # Create your views here. # 登录功能 def login(request): if request.method == 'POST': name = request.POST.get('user') pwd = request.POST.get('pwd') if UserInfo.objects.fi...
null
management/applistion/views.py
views.py
py
3,951
python
en
code
null
code-starcoder2
83
[ { "api_name": "applistion.models.UserInfo.objects.filter", "line_number": 11, "usage_type": "call" }, { "api_name": "applistion.models.UserInfo.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "applistion.models.UserInfo", "line_number": 11, "usage_...
581529736
# tensorboard --logdir=. --host=127.0.0.1 from numpy.random import seed seed(1) from tensorflow import set_random_seed set_random_seed(2) import numpy as np import tensorflow as tf import os from datetime import datetime import pickle from sklearn.metrics import precision_score, recall_score import ml_helpers impor...
null
ml_tensorflow.py
ml_tensorflow.py
py
10,601
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.seed", "line_number": 4, "usage_type": "call" }, { "api_name": "tensorflow.set_random_seed", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.random.permutation", "line_number": 31, "usage_type": "call" }, { "api_name": "n...
150288477
# -*- coding: utf-8 -*- import random import numpy as np import time import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable #import torchvision.transforms as T import sys import argparse from argument import get_args args = get_args('DQN')...
null
DQN_basic.py
DQN_basic.py
py
3,740
python
en
code
null
code-starcoder2
83
[ { "api_name": "argument.get_args", "line_number": 19, "usage_type": "call" }, { "api_name": "env.Env", "line_number": 29, "usage_type": "call" }, { "api_name": "memory.ReplayMemory", "line_number": 32, "usage_type": "call" }, { "api_name": "agent.Agent", "line...
374412829
import torch.optim as optim import torch.nn as nn import torch import model import os from tensorboardX import SummaryWriter from dataset import UCF101DataSet # config and data path base_lr = 0.003 momentum = 0.9 batch_size = 30 num_classes = 101 num_epoches = 18 weight_decay = 0.005 train_list = 'list/train_ucf101.li...
null
train.py
train.py
py
3,204
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 19, "usage_type": "attribute" }, { "api_name": "model.C3D", "line_number": 24, "usage_type": "call" }, { "api_name": "dataset.UCF101DataSet", "line_number": 30, "usage_type": "call" }, { "api_name": "torch.utils.data.Data...
46778847
# -*- coding: utf-8 -*- """ Module for SSH destination. """ import socket import os from contextlib import contextmanager from multiprocessing import Process import time from twindb_backup import LOG from twindb_backup.destination.base_destination import BaseDestination from twindb_backup.destination.exceptions impo...
null
twindb_backup/destination/ssh.py
ssh.py
py
9,956
python
en
code
null
code-starcoder2
83
[ { "api_name": "twindb_backup.destination.base_destination.BaseDestination", "line_number": 35, "usage_type": "name" }, { "api_name": "socket.gethostname", "line_number": 46, "usage_type": "call" }, { "api_name": "twindb_backup.ssh.client.SshClient", "line_number": 49, "us...
196812321
from __future__ import unicode_literals from django.db import models, transaction from django.contrib.sites.models import Site from django.dispatch import receiver from django.db.models.signals import pre_delete,pre_save from django.utils.encoding import python_2_unicode_compatible from django.core.exceptions import V...
null
wildlifecompliance/components/organisations/models.py
models.py
py
36,300
python
en
code
null
code-starcoder2
83
[ { "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...
617485752
# FOR GETTING THE TWEETS import json new_data = [] tweets = [] for line in open('training.txt', 'r'): tweets.append(json.loads(line)) for i in range(len(tweets)): new_data.append(tweets[i]["text"].encode('utf-8').strip() + "\n") #new_data.append("\t\t\t\n") f = open('tweets.txt', 'w') for word in new_data:...
null
word2vec/extract.py
extract.py
py
345
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 10, "usage_type": "call" } ]
230040828
import astropy.units as u import numpy as np import matplotlib.pyplot as plt import os import pdb import astropy.constants as c import scipy from astropy.modeling.models import BlackBody from astropy.io import ascii from astropy.table import Table from tools import plots ROOT = os.path.dirname(os.path.abspath(__file__...
null
python/pyvista/etc.py
etc.py
py
12,761
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.dirname", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 13, "usage_type": "call" }, { "api_name": "astropy.modeling.models....