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
469733987
# Python SCALE Codec Library # # Copyright 2018-2020 Stichting Polkascan (Polkascan Foundation). # # 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...
null
scalecodec/base.py
base.py
py
16,634
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.sub", "line_number": 58, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 58, "usage_type": "attribute" }, { "api_name": "re.sub", "line_number": 59, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 5...
483712415
from collections import ChainMap from itertools import groupby from operator import itemgetter a = { 'x': 1, 'y': 2, 'z': 3 } b = { 'w': 10, 'x': 11, 'y': 2 } print("相同的keys") s = a.keys() & b.keys() print(s) print("a有b无的key") print(a.keys() - b.keys()) print("相同的键值对") v = a.items() & b.items(...
null
dataStructure/基本数据类型/zidian.py
zidian.py
py
2,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "operator.itemgetter", "line_number": 35, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 36, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 40, "usage_type": "call" }, { "api_name": "operator....
209452914
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Predict engagement metrics from all features in sparse matrix. Target: predict watch percentage Usage: python sparse_all_predictor.py -i ./ -o ./output -f wp Time: ~3H30M Target: predict relative engagement Usage: python sparse_all_predictor.py -i ./ -o ./output -f r...
null
engagement_prediction/sparse_all_predictor.py
sparse_all_predictor.py
py
9,716
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 20, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 20, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 20, "usage_type": "call" }, { "api_name": "os.path", "line_number...
518918020
import torch import torch.nn as nn from mmdet.core import bbox2result from ..builder import DETECTORS, build_backbone, build_head, build_neck from .base import BaseDetector import pdb from .distilling_single import Distilling_Single @DETECTORS.register_module() class Distilling_Single_IOU(Distilling_Single): """Ba...
null
mmdet/models/detectors/distilling_single_iou.py
distilling_single_iou.py
py
7,474
python
en
code
null
code-starcoder2
66
[ { "api_name": "distilling_single.Distilling_Single", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.max", "line_number": 58, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 60, "usage_type": "call" }, { "api_name": "torch.int64...
333767418
from django.shortcuts import render from django.http import HttpResponse from .models import Meeting,Participants import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders # Create your views here. def home(request)...
null
mainmanagement/views.py
views.py
py
3,747
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Meeting.objects.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Meeting.objects", "line_number": 11, "usage_type": "attribute" }, { "api_name": "models.Meeting", "line_number": 11, "usage_type": "name" }, { "api_name": ...
38593146
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # """ Script for running Spyder tests programmatically. """ # Standard library imports import os import sys import argparse # To activate/deactivate certain things for pytest's only # NOTE: Please leave ...
null
runtests.py
runtests.py
py
2,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 25, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.environ.get", "...
155957204
# -*- coding: utf-8 -*- from django import forms from images.models import Image class NewImageForm(forms.Form): image = forms.ImageField() image.widget.attrs['title'] = u'選択' image.widget.attrs['required'] = 'true' caption = forms.CharField(widget=forms.Textarea, required=False) letter = forms.C...
null
uploader/forms.py
forms.py
py
608
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.Form", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.ImageField", "line_number": 8, "usage_type": "call" }, { "api_name": "django.forms...
90929028
import requests,bs4 '''response = unirest.post("https://andruxnet-random-famous-quotes.p.rapidapi.com/?count=10&cat=movies", headers={ "X-RapidAPI-Host": "andruxnet-random-famous-quotes.p.rapidapi.com", "X-RapidAPI-Key": "7d44d1b4dcmsh89e99c245c83847p17a669jsn02bd85965f4f", "Content-Type": "application/x-...
null
quotess.py
quotess.py
py
526
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 11, "usage_type": "call" } ]
313522157
import cv2 as cv import numpy as np img = cv.imread('sudoku.png',) gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY) edges = cv.Canny(gray, 75, 150) cv.imshow('edges',edges) lines = cv.HoughLines(edges, 1, np.pi/180, 200) for lines in lines: ro,theta = lines[0] a = np.cos(theta) b = np.sin(theta) x0 = a * ro ...
null
Hough_transform.py
Hough_transform.py
py
567
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 4, "usage_type": "attribute" }, { "api_name": "cv2.Canny", "line_nu...
272571933
import math from bokeh.io import show, output_file from bokeh.plotting import figure, show, output_file from bokeh.models import GraphRenderer, StaticLayoutProvider, Circle, ColumnDataSource, LabelSet, Label from bokeh.palettes import Spectral8 from graph import * graph_data = Graph() graph_data.debug_create_test_da...
null
src/draw.py
draw.py
py
1,891
python
en
code
null
code-starcoder2
66
[ { "api_name": "bokeh.plotting.figure", "line_number": 22, "usage_type": "call" }, { "api_name": "bokeh.models.GraphRenderer", "line_number": 25, "usage_type": "call" }, { "api_name": "graph.node_renderer.data_source.add", "line_number": 27, "usage_type": "call" }, { ...
227007119
# coding: utf-8 from __future__ import print_function from __future__ import absolute_import from __future__ import division import os import numpy as np from PIL import Image from torch.utils import data from torchvision import transforms as T class Dataset(data.Dataset): def __init__(self, root, data_list_fil...
null
data/dataset.py
dataset.py
py
1,531
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.utils.data.Dataset", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 16, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path",...
290097234
import argparse import itertools import sh parser = argparse.ArgumentParser(description='Run combinations of CCP experiments') parser.add_argument('--alg', dest='algs', action='append', type=str, nargs='+', default=['cubic']) parser.add_argument('--num-flows', dest='flows', action='append', type=int, required=True) p...
null
scripts/run-fidelity-combinations.py
run-fidelity-combinations.py
py
2,310
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 5, "usage_type": "call" }, { "api_name": "sh.run", "line_number": 20, "usage_type": "call" }, { "api_name": "sh.run", "line_number": 40, "usage_type": "call" }, { "api_name": "itertools.product", "line_nu...
305073786
from doublex import Spy from hamcrest import assert_that, has_entries, has_entry, contains_string, is_not from boscli import basic_types from boscli import interpreter as interpreter_module from boscli.command import Command with describe('Help'): with before.each: self.interpreter = interpreter_module.I...
null
spec/help_spec.py
help_spec.py
py
3,259
python
en
code
null
code-starcoder2
66
[ { "api_name": "boscli.interpreter.Interpreter", "line_number": 11, "usage_type": "call" }, { "api_name": "boscli.interpreter", "line_number": 11, "usage_type": "name" }, { "api_name": "doublex.Spy", "line_number": 12, "usage_type": "call" }, { "api_name": "boscli....
287430215
from collections import OrderedDict from cratis.features import Feature, require from cratis.settings import feature from cratis_assets.features import Assets, InclusionTemplate from cratis_jslibs.features import Jquery, Fancybox, FroalaEditor from django.conf.urls import url from cratis_i18n.features import I18n @...
null
cratis_angular/features.py
features.py
py
6,766
python
en
code
null
code-starcoder2
66
[ { "api_name": "cratis.features.Feature", "line_number": 17, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 23, "usage_type": "call" }, { "api_name": "cratis.settings.feature", "line_number": 36, "usage_type": "call" }, { "api_name"...
232051066
from gensim.models import Word2Vec import numpy as np # This feature based on the word2vec class Word2VecFeature: def __init__(self, tokens): self.w2v = Word2Vec(tokens) def _make_feature_vec(self, words, model, num_features): feature_vec = np.zeros((num_features,), dtype="float32") ...
null
Word2VecFeature.py
Word2VecFeature.py
py
1,013
python
en
code
null
code-starcoder2
66
[ { "api_name": "gensim.models.Word2Vec", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.add", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.divide", "line_...
579286383
import os import re from datetime import datetime from collections import Counter import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web tornado_log = 'tornado.log' date_ms_regex = re.compile('.*(\d{6} \d{2}:\d{2}:\d{2}).* (\S+)ms.*') url_regex = re.compile('.* (/\S*) .*') def log_...
null
main.py
main.py
py
2,086
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.compile", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 13, "usage_type": "call" }, { "api_name": "tornado.httpserver.web", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tornado.httpserver"...
274379245
from django.conf import settings from django.utils.decorators import method_decorator # from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin # from django.core.exceptions import ObjectDoesNotExist from django.shortc...
null
core/views.py
views.py
py
4,169
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.ListView", "line_number": 22, "usage_type": "name" }, { "api_name": "djstripe.models.Product", "line_number": 23, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 28, "usage_type": "name" }, { ...
463092206
#!/usr/bin/python #coding=utf8 import datetime import goodstock import stockdetaillocal import calcvalue import csv #http://quotes.money.163.com/service/chddata.html?code=1399300&start=20100101&end=20160329&fields=TOPEN;HIGH;LOW;TCLOSE; #http://quotes.money.163.com/service/chddata.html?code=1399001&start=20100101&end=...
null
iwencai.py
iwencai.py
py
3,495
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date.today", "line_number": 16, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 16, "usage_type": "attribute" }, { "api_name": "csv.DictReader", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.dateti...
449812906
from django.db import migrations import xml.etree.ElementTree as ET def add_country(apps, schema_editor): Country = apps.get_model("soccer", "Country") tree = ET.parse('soccer/migrations/countries.xml') root = tree.getroot() for country in root.findall('country'): name = country.find('name')....
null
soccer/migrations/0002_add_countries.py
0002_add_countries.py
py
1,344
python
en
code
null
code-starcoder2
66
[ { "api_name": "xml.etree.ElementTree.parse", "line_number": 7, "usage_type": "call" }, { "api_name": "xml.etree.ElementTree", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.Migration", "line_number": 33, "usage_type": "attribute" }, { ...
294145458
from django.contrib import admin from django.urls import path, include from . import views urlpatterns = [ path('admin/', admin.site.urls), path('', views.returnToHomeView.as_view()), path('booksystem/', include('booksystem.urls')), path('home/', include('home.urls')), path('accounts/', include('ac...
null
onlinesystem/onlinesystem/urls.py
urls.py
py
389
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "dja...
470826291
import os import secrets from PIL import Image from flask import render_template, url_for, flash, redirect, request, abort from flask_login import login_user, current_user, logout_user, login_required from . import app, db, bcrypt from .models import User, Post from .forms import RegistrationForm, LoginForm, AccountUp...
null
Flask_Blog/flaskblog/routes.py
routes.py
py
8,209
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Post.query.all", "line_number": 59, "usage_type": "call" }, { "api_name": "models.Post.query", "line_number": 59, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 59, "usage_type": "name" }, { "api_name": "flask.render...
531533848
import time import unittest import requests from interface.K12edu.common.assert_msg import assert_res from interface.K12edu.common.save_draft import save_draft_for_works from interface.K12edu.common.parameter_for_others import ParameterForOthers from interface.K12edu.common.picture_list_code import turtle_code clas...
null
interface/K12edu/testcase/works_controller.py
works_controller.py
py
7,775
python
en
code
null
code-starcoder2
66
[ { "api_name": "unittest.TestCase", "line_number": 12, "usage_type": "attribute" }, { "api_name": "interface.K12edu.common.parameter_for_others.ParameterForOthers", "line_number": 16, "usage_type": "call" }, { "api_name": "interface.K12edu.common.parameter_for_others.ParameterForO...
25718038
import numpy as np import pandas as pd from sklearn.preprocessing import LabelEncoder import time import datetime import gc from sklearn.model_selection import KFold, cross_val_score, train_test_split from sklearn.model_selection import StratifiedKFold from sklearn.metrics import roc_auc_score, log_loss import lightgbm...
null
baseline.py
baseline.py
py
5,718
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_table", "line_number": 16, "usage_type": "call" }, { "api_name": "pandas.concat", "li...
228214417
from django.urls import path from main import views urlpatterns = [ path('', views.index,name='index'), path('article/<int:pk>', views.article, name='get_article'), path('author/<int:pk>', views.author, name='author'), path('create', views.create, name='create'), path('article',views.article1,name...
null
main/urls.py
urls.py
py
333
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "main.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "main.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
188776594
""" Main Script to plot Figure 1 of the Gold paper """ import numpy as np from glob import glob import os, sys from ase.thermochemistry import HarmonicThermo, IdealGasThermo import mpmath as mp from ase.io import read from ase.db import connect import matplotlib from ase.units import kB import csv from scipy.optimize...
null
examples/main.py
main.py
py
2,726
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.system", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.subplots", "line_number": 25, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 25, "usage_type": "name" }, { "api_name": "glob.glob", ...
280507922
import sys import time import struct import subprocess import numpy as np from scipy import signal import PyQt5 from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg import pyqtgraph.ptime as ptime import cubehelix import jet import viridis import matplotlib.pyplot as plt def get_raw_data_from_file(fname,off...
null
pyqtgraph_get_phase&doppler.py
pyqtgraph_get_phase&doppler.py
py
11,681
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.check_output", "line_number": 20, "usage_type": "call" }, { "api_name": "time.time", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 73, "usage_type": "call" }, { "api_name": "numpy.pi", "line_n...
23074062
#!/usr/bin/env python #coding=utf-8 # Filename: common.py ''' 通用基础方法 @author: 15th @data: 2017.2.27 ''' import os import functools from platform import system as platformsystem _MAX_LENGTH = 80 _PLATFORM = platformsystem() # 枚举类 def enum(*sequential, **named): ''' 枚举类 ''' enums = dict(zip(sequential...
null
simpleat/core/common.py
common.py
py
2,702
python
en
code
null
code-starcoder2
66
[ { "api_name": "platform.system", "line_number": 16, "usage_type": "call" }, { "api_name": "functools.wraps", "line_number": 32, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 61, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
566209134
import matplotlib.pyplot as plt import commands import time i = 0 tempo =600 x=[] y1 = list() y2 = list() y3 = list() y4 = list() y5 = list() y6 = list() plt.ion() #Turn interactive mode on fig = plt.figure() rect = fig.patch rect.set_facecolor('#31312e') def plotaGrafico(num, x, y, color, link): ax = fig.add_...
null
ext/GraficosLinks2.py
GraficosLinks2.py
py
4,339
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 18, "usage_type": "call" }, { "api_name": "matp...
505629048
import numpy as np from sklearn.base import TransformerMixin from rpy2.robjects.packages import importr import rpy2.robjects.numpy2ri rpy2.robjects.numpy2ri.activate() msq =importr("metagenomeSeq") class CSSNormaliser(TransformerMixin): def __init__(self,log=False): """ log: boolean wh...
null
CSSNormaliser.py
CSSNormaliser.py
py
900
python
en
code
null
code-starcoder2
66
[ { "api_name": "rpy2.robjects.packages.robjects.numpy2ri.activate", "line_number": 6, "usage_type": "call" }, { "api_name": "rpy2.robjects.packages.robjects", "line_number": 6, "usage_type": "attribute" }, { "api_name": "rpy2.robjects.packages", "line_number": 6, "usage_ty...
394878039
from sklearn.linear_model import Lasso from sklearn.pipeline import make_pipeline from sklearn.compose import ColumnTransformer from sklearn.preprocessing import OneHotEncoder from server.ml_estimators import BaseMLEstimator from server.ml_data import BettingMLData from server.data_config import TEAM_NAMES CATEGORY_C...
null
backend/server/tests/fixtures/test_estimator.py
test_estimator.py
py
1,018
python
en
code
null
code-starcoder2
66
[ { "api_name": "sklearn.pipeline.make_pipeline", "line_number": 11, "usage_type": "call" }, { "api_name": "sklearn.compose.ColumnTransformer", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 16, "usage_type": "...
250752592
from django.db import connection, models from django.template.defaultfilters import slugify from django.conf import settings from django.core.exceptions import SuspiciousOperation, ValidationError from django.contrib.auth.decorators import login_required from rest_framework.decorators import api_view from rest_framewo...
null
project/feed/feed_view.py
feed_view.py
py
4,673
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.DateTimeField", "line_number": 87, "usage_type": "call" }, { "api_name": "django.db.models", "line_number": 87, "usage_type": "name" }, { "api_name": "django.core.exceptions.ValidationError", "line_number": 89, "usage_type": "name" }, {...
166779247
#!python # # The Python Imaging Library. # $Id$ # # convert image files # # History: # 0.1 96-04-20 fl Created # 0.2 96-10-04 fl Use draft mode when converting images # 0.3 96-12-30 fl Optimize output (PNG, JPEG) # 0.4 97-01-18 fl Made optimize an option (PNG, JPEG) # 0.5 98-12-30 fl Fixed...
null
Pdf_docx_pptx_xlsx_epub_png/source/Pillow-4.0.0.data/scripts/pilconvert.py
pilconvert.py
py
2,348
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.exit", "line_number": 41, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 43, "usage_type": "attribute" }, { "api_name": "getopt.getopt", "line_number": 47, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 47...
84815816
import json import requests from collections import OrderedDict import urllib.request import urllib.parse f = open('/home/ubuntu/taobao/static/asstoken.txt', 'r') asstoken=f.read() #获取asstoken f.close() #注册成功通知 template_zhucechenggong="lk0cr1UMS2S8dbQhNVjJVS7-jmmwliY2QUcNX8Oes2Y" template_tixianchenggong=...
null
static/bak_sendmessege.py
bak_sendmessege.py
py
3,600
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 50, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 50, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 82, "usage_type": "call" }, { "api_name": "json.dumps", "line_number"...
130374204
from typing import Callable import pandas as pd import pytest import requests from pybaseball.team_batting import team_batting, _FG_TEAM_BATTING_URL @pytest.fixture() def sample_html(get_data_file_contents: Callable) -> str: return get_data_file_contents('team_batting.html') @pytest.fixture() def sample_proces...
null
tests/pybaseball/test_team_batting.py
test_team_batting.py
py
982
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Callable", "line_number": 10, "usage_type": "name" }, { "api_name": "pytest.fixture", "line_number": 9, "usage_type": "call" }, { "api_name": "typing.Callable", "line_number": 15, "usage_type": "name" }, { "api_name": "pytest.fixture", "l...
315397204
#!/usr/bin/env python # coding: utf-8 # In[20]: import pandas as pd df = pd.read_csv('amc.csv',index_col=[0]) # In[21]: import plotly.express as px from plotly.subplots import make_subplots fig = px.line(df, x="Time", y="Price", title='AMC Data') fig2 = px.line(df, x="Time", y="GEX", title='AMC DATA') fig2.upd...
null
Notebook Reddit Job AMC.py
Notebook Reddit Job AMC.py
py
1,080
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "plotly.express.line", "line_number": 17, "usage_type": "call" }, { "api_name": "plotly.express", "line_number": 17, "usage_type": "name" }, { "api_name": "plotly.express.line...
436058982
import mysql.connector import requests import json import time from datetime import datetime with open('formatedAddressViacep-log.txt', 'w') as hora: hora.write('O programa iniciou as {}'.format(datetime.now().time())) hora.write('\n') hora.close() # Ready config file config = json.load(open('Connection/c...
null
Location/formatedAddressViacep.py
formatedAddressViacep.py
py
3,142
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 8, "usage_type": "name" }, { "api_name": "json.load", "line_number": 13, "usage_type": "call" }, { "api_name": "mysql.connector.conne...
587226704
import json from datetime import datetime GUESTBOOK_ENTRIES_FILE = "entries.json" entries = [] def init(): global entries global next_id try: f = open(GUESTBOOK_ENTRIES_FILE) entries = json.loads(f.read()) f.close() m = -1 for ii in entries: if int(ii['...
null
model.py
model.py
py
1,527
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "name" }, { "api_name": "json.dumps", "...
585354616
# -*- coding: utf-8 -*- """ PE_0043 Sub-string divisibility The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property. Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In thi...
null
PE_0043/PE_0043.py
PE_0043.py
py
2,486
python
en
code
null
code-starcoder2
66
[ { "api_name": "timeit.default_timer", "line_number": 33, "usage_type": "call" }, { "api_name": "itertools.permutations", "line_number": 35, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 53, "usage_type": "call" }, { "api_name": "iter...
82308530
#%% import tensorflow as tf import numpy as np import argparse import importlib from typing import Optional from deeper.utils.function_helpers.decorators import inits_args import os tf.keras.backend.set_floatx("float64") class BaseApp(): def __init__( self, module_nm:str, model_args:d...
null
cli/app.py
app.py
py
3,564
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.keras.backend.set_floatx", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.keras", "line_number": 10, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 18, "usage_type": "name" }, { "api_nam...
102087656
#!/usr/bin/env python # -*- coding:utf-8 -*- # author:HuangManyao from django.template import Library from django.shortcuts import reverse register = Library() @register.simple_tag() def add_class(field, class_str): return field.as_widget(attrs={'class': class_str}) @register.simple_tag() def my_...
null
apps/myadmin/templatetags/admin_customer_tags.py
admin_customer_tags.py
py
472
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 17, "usage_type": "call" }, { "api_name": "django.shortcuts.reverse", "line_number": 19, "usage_type": "call" } ]
524795459
from django.shortcuts import render_to_response from django.http import HttpResponse from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.core import serializers from django.utils import simplejson from django.contrib.auth.decorators import login_required import courses...
null
mysite/mainapp/views.py
views.py
py
5,604
python
en
code
null
code-starcoder2
66
[ { "api_name": "dnd.DNDSession", "line_number": 24, "usage_type": "call" }, { "api_name": "mysite.mainapp.models.StudentAvailability.objects.filter", "line_number": 32, "usage_type": "call" }, { "api_name": "mysite.mainapp.models.StudentAvailability.objects", "line_number": 32...
245946852
import json import requests # disable https warning from python # source: https://stackoverflow.com/questions/27981545/suppress-insecurerequestwarning-unverified-https-request-is-being-made-in-pytho from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(Inse...
null
thingworx_analytics_scripts/predictAnalyticsModel.py
predictAnalyticsModel.py
py
2,204
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.packages.urllib3.disable_warnings", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.packages.urllib3.exceptions.InsecureRequestWarning", "line_number": 8, "usage_type": "argument" }, { "api_name": "requests.packages", "line_number": 8...
435319541
# -*- coding: utf-8 -*- import json from django.http import HttpResponse, HttpResponseRedirect, Http404 # decorator from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods from arclib.django.object import ArcReturnJSONObject from stats.models import SearchK...
null
stats/apis.py
apis.py
py
1,419
python
en
code
null
code-starcoder2
66
[ { "api_name": "stats.models.SearchKeyword", "line_number": 24, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 30, "usage_type": "call" }, { "api_name": "django...
407460224
import numpy as np from typing import Tuple, Union def pixel2meter(coordinates: np.ndarray, dimension: np.ndarray, resolution: float) \ -> Tuple[Union[int, float, np.ndarray], Union[int, float, np.ndarray]]: """ transforms the pixel coordinate of a map image to the corresponding metric dimensions ...
null
menge_card_loader/src/MengeMapParser/ParserUtils/coordinate_transform.py
coordinate_transform.py
py
2,022
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.ndarray", "line_number": 5, "usage_type": "attribute" }, { "api_name": "typing.Tuple", "line_number": 6, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 6, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_n...
439100304
import argparse import re import tensorflow as tf import keras.backend.tensorflow_backend as KTF from keras.utils.generic_utils import get_custom_objects from keras import backend as K from keras.utils import to_categorical from keras.models import Sequential from keras.layers import Bidirectional, RNN, LSTM, GRU,...
null
hw4/text_sentiment_classification-rnn.py
text_sentiment_classification-rnn.py
py
12,412
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.ConfigProto", "line_number": 45, "usage_type": "call" }, { "api_name": "tensorflow.Session", "line_number": 47, "usage_type": "call" }, { "api_name": "keras.backend.tensorflow_backend.set_session", "line_number": 48, "usage_type": "call" }, {...
445851669
""" Module contains singleton instance QApplication """ import logging import sys from PyQt5.QtNetwork import QLocalSocket, QLocalServer from PyQt5.QtWidgets import QApplication log = logging.getLogger(__file__) __all__ = ["SingleInstanceApplication"] class SingleInstanceApplication(QApplication): """ Cus...
null
vid2audio/qt/singleinstanceapplication.py
singleinstanceapplication.py
py
1,947
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 16, "usage_type": "name" }, { "api_name": "PyQt5.QtNetwork.QLocalServer", "line_number": 26, "usage_type": "name" }, { "api_n...
464141740
from collections import deque N = int(input()) INF = 10**12 # tree = [[INF for _ in range(N)]for __ in range(N)] tree = [[]for __ in range(N)] for i in range(N-1): u, v, w = [int(n) for n in input().split()] u -= 1 v -= 1 tree[u].append((v, w)) tree[v].append((u, w)) color = [INF for __ in range(N...
null
problems/Beginner/D/126.py
126.py
py
913
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 19, "usage_type": "call" } ]
185841831
from io import BytesIO import time from django.shortcuts import render, HttpResponse, redirect from django.urls import reverse from django.views.generic import View from django.http import Http404 from django.db.models import Q from utils.check_code import create_validate_code from .models import UserProfile, UserFollo...
null
user/views.py
views.py
py
6,127
python
en
code
null
code-starcoder2
66
[ { "api_name": "io.BytesIO", "line_number": 21, "usage_type": "call" }, { "api_name": "utils.check_code.create_validate_code", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.HttpResponse", "line_number": 25, "usage_type": "call" }, { "ap...
314974456
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : 01-QT # @Time : 2018/5/26 0:45 # @Author : QinZai # @File : form.py # @Software: PyCharm import sys from PyQt5 import uic, QtCore, QtWidgets from PyQt5.QtWidgets import QWidget, QPushButton, QApplication,QMessageBox from PyQt5.QtCore import...
null
01-QT/01-Dome/form.py
form.py
py
1,111
python
en
code
null
code-starcoder2
66
[ { "api_name": "PyQt5.uic.loadUiType", "line_number": 17, "usage_type": "call" }, { "api_name": "PyQt5.uic", "line_number": 17, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QMainWindow", "line_number": 20, "usage_type": "attribute" }, { "api_name": "PyQt5...
62990141
# coding: utf-8 # In[2]: import os database_path=r'C:\Users\nhurst\Desktop\dataset' source = os.path.join(database_path,'PASCAL_format') destiny = os.path.join(database_path,r'PASCAL_format\Empty') #source = r'C:\Users\langh\Dropbox\MCC-I Masters\Thesis\A6\dataset\PASCAL_format' #destiny = r'C:\Use...
null
1. Satellite/Scripts/3. jittering/4. MoveEmpty.py
4. MoveEmpty.py
py
2,457
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 1...
34414577
from django.conf.urls import url from django.views.generic import ListView from .views import (add_material, MaterialDetailView, MaterialDeleteView, add_image, delete_image, add_video, delete_video, add_document, delete_document, delete_link, add_link, add_gat...
null
thinktank/materials/urls.py
urls.py
py
1,496
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "views.material_view", "line_number": 11, "usage_type": "argument" }, { "api_name": "django.conf.urls.url", "line_number": 12, "usage_type": "call" }, { "api_name": "vie...
588273290
# -*- coding: utf-8 -*- from odoo import api, fields, models, tools, _ from odoo.exceptions import ValidationError from datetime import date, datetime, timedelta class formacion(models.Model): """ Modelo de Formacion """ _name = 'formacion' #_rec_name = 'id_cliente' #_description = 'Cartera de...
null
models/formacion.py
formacion.py
py
1,953
python
en
code
null
code-starcoder2
66
[ { "api_name": "odoo.models.Model", "line_number": 9, "usage_type": "attribute" }, { "api_name": "odoo.models", "line_number": 9, "usage_type": "name" }, { "api_name": "odoo.fields.Char", "line_number": 16, "usage_type": "call" }, { "api_name": "odoo.fields", "...
646731179
from bs4 import BeautifulSoup import requests import feedparser import os import random import requests_random_user_agent websites = [] from_one_ip = 10 forbidden = "/.:?.,=+& " parse_dict = {'bbc':{'header':{'tag': "h1", 'class':"story-body__h1"}, 'paragraph':{'tag':"div", 'class':"story-body__inner"}...
null
stonks/scripts/parser_proxy_rss/quick_parse.py
quick_parse.py
py
7,546
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.listdir", "line_number": 28, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 33, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 34, "usage_type": "call" }, { "api_name": "feedparser.parse", "lin...
450958488
import matplotlib.pyplot as plt import numpy as np import os def plot(dictionary, folder, title="Plot"): percentages = {1: [], 2: [], 5: [], 10: []} # Hyper parameter for plotting (How many episodes to average over per scatter): interval = 100 for k in dictionary.keys(): for episode in range(0, len(dictionary...
null
ntm/utils/scatterplot.py
scatterplot.py
py
1,358
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.figure", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 23, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylim", "line_number": 24, "usage_type": "call" }, { "api_name": "mat...
102734553
import apache_beam as beam from apache_beam.options.pipeline_options import PipelineOptions from beam_nuggets.io import relational_db with beam.Pipeline(options=PipelineOptions()) as p: months = p | "Reading month records" >> beam.Create([ {'name': 'Jan', 'num': 1}, {'name': 'Feb', 'num': 2}...
null
Apache Beam Postgres/Apache Beam Postgres-Write data.py
Apache Beam Postgres-Write data.py
py
854
python
en
code
null
code-starcoder2
66
[ { "api_name": "apache_beam.Pipeline", "line_number": 5, "usage_type": "call" }, { "api_name": "apache_beam.options.pipeline_options.PipelineOptions", "line_number": 5, "usage_type": "call" }, { "api_name": "apache_beam.Create", "line_number": 6, "usage_type": "call" }, ...
86718714
import numpy as np import cv2 from collections import namedtuple def ordered_points(points): """ Orders points for a rectangle :param points: array with four 2d points :return: named tuple assigning points to corners """ points = np.squeeze(points) s = points.sum(axis=1) top_left = po...
null
vision_util.py
vision_util.py
py
1,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.squeeze", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.argmin", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.argmax", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.diff", "line_number...
117326648
from django.urls import path from rest_framework.urlpatterns import format_suffix_patterns from . import views urlpatterns = [ path('users/', views.UserList.as_view()), path('users/<int:pk>/', views.UserDetail.as_view()), path('posts/', views.PostList.as_view()), path('posts/<int:pk>/', views.PostDeta...
null
api/urls.py
urls.py
py
498
python
en
code
null
code-starcoder2
66
[ { "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", ...
191238987
import matplotlib.pylab as plt def plot_pie(map): labels = [] sizes = [] for x in map: labels.append(x) sizes.append(map[x]) # labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' # sizes = [15, 30, 45, 10] # explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') fig1, ...
null
plotplay/plot_pie.py
plot_pie.py
py
532
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pylab.subplots", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pylab", "line_number": 13, "usage_type": "name" }, { "api_name": "matplotlib.pylab.show", "line_number": 18, "usage_type": "call" }, { "api_name": "matp...
230950694
from django.shortcuts import render from django.urls import reverse_lazy # Create your views here. from django.views.generic import ListView,DetailView,UpdateView,DeleteView,CreateView from . import models from django.contrib.auth.mixins import LoginRequiredMixin from .models import Comment class ArticleListView(ListV...
null
articles/views.py
views.py
py
1,162
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.views.generic.ListView", "line_number": 9, "usage_type": "name" }, { "api_name": "models.Article", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 13, "usage_type": "name" ...
394046209
import concurrent.futures import datetime import json import logging import queue import random import socket import time import elasticsearch import thespian.actors from esrally import exceptions, metrics, track, client, PROGRAM_NAME from esrally.utils import convert, console, io logger = logging.getLogger("rally.dr...
null
esrally/driver.py
driver.py
py
47,478
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 15, "usage_type": "call" }, { "api_name": "esrally.track", "line_number": 35, "usage_type": "name" }, { "api_name": "time.perf_counter", "line_number": 83, "usage_type": "call" }, { "api_name": "esrally.metrics", ...
105598559
import rti_class_v2 as aRTIClass import mabd_class_v1 as anMABDClass import accuracy_class as aAccuracyClass import sys import numpy as np import matplotlib.pyplot as plt import matplotlib import time ######################## # Import data ######################## # True Crossing Data - holds the time and state of th...
null
run_rti_v2_for_xing_times_v2.py
run_rti_v2_for_xing_times_v2.py
py
2,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "mabd_class_v1.myMABDClass", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 47, "usage_type": "call" }, { "api_name": "rti_class_v2.myRTIClass", "line_number": 49, "usage_type": "call" }, { "api_name": "accur...
90215126
# creation date: Feb 20 2020 # author: group 5 # contents of the file: test code for BlueTooth connection import bluetooth import TestLED server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM) port = 1 server_sock.bind(("",port)) server_sock.listen(1) client_sock,address = server_sock.accept() print ("Accepted con...
null
SmartLamp/ECE492_Group5_codes/Test/TestBT.py
TestBT.py
py
999
python
en
code
null
code-starcoder2
66
[ { "api_name": "bluetooth.BluetoothSocket", "line_number": 8, "usage_type": "call" }, { "api_name": "bluetooth.RFCOMM", "line_number": 8, "usage_type": "attribute" }, { "api_name": "TestLED.Color", "line_number": 18, "usage_type": "call" }, { "api_name": "TestLED.L...
331336962
import time from games.base_classes import MuZeroConfigBase from threading import Thread from torch.utils.tensorboard import SummaryWriter import numpy import torch import models class Trainer: """ Class which run in a dedicated thread to train a neural network and save it in the shared storage. """ ...
null
trainer.py
trainer.py
py
6,129
python
en
code
null
code-starcoder2
66
[ { "api_name": "games.base_classes.MuZeroConfigBase", "line_number": 18, "usage_type": "name" }, { "api_name": "torch.utils.tensorboard.SummaryWriter", "line_number": 20, "usage_type": "call" }, { "api_name": "models.MuZeroNetwork", "line_number": 23, "usage_type": "call" ...
228960885
#!/usr/bin/env python from flask import render_template, redirect, request, Flask, url_for, abort, send_from_directory from flask_wtf import FlaskForm, csrf from wtforms import StringField, FieldList, FormField, SubmitField, IntegerField, FloatField, validators, BooleanField import yaml, sys, binascii, os from server_...
null
MASS-webserver.py
MASS-webserver.py
py
10,329
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_wtf.csrf.CSRFProtect", "line_number": 11, "usage_type": "call" }, { "api_name": "flask_wtf.csrf", "line_number": 11, "usage_type": "name" }, { "api_name": "os.urandom", ...
586374127
from flask import jsonify from server.controllers.controller_interface import ControllerInterface class GateController(ControllerInterface): """Initialize flask routes for the force commands and gate status update.""" def __init__(self, state_machine): self.state_machine = state_machine def add_r...
null
server/controllers/gate_controller.py
gate_controller.py
py
1,723
python
en
code
null
code-starcoder2
66
[ { "api_name": "server.controllers.controller_interface.ControllerInterface", "line_number": 5, "usage_type": "name" }, { "api_name": "flask.jsonify", "line_number": 20, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 27, "usage_type": "call" }, {...
644791466
''' Created on Jan 7, 2016 @author: SG0946321 ''' import requests from com.sabre.api.sacs.rest.TokenHolder import TokenHolder class BaseRestGetCall: def __init__(self, url, requestObject): self.requestObject = requestObject self.url = url self.tokenHolder = TokenHolder() ...
null
SACS-Python-master/com/sabre/api/sacs/rest/BaseRestCall.py
BaseRestCall.py
py
1,666
python
en
code
null
code-starcoder2
66
[ { "api_name": "com.sabre.api.sacs.rest.TokenHolder.TokenHolder", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "com.sabre.api.sacs.rest.TokenHolder.TokenHolder", "line_number": 29, "usage_...
259634836
"""MySite101 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-bas...
null
Django/MySite101/MySite101/urls.py
urls.py
py
1,423
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 23, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 24, "usage_type": "call" }, { "api_name": "django.urls.include", "line_number": 24, "usage_type": "call" }, { "api_name": "django.urls.pat...
150061663
from scrapy.selector import Selector from scrapy.http import Request from vtvspider_dev import VTVSpider, get_nodes, extract_data, extract_list_data from scrapy_spiders_dev.items import SportsSetupItem import re import datetime TEAM_LIST = ('NE', 'BAL', 'CIN', 'CLE', 'CHI', 'DET', 'GB', 'MIN', 'HOU', 'IND...
null
SPORTS/sports_spiders/scripts/dev_scripts5/nfl_roster.py
nfl_roster.py
py
5,346
python
en
code
null
code-starcoder2
66
[ { "api_name": "vtvspider_dev.VTVSpider", "line_number": 48, "usage_type": "name" }, { "api_name": "scrapy.http.Request", "line_number": 57, "usage_type": "call" }, { "api_name": "scrapy.selector.Selector", "line_number": 61, "usage_type": "call" }, { "api_name": "...
584643666
""" Usage: run(<json file>) --> result """ import numpy as np import sklearn, json, pickle from sklearn.neural_network import BernoulliRBM from sklearn.pipeline import Pipeline from sklearn import svm, cross_validation def run(file): #Parse json file with open(file) as data_file: ...
null
Hotels.py
Hotels.py
py
1,032
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 17, "usage_type": "call" }, { "api_name": "sklearn.neural_network.BernoulliRBM", "line_number": 27, "usage_type": "call" }, { "api_name": "sklearn.svm.SVC", "line_number": 28, "usage_type": "call" }, { "api_name": "sklearn...
556823069
### -*- coding: utf-8 -*- ############################################# # Разработано компанией Ключевые Решения (http://keysolutions.ru/) # Все права защищены, 2006-2007 # # Developed by Key Solutions (http://keysolutions.ru/) # All right reserved, 2...
null
interfaceswitcher/trunk/browser/viewadapter.py
viewadapter.py
py
2,127
python
en
code
null
code-starcoder2
66
[ { "api_name": "zope.proxy.getProxiedObject", "line_number": 37, "usage_type": "call" }, { "api_name": "interfaceswitcher.interfaceswitchervocabulary.interfaceswitchervocabulary.interfaceSwitcherVocabulary", "line_number": 38, "usage_type": "call" }, { "api_name": "zope.interface....
49293977
#!/usr/bin/env python # coding: utf-8 # produces: wants.tsv -> wants.tm from common import \ remove_bad_symbols, \ read_games, \ WANTS_FILE, \ WANTS_TM_FILE, \ WANTS_OPTIONS def main(): games = read_games() prepare_wants(games) def remove_symbols(string: str) -> str: return remove_b...
null
prepare_wants.py
prepare_wants.py
py
977
python
en
code
null
code-starcoder2
66
[ { "api_name": "common.read_games", "line_number": 14, "usage_type": "call" }, { "api_name": "common.remove_bad_symbols", "line_number": 19, "usage_type": "call" }, { "api_name": "common.WANTS_FILE", "line_number": 23, "usage_type": "argument" }, { "api_name": "com...
94095744
#!/usr/bin/env python3 import os, sys import asyncio import random import discord from discord.ext import commands # This file will have the discord bot functions. Look at discord.py documentation # Currently absolutely barebones functionality dirname, pyfilename = os.path.split(os.path.abspath(sys.argv[0])) tfilen...
null
discord_twitcher.py
discord_twitcher.py
py
2,721
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.split", "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": "sys.argv", "line_numbe...
243848257
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import annotations from enum import Enum, auto from os import linesep from typing import List, Union class IndentType(Enum): SPACES = auto() TABS = auto() class StringBuilder: indent_tab: str = "\t" new_line: str = "\n" default_in...
null
scriptgen/core/_string_builder.py
_string_builder.py
py
4,805
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "enum.auto", "line_number": 11, "usage_type": "call" }, { "api_name": "enum.auto", "line_number": 12, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 40, ...
168565422
#!/usr/bin/env python # -*- encoding:utf-8 -*- # Author: colin # Email: colin3310@sina.com # Create Date: 2014-12-31 from bson import ObjectId,DBRef from framework.data import metadb as mdb from framework.data import db def get_list(context): condition = dict() parentid = "" if "condition" in context._...
null
core/platform/rulelogics/object.py
object.py
py
13,613
python
en
code
null
code-starcoder2
66
[ { "api_name": "framework.data.db", "line_number": 39, "usage_type": "name" }, { "api_name": "bson.ObjectId", "line_number": 63, "usage_type": "call" }, { "api_name": "framework.data.db", "line_number": 77, "usage_type": "name" }, { "api_name": "framework.data.meta...
244711036
from django.shortcuts import render from django.http import JsonResponse import pandas as pd from .models import PredResults def predict(request): return render(request, 'predict.html') def predict_chances(request): if request.POST.get('action') == 'post': #Receiving data from client sepal...
null
predict/views.py
views.py
py
1,609
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 7, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 23, "usage_type": "call" }, { "api_name": "models.PredResults.objects.create", "line_number": 32, "usage_type": "call" }, { "api_n...
146084955
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
null
models/official/detection/modeling/maskrcnn_model.py
maskrcnn_model.py
py
9,351
python
en
code
null
code-starcoder2
66
[ { "api_name": "modeling.base_model.Model", "line_number": 34, "usage_type": "attribute" }, { "api_name": "modeling.base_model", "line_number": 34, "usage_type": "name" }, { "api_name": "modeling.architecture.factory.backbone_generator", "line_number": 43, "usage_type": "c...
246215113
from plone.formwidget.namedfile import utils from plone.formwidget.namedfile.interfaces import INamedFileWidget from plone.formwidget.namedfile.interfaces import INamedImageWidget from plone.namedfile.file import NamedFile from plone.namedfile.file import NamedImage from plone.namedfile.interfaces import INamed from pl...
null
plone/formwidget/namedfile/converter.py
converter.py
py
3,820
python
en
code
null
code-starcoder2
66
[ { "api_name": "z3c.form.converter.BaseDataConverter", "line_number": 19, "usage_type": "name" }, { "api_name": "zope.component.adapts", "line_number": 22, "usage_type": "call" }, { "api_name": "plone.namedfile.interfaces.INamedField", "line_number": 22, "usage_type": "arg...
99788310
# -*-coding:utf-8 -*- """ @author : sc @Function : 爬虫——爬取爱爱医医疗网站文章链接 """ from bs4 import BeautifulSoup import requests import random import sys #reload(sys) import importlib,sys import os importlib.reload(sys) headers_pool = [{'User-Agent':'Mozilla/5.0 (Windows NT 6.2) \ AppleWebKit/536.3 (KHTML, l...
null
git/爬虫/爬虫/爱爱医/main.py
main.py
py
1,770
python
en
code
null
code-starcoder2
66
[ { "api_name": "importlib.reload", "line_number": 14, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 23, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 26, "usage_type": "call" }, { "api_name": "requests.get", "line_numbe...
13717683
from jinja2 import Environment, FileSystemLoader import os.path import time def log(*args, **kwargs): # time.time() 返回 unix time # 如何把 unix time 转换为普通人类可以看懂的格式呢? format = '%Y-%m-%d %H:%M:%S -----' # 最常用的时间格式 value = time.localtime(int(time.time())) dt = time.strftime(format, value) print(dt, ...
null
day022/utils.py
utils.py
py
1,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.localtime", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 9, "usage_type": "call" }, { "api_name": "time.strftime", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path.path.dirname", "line...
430619824
#!/usr/bin/python import argparse import csv import json import logging import pybluecat from ipaddress import ip_address, ip_network from sys import exit def print_ip_info(ip_obj, network): print('Hostname : {}'.format(ip_obj['name'])) print('MAC Address: {}'.format(ip_obj['properties']['macAddress'])) ...
null
pybluecat/tools/rundeck_dhcp_bulk_request.py
rundeck_dhcp_bulk_request.py
py
12,807
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.debug", "line_number": 35, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 35, "usage_type": "call" }, { "api_name": "pybluecat.entity_to_json", "line_number": 37, "usage_type": "call" }, { "api_name": "json.dumps", "l...
436724671
import functions as f import sys import os import cv2 import argparse import csv from tqdm import tqdm from classify import KanaClassifier import classifyThree def main(): ap = argparse.ArgumentParser() ap.add_argument('-m', '--model', required=True, help='path to trained model') ap.add_argument('-l', '--l...
null
predictTestData.py
predictTestData.py
py
2,471
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 12, "usage_type": "call" }, { "api_name": "classify.KanaClassifier", "line_number": 21, "usage_type": "call" }, { "api_name": "classifyThree.strategy_max_each", "line_number": 23, "usage_type": "attribute" }, { ...
310324560
from dataclasses import dataclass from unittest import mock import pytest from app.modules.shared_kernel.message_bus import BaseEvent, MessageBus @dataclass(frozen=True) class SomeEvent(BaseEvent): message: str @dataclass(frozen=True) class SomeOtherEvent(BaseEvent): id: int @pytest.fixture() def bus() ...
null
app/modules/shared_kernel/message_bus_test.py
message_bus_test.py
py
1,878
python
en
code
null
code-starcoder2
66
[ { "api_name": "app.modules.shared_kernel.message_bus.BaseEvent", "line_number": 10, "usage_type": "name" }, { "api_name": "dataclasses.dataclass", "line_number": 9, "usage_type": "call" }, { "api_name": "app.modules.shared_kernel.message_bus.BaseEvent", "line_number": 15, ...
557033392
from pymatgen.io.vasp.inputs import Poscar from pymatgen.io.vasp.outputs import Vasprun from subprocess import call import numpy as np from flare.struc import Structure from typing import List, Union from json import dump, load from flare.util import NumpyEncoder import os, shutil def check_vasprun(vasprun: Union[str,...
null
flare/dft_interface/vasp_util.py
vasp_util.py
py
4,370
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "pymatgen.io.vasp.outputs.Vasprun", "line_number": 11, "usage_type": "name" }, { "api_name": "pymatgen.io.vasp.outputs.Vasprun", "line_number": 18, "usage_type": "call" }, { "ap...
477632669
# -*- encoding:utf-8 -*- import os from io import open from setuptools import setup from light_progress import __version__ document_file = os.path.join(os.path.dirname(__file__), 'README.rst') with open(document_file, 'r', encoding='utf-8_sig') as f: long_description = f.read() setup( name='light-progress...
null
pypi_install_script/light-progress-0.2.1.1.tar/setup.py
setup.py
py
825
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 10, "usage_type": "call" }, { "api_name": "io.open", "line_number"...
229149688
from flask import Flask from flask import render_template from flask import request import pymysql import json from django.shortcuts import render_to_response import os os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' DB_HOST = '127.0.0.1' DB_PORT = 3306 DB_USER = 'root' DB_PWD = '' DB_NAME = 'msystem' DB_CHARS...
null
TEST/flask/search.py
search.py
py
1,531
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.request.args.g...
132629415
from django.contrib.staticfiles.storage import staticfiles_storage from django.urls import path from adventureProjectSia.advanture_app import views from adventureProjectSia.advanture_app.views import article_details_or_comment, unauthorised_message, \ delete_article, like_article, news_and_events urlpatterns = [ ...
null
adventureForInspiration/adventureProjectSia/advanture_app/urls.py
urls.py
py
956
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "adventureProjectSia.advanture_app.views.HomeView.as_view", "line_number": 9, "usage_type": "call" }, { "api_name": "adventureProjectSia.advanture_app.views.HomeView", "line_number": 9, ...
234541958
import zipfile import shutil import os from contextlib import closing #returns a string of xml or an empty string if error def get_xml(fname): zf = zipfile.ZipFile(fname) try: #get document xml from docx return zf.read('word/document.xml') except: return "" def create_xml_file(...
null
docHandler.py
docHandler.py
py
1,219
python
en
code
null
code-starcoder2
66
[ { "api_name": "zipfile.ZipFile", "line_number": 9, "usage_type": "call" }, { "api_name": "zipfile.ZipFile", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 37, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
584255805
import logging import time from AndroidRunner.Device import Device logger = logging.getLogger(__name__) def tap(device: Device, x: int, y: int, sleep = 4): device.shell("input tap %s %s" % (x, y)) # somehow stops after this... time.sleep(sleep) def write_text(device: Device, text: str, sleep = 1): device...
null
experiments/scripts/interaction_web_7pro.py
interaction_web_7pro.py
py
5,983
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" }, { "api_name": "AndroidRunner.Device.Device", "line_number": 7, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 9, "usage_type": "call" }, { "api_name": "AndroidRunner.D...
543465509
# -*- coding: utf-8 -*- """ Created on Mon Mar 17 13:26:49 2014 @author: Sayzar """ from scipy.stats import norm import random def normalDisPrior(fileName, avgBurstTime, procNumber, priorNum): normalDisList = norm.rvs(avgBurstTime, avgBurstTime/6 , procNumber) priorList = norm.rvs(priorNum, 9/6, procNumber) ...
null
CPUSchedulingSimulator/processScript.py
processScript.py
py
854
python
en
code
null
code-starcoder2
66
[ { "api_name": "scipy.stats.norm.rvs", "line_number": 12, "usage_type": "call" }, { "api_name": "scipy.stats.norm", "line_number": 12, "usage_type": "name" }, { "api_name": "scipy.stats.norm.rvs", "line_number": 13, "usage_type": "call" }, { "api_name": "scipy.stat...
416185083
from django.conf.urls import patterns, include, url from django.contrib import admin INTERNAL = 1 EXTERNAL = 2 APPLICATION = 3 CALL_TYPE = {(INTERNAL,'Internal'),(EXTERNAL,'External'),} handler404 = 'Users.views.home.home.error404' handler500 = 'Users.views.home.home.error500' urlpatterns = patterns('', # Examples...
null
ProfBrew/urls.py
urls.py
py
2,558
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.patterns", "line_number": 10, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 14, "usage_type": "call" }, { "api_name"...
102473656
from instence import Instence from torch.utils.data import DataLoader from tqdm import tqdm import torch class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum =...
null
Src/train.py
train.py
py
3,324
python
en
code
null
code-starcoder2
66
[ { "api_name": "instence.Instence", "line_number": 25, "usage_type": "call" }, { "api_name": "instence.Instence", "line_number": 28, "usage_type": "call" }, { "api_name": "torch.utils.data.DataLoader", "line_number": 40, "usage_type": "call" }, { "api_name": "torch...
65394912
""" Upload blueprints: Create the blueprints for the upload route. """ import os, logging from airflow.www.app import csrf from flask import Blueprint, jsonify, request from flask_admin import BaseView, expose from flask_login import login_required from airflow.www import utils as wwwutils from PySmile_airflow.utils im...
null
airflow-schneider-plugin/plugins/blueprints/bp_upload.py
bp_upload.py
py
1,440
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Blueprint", "line_number": 14, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 28, "usage_type": "attribute" }, { "api_name": "flask.request", "line_number": 28, "usage_type": "name" }, { "api_name": "flask.request...
159842387
import boto3, time ssm = boto3.client('ssm') #i-070972dd8eafb4cf1 def getSSMCommandResults(cmd_id,instanceId): resultList = [] kwargs = {"CommandId":cmd_id,"InstanceId":instanceId} result = ssm.get_command_invocation(**kwargs)['StandardOutputContent'] resultList = result.split('\n') ...
null
stepFunctionSandbox/func2.py
func2.py
py
1,824
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.client", "line_number": 3, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" } ]
353106749
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
null
benchmark/torch/ES/actor.py
actor.py
py
4,474
python
en
code
null
code-starcoder2
66
[ { "api_name": "parl.env.compat_wrappers.CompatWrapper", "line_number": 31, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 31, "usage_type": "call" }, { "api_name": "obs_filter.MeanStdFilter", "line_number": 35, "usage_type": "call" }, { "api_name...
90296237
import os import sys import json import yaml import re import string from platform import uname from rich.console import Console import subprocess from dotenv import find_dotenv from typing import Dict, Union from collections import OrderedDict from doing.exceptions import ConfigurationError, devops_error_tips from r...
null
src/doing/utils.py
utils.py
py
7,160
python
en
code
null
code-starcoder2
66
[ { "api_name": "rich.traceback.install", "line_number": 18, "usage_type": "call" }, { "api_name": "rich.console.Console", "line_number": 19, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 26, "usage_type": "call" }, { "api_name": "re.escape", "l...
497073477
import json import numpy as np import models import utils import pyndri import collections from scipy.sparse import lil_matrix def plm(index, word_prior, best_doc_indices, query_word_ids, k, mu): scores_per_doc = {} for doc_id in best_doc_indices: # doc_id is shifted to the right in tf matrix (1 -> 0) ...
null
Assignment_2/plm.py
plm.py
py
4,675
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.where", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.apply_along_axis", "lin...
137714711
import numpy as np import scipy.stats import matplotlib.pyplot as plt import seaborn as sns rc={'lines.linewidth' : 2, 'axes.labelsize': 18, 'axes.titlesize': 18} sns.set(rc=rc) #We load data that will use numpy with np.loadtxt (there is another type for csvs) data_txt= np.loadtxt('data/collins_switch.csv', delimi...
null
l24.py
l24.py
py
1,499
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 23, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", ...
92116985
from flask_app import app from flask import Markup, render_template, request, session, url_for, redirect, flash, Response,\ jsonify import json, csv from models.data import DataRepo # @UnresolvedImport from models import ZoneData # @UnresolvedImport @app.route("/", methods=['GET'], defaults={"template":"d...
null
controllers/site/site_main.py
site_main.py
py
2,774
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.data.DataRepo.get_any_ten_records", "line_number": 13, "usage_type": "call" }, { "api_name": "models.data.DataRepo", "line_number": 13, "usage_type": "name" }, { "api_name": "models.data.DataRepo.get_tasks_count_by_category", "line_number": 17, "usag...
577678720
from django.db import models import datetime list_types = ( ("Phone", "Phone"), ("Email", "Email"), ("Mixt", "Mixt"), ) class List(models.Model): name = models.CharField(max_length=100, default="", verbose_name='Name') date = models.DateField(auto_now=False, default=datetime.date.today) reaso...
null
app/list/models.py
models.py
py
543
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.models.Model", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 12, "usage_type": "call" }, { "api_name"...
26223650
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
null
pipeline/tests/builder/flow/test_node_output.py
test_node_output.py
py
1,442
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "pipeline.builder.flow.NodeOutput", "line_number": 21, "usage_type": "call" }, { "api_name": "pipeline.builder.flow.NodeOutput.PLAIN", "line_number": 21, "usage_type": "attribut...