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
614437593
import matplotlib.pyplot as plt import string from path import root from extraction import * import json from spacy.lang.en import STOP_WORDS import networkx as nx json_path = root + 'data/json/' """ this file is for building a dependency graph for one specific document """ def build_graph(filename, abs = 0, ccl ...
null
python2_version/src/graph.py
graph.py
py
1,713
python
en
code
null
code-starcoder2
83
[ { "api_name": "path.root", "line_number": 9, "usage_type": "name" }, { "api_name": "json.load", "line_number": 24, "usage_type": "call" }, { "api_name": "spacy.lang.en.STOP_WORDS", "line_number": 32, "usage_type": "argument" }, { "api_name": "string.punctuation", ...
469570193
#!/usr/bin/python # -*- coding: utf-8 -*- """ app.user.approve.services sxw 2016-07-21 审批管理服务层 """ from sqlalchemy import text from app.extensions import db from app.user.constant import ApproveRoleType from app.user.department.models import CmdbGroup from app.user.member.models import CmdbUser from app.us...
null
app/user/approve/services.py
services.py
py
9,037
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.extensions.db.session.execute", "line_number": 41, "usage_type": "call" }, { "api_name": "app.extensions.db.session", "line_number": 41, "usage_type": "attribute" }, { "api_name": "app.extensions.db", "line_number": 41, "usage_type": "name" }, { ...
451540761
''' Brian simulator compliant Python export for: Components: Lavrentovich2008_Ca_Oscillations_0 (Type: Lavrentovich2008_Ca_Oscillations: vin=0.05 (dimensionless) kout=0.5 (dimensionless) vM3=40.0 (dimensionless) k_CaA=0.15 (dimensionless) n=2.02 (dimensionless) k_CaI=0.15 (dimensionless) m=2.2 (dimensionless) kip...
null
Brian/BIOMD0000000184_LEMS_brian.py
BIOMD0000000184_LEMS_brian.py
py
5,909
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 23, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 94, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 109, "usage_type": "call" }, { "api_name": "matplotlib.pyplot...
89021026
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import os import socket import threading from abc import ABC, abstractmethod from dataclasses import dataclass fr...
null
torch/distributed/elastic/rendezvous/dynamic_rendezvous.py
dynamic_rendezvous.py
py
12,553
python
en
code
null
code-starcoder2
83
[ { "api_name": "dataclasses.dataclass", "line_number": 20, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 48, "usage_type": "attribute" }, { "api_name": "threading.Lock", "line_number": 52, "usage_type": "call" }, { "api_name": "socket.getfq...
275415517
""" Redis Stream作为消息队列 """ import asyncio import aioredis import logging logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" ) async def consumer(stream, _id=0, host="localhost", port=6379, db=0): logging.info(f"Consumer({_id}) starts") conn_str = f"redis://{h...
null
database/redis_stream_consumer.py
redis_stream_consumer.py
py
971
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "aioredis.create_red...
245970135
import sqlite3 conn = sqlite3.connect('users.sqlite') cursor = conn.cursor() # cursor.execute('''INSERT INTO test (id,name,days) VALUES (2,'Копировать. 😌',29);''') # conn.commit() cursor.execute('''SELECT * FROM test;''') for line in cursor.fetchall(): print(line[1]) conn.close()
null
sqlite/join/test.py
test.py
py
303
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlite3.connect", "line_number": 3, "usage_type": "call" } ]
321824584
# Tập tin này để xử lý request và trả về các response (tương tự controller trong # MVC, là thành phần Views trong MVT) import datetime import math import json from django.db.models import Count, Q, Avg from rest_framework import viewsets, generics, permissions, status from rest_framework.decorators import action from ...
null
back-end/viec_lam/viec_lam_app/views.py
views.py
py
29,692
python
en
code
null
code-starcoder2
83
[ { "api_name": "rest_framework.viewsets.ViewSet", "line_number": 27, "usage_type": "attribute" }, { "api_name": "rest_framework.viewsets", "line_number": 27, "usage_type": "name" }, { "api_name": "rest_framework.generics.CreateAPIView", "line_number": 27, "usage_type": "at...
221305323
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from kivy3 import Mesh from kivy3.loaders import OBJLoader as kv3OBJLoader from graphics.betterKv3.waveObject import WaveObject from lib.betterLogger import BetterLogger from os.path import abspath, dirname, join class OB...
null
graphics/betterKv3/objLoader.py
objLoader.py
py
3,860
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 5, "usage_type": "name" }, { "api_name": "lib.betterLogger.BetterLogger", "line_number": 18, "usage_type": "name" }, { "api_name": "kivy3.loaders.OBJLoader", "line_number": 18, "usage_type": "name" }, { "api_nam...
410818253
import numpy as np from matplotlib.pyplot import * from itertools import accumulate import time def getPrimes(upto): """ Extremely fast method for generating prime numbers up to a specific value. Args: upto - Highest prime value to generate up to. Return: A numpy a...
null
Programs/Ulam_Brandon.py
Ulam_Brandon.py
py
4,958
python
en
code
null
code-starcoder2
83
[ { "api_name": "time.time", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 52,...
338885711
from django import forms from django.contrib.auth.forms import UserCreationForm, UserChangeForm from .models import AppUser, Event class CustomUserCreationForm(UserCreationForm): class Meta(UserCreationForm): model = AppUser fields = ('username', 'email', 'full_name') class CustomUserChangeForm(...
null
event_website/event_website/forms.py
forms.py
py
1,489
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.auth.forms.UserCreationForm", "line_number": 8, "usage_type": "name" }, { "api_name": "models.AppUser", "line_number": 9, "usage_type": "nam...
56478289
#!/usr/bin/env python3 ''' project-euler-offline.py Christopher Su Checks solutions to Project Euler problems offline. ''' import base64 import json import logging import sys from Crypto.Cipher import AES MASTER_KEY = "03b5660c7c16a07bovIddIdhi4OxUcGinph" def loadJSON(jsonStr): try: data = json.loads(j...
null
project-euler-offline.py
project-euler-offline.py
py
1,314
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 20, "usage_type": "call" }, { "api_name": "logging.exception", "line_number": 22, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 23, "usage_type": "call" }, { "api_name": "Crypto.Cipher.AES.new", "li...
369494686
import flask from flask import Flask from flask import render_template from todo import main as todo_routes from user import main as user_routes app = Flask(__name__) # 设置 secret_key 来使用 flask 自带的 session # 这个字符串随便设置内容 app.secret_key = 'random string' # 这一行是套路 app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True ""...
null
main.py
main.py
py
1,175
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "todo.main", "line_number": 23, "usage_type": "argument" }, { "api_name": "user.main", "line_number": 26, "usage_type": "argument" }, { "api_name": "flask.render_template", "l...
192666151
from subprocess import PIPE, Popen import glob import os from . import download_images from flask import Flask, render_template, request, current_app def create_app(test_config=None): app = Flask(__name__, instance_relative_config=True) app.config.from_object('config') app.config.from_pyfile('config.py') ...
null
satellite-explorer/__init__.py
__init__.py
py
3,497
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 9, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.request.method", "line_number": 19, "usage_type": "attribute" }, { "api_name": "flask.requ...
181016629
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash import sqlite3 import sys, os from crontab import CronTab app = Flask(__name__) app.secret_key = 'tawanda' @app.route('/') def index(): return redirect( url_for('login')) @app.route('/home') def home(): if not session....
null
frontpage/timeserver.py
timeserver.py
py
4,735
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "flask.redirect", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.url_for", "line_number": 11, "usage_type": "call" }, { "api_name": "flask.session.get", "line...
172418056
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
null
filter_plugins/combine.py
combine.py
py
1,582
python
en
code
null
code-starcoder2
83
[ { "api_name": "ansible.errors.AnsibleFilterError", "line_number": 31, "usage_type": "call" }, { "api_name": "ansible.errors", "line_number": 31, "usage_type": "name" }, { "api_name": "ansible.errors.AnsibleFilterError", "line_number": 35, "usage_type": "call" }, { ...
267501081
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from collections import defaultdict import logging from sqlalchemy.exc import DBAPIError from tranny import constants from tranny.models import Section, Source, User, Download, Genre, Person log = logging.getLogger(__name__) cache_sectio...
null
tranny/datastore.py
datastore.py
py
4,658
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 12, "usage_type": "call" }, { "api_name": "coll...
350963238
import json import tempfile import os import requests srrdb_api = "http://www.srrdb.com/api/search/" srrdb_download = "http://www.srrdb.com/download/srr/" srrdb_details = "http://www.srrdb.com/release/details/" def search_by_release(names): for name in names: search = srrdb_api + "r:" + name ...
null
mp3rescene/utils/srrdb.py
srrdb.py
py
2,399
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 32, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 49, "usage_type": "call" }, { "api_name": "tempfile.gettempdir", "lin...
195535879
''' Defines base classes .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de> ''' import functools import operator import logging from pathlib import Path from abc import ABCMeta, abstractmethod, abstractproperty from typing import (Tuple, Callable, Optional, Union, Any, Dict, List, TypeVar, ...
null
pde/fields/base.py
base.py
py
59,731
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 26, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 30, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 30, "usage_type": "attribute" }, { "api_name": "typing.Optional"...
480732792
from pyqtgraph import LegendItem, LabelItem from pyqtgraph.graphicsItems.LegendItem import ItemSample ''' Class: ModelLegend Argument list: size - Size of Legend offset - offset of Legend Purpose: These are the legends for the model plotter Dependencies: pyqtgraph LegendItem, LabelItem, ItemSample Creator: Pa...
null
helperFiles/classes/ModelLegend.py
ModelLegend.py
py
1,799
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyqtgraph.LegendItem", "line_number": 17, "usage_type": "name" }, { "api_name": "pyqtgraph.LegendItem.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "pyqtgraph.LegendItem", "line_number": 19, "usage_type": "name" }, { "api_name"...
71988576
import tkinter as tk from tkinter import messagebox from tkinter import ttk from numpy import sin,cos import numpy as np y = True def double_pen_ani_wyk(L1, th1, M1, L2, th2, M2): from numpy import sin, cos import matplotlib.pyplot as plt import scipy.integrate as integrate import matplotlib.animation...
null
.Projekt 2020/main2.py
main2.py
py
14,445
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.arange", "line_number": 29, "usage_type": "call" }, { "api_name": "numpy.zeros_like", "line_number": 35, "usage_type": "call" }, { "api_name": "numpy.cos", "line_number": 39, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number"...
2641372
import pandas as pd import numpy as np import networkx as nx import random import math from datetime import datetime, timedelta from tqdm import tqdm from collections import defaultdict import matplotlib.pyplot as plt from glob import glob import logging # Setting up the loggings to monitor gensim from sklearn.ensemb...
null
readers/dynamobi.py
dynamobi.py
py
19,973
python
en
code
null
code-starcoder2
83
[ { "api_name": "networkx.from_pandas_edgelist", "line_number": 35, "usage_type": "call" }, { "api_name": "networkx.DiGraph", "line_number": 35, "usage_type": "call" }, { "api_name": "sampling.random_walk_sample", "line_number": 36, "usage_type": "call" }, { "api_na...
508986000
from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth.models import User import markdown from .forms import ArticlePostForm from .models import ArticlePost # Create your views here. def article_list(request): # 取出所有博客文章 articles = ArticlePost.objects.all()...
null
article/views.py
views.py
py
4,358
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.ArticlePost.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.ArticlePost.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.ArticlePost", "line_number": 12, "usage_type": "name" }, { ...
623136357
from sqlalchemy.sql.expression import func from community_share.models.search import Search, Label from community_share.models.user import User from community_share import store def get_searches_ordered_by_label_matches( labels, searcher_role, searching_for_role, offset_number=0, ...
null
community_share/search_utils.py
search_utils.py
py
1,458
python
en
code
null
code-starcoder2
83
[ { "api_name": "community_share.store.session.query", "line_number": 18, "usage_type": "call" }, { "api_name": "community_share.models.search.Search", "line_number": 18, "usage_type": "argument" }, { "api_name": "community_share.store.session", "line_number": 18, "usage_ty...
387861472
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from decimal import Decimal import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('pinax_stripe', '0001_initial'), ] operations = [ migrations.CreateM...
null
pinax/stripe/migrations/0002_auto_20151121_2054.py
0002_auto_20151121_2054.py
py
14,103
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 9, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 16, "usage_type": "call" }, ...
34290334
import cvxpy as cvx import numpy as np from scipy.optimize import linprog from typing import Tuple, List, Optional from snc.agents.hedgehog.strategic_idling.strategic_idling_hedging import StrategicIdlingHedging from snc.agents.hedgehog.workload.workload import compute_vertexes_cdd from snc.environments.controlled_ran...
null
src/snc/utils/alt_methods_test.py
alt_methods_test.py
py
14,614
python
en
code
null
code-starcoder2
83
[ { "api_name": "snc.environments.controlled_random_walk.ControlledRandomWalk", "line_number": 21, "usage_type": "name" }, { "api_name": "cvxpy.Variable", "line_number": 26, "usage_type": "call" }, { "api_name": "cvxpy.Variable", "line_number": 27, "usage_type": "call" },...
366361860
#!/usr/bin/env python # Copyright 2017 Google Inc. 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 require...
null
BankingApp/WebUI/detect_intent.py
detect_intent.py
py
10,083
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.RawDescriptionHelpFormatter", "line_number": 45, "usage_type": "attribute" }, { "api_name": "google.cloud.proto.conversation.v1alpha.detect_intent_pb2.AudioEncoding", "...
632864300
import pyavsrad as pyavs import numpy as np from pyavsrad_extension.extensions import TAVSFldToNumpyNdArray import pydicom as pd import os import sys def get_dicom_paths(data_dir, patID): """Retrieves the CT dicom file based on the input configuration. Converts the ct dicoms to an AVS field and retu...
null
Data_pros/data_import.py
data_import.py
py
8,365
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path", "line_number": 17, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
366613512
# -*- coding: utf-8 -*- import tornado.web from .base import BaseHandler from db import admin, Share import utils import options class AdminHandler(BaseHandler): @tornado.web.authenticated def get(self): user_id = self.current_user['user_id'] if admin.is_admin(user_id): self.rend...
null
anwen/admin.py
admin.py
py
2,482
python
en
code
null
code-starcoder2
83
[ { "api_name": "base.BaseHandler", "line_number": 10, "usage_type": "name" }, { "api_name": "db.admin.is_admin", "line_number": 15, "usage_type": "call" }, { "api_name": "db.admin", "line_number": 15, "usage_type": "name" }, { "api_name": "tornado.web.web", "li...
555681262
import numpy as np import pandas as pd from PIL import Image import coreglib #from https://github.com/dshean/demcoreg/tree/master/demcoreg import matplotlib.pyplot as plt from scipy import stats ''' Coregister two DEMs using the approach defined by Nuuth and Kääb, 2011. Do iteratively. ''' # define current ul and lr c...
null
FC_DEM_coregistration.py
FC_DEM_coregistration.py
py
3,302
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.array", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 19, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 19, "usage_type": "name" }, { "api_name": "numpy.array", "line_number":...
337260547
# Copyright 2015 Google Inc. 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 applicable law or ag...
null
google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/compute/windows_encryption_utils.py
windows_encryption_utils.py
py
8,159
python
en
code
null
code-starcoder2
83
[ { "api_name": "ctypes.windll.advapi32", "line_number": 21, "usage_type": "attribute" }, { "api_name": "ctypes.windll", "line_number": 21, "usage_type": "name" }, { "api_name": "ctypes.windll.kernel32", "line_number": 42, "usage_type": "attribute" }, { "api_name": ...
109137707
import hashlib import time import struct import os from typing import List, Tuple, NewType from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.serialization import \ Encoding, PublicFormat, load_der_public_key, load_d...
null
source/blockchain.py
blockchain.py
py
11,659
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.NewType", "line_number": 27, "usage_type": "call" }, { "api_name": "typing.NewType", "line_number": 28, "usage_type": "call" }, { "api_name": "typing.NewType", "line_number": 29, "usage_type": "call" }, { "api_name": "typing.NewType", "li...
595618535
#!/usr/bin/python # coding: utf-8 """ Elements """ from __future__ import print_function, division, absolute_import, unicode_literals import re from collections import OrderedDict from copy import deepcopy, copy from xml_writer.beacon import Beacon from xml_writer.header import Header from xml_writer.comment import...
null
xml_writer/element.py
element.py
py
7,210
python
en
code
null
code-starcoder2
83
[ { "api_name": "xml_writer.beacon.Beacon", "line_number": 21, "usage_type": "name" }, { "api_name": "collections.OrderedDict", "line_number": 25, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 29, "usage_type": "call" }, { "api_name": "copy.d...
231254593
from django.urls import path from .views import event_list, event_details, single_event, participant_details, participants_list,registration_view from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('event/',event_list), path('event/<pk>',event_details), path('participant/',p...
null
event_api_app/urls.py
urls.py
py
525
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "views.event_list", "line_number": 8, "usage_type": "argument" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "views.event_detai...
341805264
#!/usr/bin/python3 ''' prints all City objects from the database hbtn_0e_14_usa:''' import sys from model_city import City from model_state import Base, State from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker if __name__ == "__main__": dbConnector = 'mysql+mysqldb://{}:{}@localhost:330...
null
0x0F-python-object_relational_mapping/14-model_city_fetch_by_state.py
14-model_city_fetch_by_state.py
py
871
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.create_engine", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "model_state.Base.metadata.create_all", "line_number": 14, "usage_type": "call" }, { "api_n...
503644605
import matplotlib.pyplot as plt import numpy as np image = plt.imread("image.png") # extract pixel intensities red,green,blue = image[:,:,0], image[:,:,1], image[:,:,2] red_pix = red.flatten() green_pix=green.flatten() blue_pix = blue.flatten() plt.subplot(3,3,2) plt.axis('off') plt.imshow(image) # rescaling each c...
null
Learning/contrast.py
contrast.py
py
1,154
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.imread", "line_number": 3, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 3, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subplot", "line_number": 12, "usage_type": "call" }, { "api_name": "ma...
493900642
import itertools def metathesis_pair(word_1,word_2): char_list_1 = [] char_list_2 = [] if len(word_1) != len(word_2): return False for x in range(len(word_1)): if word_1[x] != word_2[x]: char_list_1.append(word_1[x]) char_list_2.append(word_2[x]) if len(char_...
null
Sem 4/Py_Lab/Ps_1/six.py
six.py
py
1,034
python
en
code
null
code-starcoder2
83
[ { "api_name": "itertools.combinations", "line_number": 18, "usage_type": "call" } ]
123930846
# -*- coding: utf-8 -*- """ ファイルの指定行を除去 """ import os import sys import tempfile import shutil def line_delete_back(line_num,file): tmpfd,tmpname = tempfile.mkstemp(dir='.') try: output_file = os.fdopen(tmpfd, 'w') input_file = open(file) except IOError: print( '"...
null
line_delete_back.py
line_delete_back.py
py
1,175
python
en
code
null
code-starcoder2
83
[ { "api_name": "tempfile.mkstemp", "line_number": 12, "usage_type": "call" }, { "api_name": "os.fdopen", "line_number": 14, "usage_type": "call" }, { "api_name": "shutil.copyfile", "line_number": 30, "usage_type": "call" }, { "api_name": "os.remove", "line_numb...
577252234
import os import re from flask import Flask, render_template, current_app from .config import DefaultConfig from .extensions import db, csrf, login_manager from .utils import INSTANCE_FOLDER_PATH, BASEDIR __all__ = ['create_app', 'initialize_database'] def create_app(config=None, app_name=None, init_db=True): ...
null
potnanny/application.py
application.py
py
4,219
python
en
code
null
code-starcoder2
83
[ { "api_name": "config.DefaultConfig.PROJECT", "line_number": 15, "usage_type": "attribute" }, { "api_name": "config.DefaultConfig", "line_number": 15, "usage_type": "name" }, { "api_name": "flask.Flask", "line_number": 17, "usage_type": "call" }, { "api_name": "ut...
205044625
''' Enter xlsx name, sheetNameeet name, and your csv file name ''' import csv import xlrd def converter(ex_name='random name', sh_name='Sheet1', csv_name='untitled'): ''' takes in xlsx and converts in csv ''' try: work_book = xlrd.open_workbook(ex_name) except: print('File name incor...
null
NLP/feedbackAndTweepy/cxcsv.py
cxcsv.py
py
651
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlrd.open_workbook", "line_number": 11, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 19, "usage_type": "call" }, { "api_name": "csv.QUOTE_ALL", "line_number": 19, "usage_type": "attribute" } ]
452414590
#!/usr/bin/env python # coding: utf-8 from urllib.request import Request, urlopen from urllib.parse import urlencode, quote_plus import xml.etree.ElementTree as ET from datetime import datetime import json import time import threading from kafka import KafkaProducer class RealTimeAuctionService: def __init__...
null
데이터수집/실시간경매속보서비스/RealTimeAuctionService.py
RealTimeAuctionService.py
py
3,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.today", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "name" }, { "api_name": "kafka.KafkaProducer", "line_number": 21, "usage_type": "call" }, { "api_name": "json.du...
306372472
# https://docs.djangoproject.com/en/2.2/howto/custom-template-tags/ from django import template from django.template.defaultfilters import stringfilter register = template.Library() import sys, os, shutil, json sys.path.append(os.path.abspath('../..')) from common.utils import * @register.filter def de_per(value, ar...
null
products/templatetags/poll_extras.py
poll_extras.py
py
799
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.template.Library", "line_number": 5, "usage_type": "call" }, { "api_name": "django.template", "line_number": 5, "usage_type": "name" }, { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "...
88674367
#!/usr/bin/env python3 import singer from tap_pipedrive.tap import PipedriveTap logger = singer.get_logger() def main(): args = singer.utils.parse_args(['api_token', 'start_date']) if args.properties: logger.error('Tap does not support --properties') exit(1) if args.discover: ...
null
tap_pipedrive/cli.py
cli.py
py
514
python
en
code
null
code-starcoder2
83
[ { "api_name": "singer.get_logger", "line_number": 7, "usage_type": "call" }, { "api_name": "singer.utils.parse_args", "line_number": 11, "usage_type": "call" }, { "api_name": "singer.utils", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tap_pipedr...
174709947
from twisted.python.failure import Failure from zope.interface import implements, classProvides from feat.common import serialization, adapter from feat.common.serialization import base from feat.interface.serialization import * class AdaptedMarker(object): pass class BaseAdapter(object): adapter_mixin =...
null
src/feat/common/serialization/adapters.py
adapters.py
py
2,917
python
en
code
null
code-starcoder2
83
[ { "api_name": "feat.common.adapter", "line_number": 22, "usage_type": "name" }, { "api_name": "feat.common.adapter", "line_number": 23, "usage_type": "name" }, { "api_name": "feat.common.adapter", "line_number": 28, "usage_type": "name" }, { "api_name": "feat.comm...
85074468
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('polls', '0004_userprofile_website'), ] operations = [ migrations.AddField( model_name='question', na...
null
polls/migrations/0005_auto_20141217_0143.py
0005_auto_20141217_0143.py
py
1,075
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
596455683
from selenium.webdriver.common.by import By from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from .common import SELENIUM_EXCEPTIONS, archiver def load_likes(driver): """ Loa...
null
deletefb/tools/likes.py
likes.py
py
2,096
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver.support.expected_conditions.presence_of_element_located", "line_number": 17, "usage_type": "call" }, { "api_name": "selenium.webdriver.support...
439154922
""" This module controls the overall engine and implements a few key aspects. 2008-08-22: Okay, as an ammendment to the below, it turns out that this module only needs to be dependent on the video and event modules but not the camera or world modules. This makes it more like the old core module th...
null
sbak/engine.py
engine.py
py
8,447
python
en
code
null
code-starcoder2
83
[ { "api_name": "constants.DEFAULT_TICKS", "line_number": 57, "usage_type": "name" }, { "api_name": "pygame.time.Clock", "line_number": 72, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 72, "usage_type": "attribute" }, { "api_name": "constants....
350501993
from config.env import ENV from testlib.api.helpers_api import BaseApi class ApiCalls(BaseApi): api_url = ENV def __init__(self, required_token=True): if required_token: self.get_headers['Authorization'] = f'Bearer {BaseApi.token}' self.post_headers['Authorization'] = f'Bearer...
null
testlib/api/api_calls.py
api_calls.py
py
4,533
python
en
code
null
code-starcoder2
83
[ { "api_name": "testlib.api.helpers_api.BaseApi", "line_number": 5, "usage_type": "name" }, { "api_name": "config.env.ENV", "line_number": 6, "usage_type": "name" }, { "api_name": "testlib.api.helpers_api.BaseApi.token", "line_number": 10, "usage_type": "attribute" }, ...
86251264
from django.shortcuts import render from .models import Participants,Contact,Program from django.core.files.storage import FileSystemStorage def index(request): return render(request, 'index.html') def register(request): folder='static/files' if "register" in request.POST: name = request.POST...
null
IT-Conference/eventapp/views.py
views.py
py
2,059
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "django.core.files.storage.FileSystemStorage", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Participants", "line_number": 23, "usage_type": "call" }, {...
552388526
# coding: utf-8 # In[1]: import json # build-in library import numpy as np # In[2]: features = [("word count", 'NUMERIC'), ("average word length", 'NUMERIC'), ("length of the longest word", 'NUMERIC'), ("whether start with number", ['True', 'False']), ("whether start with who/wh...
null
data_prepper.py
data_prepper.py
py
2,141
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 49, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.add", "line_number": 86, "usage_type": "call" } ]
366093861
# -*- coding: utf-8 -*- from flask import( render_template, flash, redirect, url_for, request, current_app, abort, jsonify, send_from_directory ) from ... models import ( UserModel, Grade, Project, Competition, Adviser, Participant, UnitModel, Student,...
null
app/views/competition/index.py
index.py
py
5,247
python
en
code
null
code-starcoder2
83
[ { "api_name": "models.Competition.model_form", "line_number": 43, "usage_type": "call" }, { "api_name": "models.Competition", "line_number": 43, "usage_type": "name" }, { "api_name": "flask.request.form", "line_number": 44, "usage_type": "attribute" }, { "api_name...
195646153
import os import pandas as pd from datetime import datetime from functools import reduce from libs.azure_blob_connector import AzureBlobConnector from libs.predictor import CovidPredictor from utils.func_utils import isevaluatable, transform_group # Load ENV Variables from .env from dotenv import load_dotenv load_dot...
null
main.py
main.py
py
3,594
python
en
code
null
code-starcoder2
83
[ { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.g...
474398539
"""Initialize and run kanelbulle.""" import sys from PyQt5.QtWidgets import QApplication from kanelbulle.config import config from kanelbulle.utils import log from kanelbulle.gui import mainwindow app = None def main(): """Initialize and run the application.""" global app app = QApplication(sys.argv) ...
null
kanelbulle/app.py
app.py
py
860
python
en
code
null
code-starcoder2
83
[ { "api_name": "PyQt5.QtWidgets.QApplication", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "kanelbulle.gui.mainwindow.MainWindow", "line_number": 21, "usage_type": "call" }, { "a...
399035322
# -*- coding: utf-8 -*- import DbManager import Pyro4 import socket import shutil import os.path import smtplib import time import sqlite3 from threading import Timer class Server(object): def __init__(self): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("gmail.com",80)) ...
null
src/Server.py
Server.py
py
7,946
python
en
code
null
code-starcoder2
83
[ { "api_name": "socket.socket", "line_number": 15, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 15, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 15, "usage_type": "attribute" }, { "api_name": "DbManager.Db...
205553215
# coding: utf-8 """ 先验算法 """ import collections def load_data(): data_set = [ [1, 2, 3, 4], [1, 2, 4, 5], [1, 3, 4, 5], ] return {frozenset(i) for i in data_set} class Apriori: def __init__(self, data=None): if data is None: self.data = load_data() ...
null
frequent_itemset/apriori.py
apriori.py
py
2,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.Counter", "line_number": 27, "usage_type": "call" } ]
512569640
from django.conf.urls import include, url from django.views.generic import TemplateView from OJ.admin import oj_admin_site from OJ.ajax_views import SubmissionView, CheckView, ProblemSubmissionHistoryListView from OJ.views import Website_ProblemList, ProblemDetail, SubmissionDetail, PersonalDetail, TagDetail, GetForma...
null
API/OJ/urls.py
urls.py
py
3,431
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 17, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView.as_view", "line_number": 17, "usage_type": "call" }, { "api_name": "django.views.generic.TemplateView", "line_number": 17, "usage_type": "name...
44623948
import logging import os import time import uuid from io import BytesIO import docker import pytest import docker_meta from docker_meta import ( DockerContainer, run_configuration, read_configuration) from docker_meta.logger import ( configure_logger, last_info_line, last_error_line) test_dockerfile = ''' F...
null
systemd/test/test_container.py
test_container.py
py
14,546
python
en
code
null
code-starcoder2
83
[ { "api_name": "docker_meta.logger.configure_logger", "line_number": 26, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 27, "usage_type": "call" }, { "api_name": "docker_meta.__name__", "line_number": 27, "usage_type": "attribute" }, { "a...
277968742
import os os.environ["CUDA_VISIBLE_DEVICES"]="" os.environ["USE_CPU"]="1" import sys import argparse import numpy as np import pandas as pd from train import a from train import g import torch vowels = sorted(['y', 'é', 'ö', 'a', 'i', 'å', 'u', 'ä', 'e', 'o']) def createInstances(input_data, vocab): gt = [] ...
null
eval.py
eval.py
py
2,935
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.concatenate", "line_number": 31, "usage_type": "call" }, { "api_name": "train.g", "line_n...
102545664
#!/usr/bin/env python3 from anndata import AnnData from typing import Dict, List, Optional, Tuple from ...utils.anndata_manager import anndata_manager as adm, AnnDataKeyIdentifiers _TypeMetric = Tuple[str, Dict] class UsesMetric: """ Objects with this trait can set and get internal metrics of AnnData o...
null
src/transmorph/engine/traits/usesmetric.py
usesmetric.py
py
3,909
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.Tuple", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 31, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number...
612092235
#!/usr/bin/env python # encoding: utf-8 # The MIT License # # Copyright 2015 UB Bochum <bibliographie-ub@rub.de>. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, i...
null
processors/mods_parser.py
mods_parser.py
py
55,719
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 40, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 40, "usage_type": "attribute" }, { "api_name": "simplejson.load", "line_number": 210, "usage_type": "call" }, { "api_name": "simplejson.lo...
219404542
""" This reference code for plotting histograms """ import numpy as np import matplotlib.pyplot as plt # Create some data data = [0, 1, 4, 2, 3, 2, 4, 2, 1, 2, 1, 0, 1, 1] # convert the data in an ndarray hist = np.hstack(data) # add the data to a histogram plt using hist() function plt.hist(hist, align='mid') # ad...
null
images/histograms_example.py
histograms_example.py
py
475
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.hstack", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.hist", "line_number": 14, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 14, "usage_type": "name" }, { "api_name": "matplotlib.pypl...
424386206
import MySQLdb db=MySQLdb.connect("localhost","root","lxd1996","MySQL_Learning") cursor=db.cursor() sql = "DELETE FROM EMPLOYEE WHERE AGE > '%d'"%20 try: cursor.execute(sql) db.commit() except: db.rollback() db.close()
null
MySQL_learning/delete_table.py
delete_table.py
py
232
python
en
code
null
code-starcoder2
83
[ { "api_name": "MySQLdb.connect", "line_number": 2, "usage_type": "call" } ]
511050753
import argparse import collections import io import json import logging import re import socket import os import ftfy logger = logging.getLogger("pladder.irc") Message = collections.namedtuple("Message", "sender, command, params") Sender = collections.namedtuple("Sender", "nick, user, host") NO_SENDER = Sender(Non...
null
pladder/irc.py
irc.py
py
9,097
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 17, "usage_type": "call" }, { "api_name": "socke...
496824729
import torch from line_world.utils import SCALING_CONSTANT class Noise(object): def __init__(self): pass def noisy_gradients(self, state_list): raise Exception('Must be implemented') def create_noise(implementation, params): if implementation == 'isotropic_gaussian': assert set(...
null
line_world/optim/noise.py
noise.py
py
1,796
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.randn", "line_number": 30, "usage_type": "call" }, { "api_name": "line_world.utils.SCALING_CONSTANT", "line_number": 46, "usage_type": "name" } ]
500331436
#!/usr/bin/env python # encoding: utf-8 from cortexutils.responder import Responder import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import pandas as pd import json import urllib2 from netaddr import IPNetwork, IPAddress class MailExcel(Responder): def __init__(self...
null
cortex-ansible/roles/cortex_responders/files/myresponders/excelMails/mailsexcel.py
mailsexcel.py
py
3,842
python
en
code
null
code-starcoder2
83
[ { "api_name": "cortexutils.responder.Responder", "line_number": 14, "usage_type": "name" }, { "api_name": "cortexutils.responder.Responder.__init__", "line_number": 16, "usage_type": "call" }, { "api_name": "cortexutils.responder.Responder", "line_number": 16, "usage_type...
332290319
from theano.tensor.shared_randomstreams import RandomStreams from theano import function import numpy # http://deeplearning.net/software/theano/tutorial/examples.html for i in range(10): # srng = RandomStreams(seed=i) srng = RandomStreams(seed=432) rv_u = srng.uniform((2,2)) rv_n = srng.normal((2,2...
null
05Deep Learning with Python- A Hands-on Introduction/ch4Introduction to Theano/i14demeOf RandomStreams.py
i14demeOf RandomStreams.py
py
653
python
en
code
null
code-starcoder2
83
[ { "api_name": "theano.tensor.shared_randomstreams.RandomStreams", "line_number": 12, "usage_type": "call" }, { "api_name": "theano.function", "line_number": 15, "usage_type": "call" }, { "api_name": "theano.function", "line_number": 17, "usage_type": "call" }, { "...
261743950
"""add follow Revision ID: df3506bc66b0 Revises: b0239f399c1d Create Date: 2018-06-13 20:55:07.614259 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'df3506bc66b0' down_revision = 'b0239f399c1d' branch_labels = None depends_on = None def upgrade(): # ###...
null
app/migrations/versions/df3506bc66b0_add_follow.py
df3506bc66b0_add_follow.py
py
2,224
python
en
code
null
code-starcoder2
83
[ { "api_name": "alembic.op.create_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 22, "usage_type": "call" }, { "api_name": "sqlalchemy.Integ...
15982208
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json class MatrixBuilder(): cache = {} base_images = [] graph = {} image_prefix = '' dockerfile_blocks = [] # ignore these for now ignore = [ 'php-official', 'toolbox', ] def __init__(self, dockerfile_blocks,...
null
bin/webdevops/DockerfileFilter.py
DockerfileFilter.py
py
3,310
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dumps", "line_number": 106, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 110, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 114, "usage_type": "call" } ]
235462059
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 14 11:02:43 2018 @author: root """ from PyQt5.QtCore import QObject, pyqtSignal from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from qgis.core import * # Import the code for the dialog from .randomforest_dialog imp...
null
randomforestmodel.py
randomforestmodel.py
py
15,191
python
en
code
null
code-starcoder2
83
[ { "api_name": "to_evaluate.vector_is_readable", "line_number": 56, "usage_type": "call" }, { "api_name": "geopandas.read_file", "line_number": 63, "usage_type": "call" }, { "api_name": "geopandas.read_file", "line_number": 66, "usage_type": "call" }, { "api_name":...
305524983
# weatherStation_perSecond.py import os import time import RPi.GPIO as GPIO import Adafruit_DHT as dht import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 from PIL import Image from PIL import ImageDraw from PIL import ImageFont sensor = dht.DHT11 temp_pin = 4 fan_pin = 21 red= 17 green= 27 maxTmp=30 maxHum=80 d...
null
weatherStation_cron.py
weatherStation_cron.py
py
2,262
python
en
code
null
code-starcoder2
83
[ { "api_name": "Adafruit_DHT.DHT11", "line_number": 13, "usage_type": "attribute" }, { "api_name": "RPi.GPIO.setmode", "line_number": 22, "usage_type": "call" }, { "api_name": "RPi.GPIO", "line_number": 22, "usage_type": "name" }, { "api_name": "RPi.GPIO.BCM", ...
497091401
import re from datetime import timedelta import pytest from test_conf import TlsTestConf class TestVars: @pytest.fixture(autouse=True, scope='class') def _class_scope(self, env): conf = TlsTestConf(env=env) conf.add_vhosts(domains=[env.domain_a, env.domain_b], extras={ 'base': "...
null
test/test_08_vars.py
test_08_vars.py
py
2,203
python
en
code
null
code-starcoder2
83
[ { "api_name": "test_conf.TlsTestConf", "line_number": 13, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 11, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 43, "usage_type": "call" }, { "api_name": "pytest.m...
330895815
#!/usr/bin/env python # -*- coding: utf-8 -*- import re from functools import reduce class SplitSents: def __init__(self): self.cut_symbol = ",。?!:;,.?!;、" pass def FindToken(self, cutlist, char): if char in cutlist: return True else: return False ...
null
models/RSS/yahoo/split_sents.py
split_sents.py
py
1,358
python
en
code
null
code-starcoder2
83
[ { "api_name": "re.findall", "line_number": 21, "usage_type": "call" }, { "api_name": "functools.reduce", "line_number": 22, "usage_type": "call" } ]
534033310
# -*-coding:utf-8-*- # __Author__=Youzhi Gu # Learn Python at Zhejiang University import cv2 import sys import numpy as np img = cv2.imread('chess.jpg') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) surf = cv2.xfeatures2d.SURF_create() keypoints, descriptor = surf.detectAndCompute(gray,None) img = cv...
null
feature extraction/SURF/SURF.py
SURF.py
py
603
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 11, "usage_type": "attribute" }, { "api_name": "cv2.xfeatures2d.SURF_...
480886971
import pygame import random class Board: def __init__(self): """ Initializes the puzzle board. """ self.board = [[''] * 9 for i in range(9)] self.squares = {} self.black = [] self.certificate = {} self.message, self.message2, self.message3...
null
lightup.py
lightup.py
py
31,589
python
en
code
null
code-starcoder2
83
[ { "api_name": "random.randrange", "line_number": 66, "usage_type": "call" }, { "api_name": "random.randrange", "line_number": 68, "usage_type": "call" }, { "api_name": "random.random", "line_number": 131, "usage_type": "call" }, { "api_name": "random.random", ...
132692877
from cohortextractor import StudyDefinition, patients, codelist, codelist_from_csv # NOQA # Import json and datetime module import json import datetime ############ # Codelist # ############ # Import Codelists from codelists import * # Combine codelists gp_contact_codelist = combine_codelists( snomed_KM_mental...
null
analysis/study_definition_gp_KM_mental_disorder.py
study_definition_gp_KM_mental_disorder.py
py
4,773
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 25, "usage_type": "call" }, { "api_name": "cohortextractor.StudyDefinition", "line_number": 35, "usage_type": "call" }, { "api_name": "cohortextractor.patients.satisfying", "line_number": 45, "usage_type": "call" }, { "api...
353112444
#!/usr/bin/env python3 # https://adventofcode.com/2020/day/17 import os import sys import itertools from collections import defaultdict with open(os.path.join(sys.path[0], "input.txt"), "r") as file: lines = [line.rstrip("\n") for line in file] def get_active(data, dimensions): positions = [] for x in ...
null
17_conway-cubes/main.py
main.py
py
1,308
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "collections.defaultdict", ...
102846125
#!/usr/bin/env python # -*- coding: utf-8 -*- # Used to install package and all of its dependencies. from os import path from setuptools import setup from setuptools import find_packages def read_file_contents(relative_filepath): """ Returns contents of a textfile as a single string. :param str relative_fi...
null
setup.py
setup.py
py
2,322
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.dirname", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_numb...
411144761
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import ast import te...
null
tests/python/pants_test/backend/python/tasks/checkstyle/test_common.py
test_common.py
py
6,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "pants.backend.python.tasks.checkstyle.common.CheckstylePlugin", "line_number": 38, "usage_type": "name" }, { "api_name": "textwrap.dedent", "line_number": 48, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 45, "usage_type": "attribut...
114203658
import time from selenium import webdriver driver = webdriver.Chrome() driver.get('https://www.12306.cn/index/') js_1="document.getElementById('train_date').removeAttribute('readonly');" js="document.getElementById('train_date').value='2018-20-15'" time.sleep(3) driver.execute_script(js_1) dri...
null
zuixin/common/t3.py
t3.py
py
1,220
python
en
code
null
code-starcoder2
83
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 6, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 6, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 14, "usage_type": "call" } ]
478238072
""" This Lambda warns us if any of our ECS services are failing to start and leaving the event: {service} is unable to consistently start tasks successfully. This helps us spot when, say, we've deployed a bad configuration or we have an issue with ECS capacity. == How it works == This is the rough architecture:...
null
monitoring/slack_alerts/ecs_tasks_cant_start_alert/src/ecs_tasks_cant_start_alert.py
ecs_tasks_cant_start_alert.py
py
4,016
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.stderr", "line_number": 81, "usage_type": "attribute" }, { "api_name": "sys.stderr", "line_number": 82, "usage_type": "attribute" }, { "api_name": "functools.wraps", "line_number": 76, "usage_type": "call" }, { "api_name": "functools.cache", ...
419471270
import time import requests import argparse import json from pymysql import connect try: from ConfigParser import ConfigParser except ImportError: from configparser import ConfigParser DEFAULT_CONFIG = "default.ini" ### Queries QUERY_DROP = """DROP TABLE {db_extra_dbname}.{db_extra};""" QUER...
null
edit_watcher.py
edit_watcher.py
py
13,232
python
en
code
null
code-starcoder2
83
[ { "api_name": "configparser.ConfigParser", "line_number": 46, "usage_type": "call" }, { "api_name": "pymysql.connect", "line_number": 105, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 148, "usage_type": "call" }, { "api_name": "requests.post"...
53902984
""" IEE spider created on the top of ATSSpider scrapy crawl iee -a mining_job_id=9999 -a iteration=1 -a extract=1 -a url="http://www.iee.lu/job-opportunities" Sample URL: http://www.iee.lu/job-opportunities """ from re import compile from scrapy.http import Request from scrapy.selector import Selector from urlpa...
null
brightcorp/brightcorp/spiders/iee.py
iee.py
py
2,210
python
en
code
null
code-starcoder2
83
[ { "api_name": "brightcorp.base.atsspiders.ATSSpider", "line_number": 20, "usage_type": "name" }, { "api_name": "re.compile", "line_number": 23, "usage_type": "call" }, { "api_name": "scrapy.selector.Selector", "line_number": 26, "usage_type": "call" }, { "api_name...
484712762
from flask import Flask, jsonify, request from C136ProjectData import data app = Flask(__name__) @app.route("/") def index(): return jsonify({ "data": data, "status": "success" }), 200 @app.route("/star") def stars(): name = request.args.get('Star Name') starData = next...
null
Project 136/StarFlaskPro136.py
StarFlaskPro136.py
py
501
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 4, "usage_type": "call" }, { "api_name": "flask.jsonify", "line_number": 8, "usage_type": "call" }, { "api_name": "C136ProjectData.data", "line_number": 9, "usage_type": "name" }, { "api_name": "flask.request.args.get", ...
535596956
from __future__ import print_function import numpy as np import pandas as pd import collections from IPython import display import sklearn import sklearn.manifold import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # Add some convenience functions to ...
null
tensorflow/Recommedation/Recommedation2.py
Recommedation2.py
py
12,484
python
en
code
null
code-starcoder2
83
[ { "api_name": "tensorflow.logging.set_verbosity", "line_number": 10, "usage_type": "call" }, { "api_name": "tensorflow.logging", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 13, "usage_type": "attribute" }, { "api_name...
504237250
# -*- coding: utf-8 -*- """ Various utilities of use throughout this code. """ from __future__ import print_function from ast import literal_eval as make_tuple try: import configparser except ImportError: # Py2 import ConfigParser as configparser import collections try: import collections.abc except Impor...
null
dbprocessing/Utils.py
Utils.py
py
15,530
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.abc", "line_number": 17, "usage_type": "attribute" }, { "api_name": "datetime.datetime.strptime", "line_number": 76, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 76, "usage_type": "attribute" }, { "api_name":...
433702895
import requests import csv import pprint from urllib.parse import urljoin from app import app def _steam_endpoint(endpoint, apikey=app.config['STEAM_API_KEY'], **params): ''' Return a formatted endpoint URL from the Steam API Warning: Will fail if no parameters are included in the endpoint ''' url...
null
app/user_info.py
user_info.py
py
3,971
python
en
code
null
code-starcoder2
83
[ { "api_name": "app.app.config", "line_number": 7, "usage_type": "attribute" }, { "api_name": "app.app", "line_number": 7, "usage_type": "name" }, { "api_name": "urllib.parse.urljoin", "line_number": 13, "usage_type": "call" }, { "api_name": "requests.get", "li...
152814087
import collections import csv import glob import os from PIL import Image from workers.lib.messenger import message from .abstract import Ingestor from .validation_schemas import get_blank_detection_schema, get_blank_image_detection_schema class TownCentreIngestor(Ingestor): detection_counter = 0 default_la...
null
backend/workers/lib/vod_converter/town_centre.py
town_centre.py
py
4,992
python
en
code
null
code-starcoder2
83
[ { "api_name": "abstract.Ingestor", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.isdir", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
154545210
# import modules here from collections import deque as DQ from itertools import accumulate class BoxFilter: def __init__(self, size=5): self._deque = DQ(maxlen=size) def update(self, val): self._deque.append(val) sum = max(accumulate(self._deque)) return sum / len(self._deque) ...
null
BoxFilter/Python/BoxFilter.py
BoxFilter.py
py
483
python
en
code
null
code-starcoder2
83
[ { "api_name": "collections.deque", "line_number": 7, "usage_type": "call" }, { "api_name": "itertools.accumulate", "line_number": 11, "usage_type": "call" } ]
449937085
""" 读取ROMS station out 保存为npz """ import time import numpy as np # from mpl_toolkits.basemap import Basemap, cm import netCDF4 as Nc # **************************************************** # nc_tar_dir = 'G:\\ww3_tar\\' # nc_toc_dir = 'G:\\ww3_toc\\' nc_tar_dir = '/data/home/henry/roms2017/ww3_ta/ROMS_OUT/' nc_toc_dir...
null
Station_read.py
Station_read.py
py
4,506
python
en
code
null
code-starcoder2
83
[ { "api_name": "netCDF4.Dataset", "line_number": 60, "usage_type": "call" }, { "api_name": "netCDF4.Dataset", "line_number": 61, "usage_type": "call" }, { "api_name": "time.strptime", "line_number": 65, "usage_type": "call" }, { "api_name": "time.mktime", "line...
565025425
# pylint: disable=no-member, unexpected-keyword-arg, too-many-public-methods, # pylint: too-few-public-methods, import-error, relative-import """Views implement here""" from django.shortcuts import render from django.http import HttpResponse from django.http import HttpResponseRedirect # Create your views here. from ...
null
timetables/views.py
views.py
py
4,076
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.http.HttpResponseRedirect", "line_number": 18, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 29, "usage_type": "call" }, ...
452167389
import pytest import sqlalchemy.exc from snakeskin.models.tenant import Tenant from snakeskin.models.user import User class TestTenant: '''Tenant model''' def test_query(self, db_session, fixture_tenants): '''can be queried''' tenants = Tenant.query.all() assert len(tenants) == 2 ...
null
tests/test_models/test_tenant.py
test_tenant.py
py
1,302
python
en
code
null
code-starcoder2
83
[ { "api_name": "snakeskin.models.tenant.Tenant.query.all", "line_number": 12, "usage_type": "call" }, { "api_name": "snakeskin.models.tenant.Tenant.query", "line_number": 12, "usage_type": "attribute" }, { "api_name": "snakeskin.models.tenant.Tenant", "line_number": 12, "u...
187790342
""" Copyright [2021] [DenyS] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
null
multibar/discord/errors.py
errors.py
py
3,433
python
en
code
null
code-starcoder2
83
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 23, "usage_type": "attribute" }, { "api_name": "typing.Sequence", "line_number": 27, "usage_type": "attribute" }, { "api_name": "multibar.core.errors.ProgressError", "line_number": 54, "usage_type": "name" }, { ...
332364354
import os import numpy as np import cv2 import pickle import argparse import matplotlib.pyplot as plt from matplotlib.patches import Polygon from matplotlib.widgets import PolygonSelector from matplotlib.collections import PatchCollection from shapely.geometry import box from shapely.geometry import Polygon as shapely_...
null
set_regions.py
set_regions.py
py
3,889
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.widgets.PolygonSelector", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number": 44, "usage_type": "attribute" }, { "api_name": "os.rem...
363540526
from django.urls import path from . import views urlpatterns = [ path("", views.top, name="top"), path("lists/", views.lists, name="lists"), path("category/<str:c2>/", views.category, name="category"), path("new/", views.new, name="new"), path("search/", views.search, name = "search"), path("li...
null
main/urls.py
urls.py
py
525
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", ...
590648406
import simplejson as json import os import yaml import datetime from opentargets_urlzsource import URLZSource from common import make_gzip import logging import time logger = logging.getLogger(__name__) class EvidenceSubset(object): def __init__(self, filename, output_dir, gs_output_dir): self.suffix = d...
null
modules/EvidenceSubset.py
EvidenceSubset.py
py
4,245
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "datetime.datetime.today", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.p...
315848719
import sys import os import math import matplotlib.pyplot as plt from point import Point train_dir = sys.argv[1] files = os.listdir(train_dir) words = {} whitelist = set('abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ') for f in files: file = open(train_dir + f, "r", encoding="utf-8") for _ in range...
null
3kurs/2sem/iad/lab4/src.py
src.py
py
1,834
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "point.Point", "line_number": 27, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 53,...
18801687
import requests from bs4 import BeautifulSoup nlist = [0]*46 for num in range(700, 860): url = f'https://dhlottery.co.kr/gameResult.do?method=byWin&drwNo={num}' res = requests.get(url).text soup = BeautifulSoup(res, 'html.parser') lottery = soup.select('.ball_645') for number in lottery: n...
null
Pycharm/dict_project/lotto.py
lotto.py
py
461
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 8, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 9, "usage_type": "call" } ]
85056576
import wx import sys import pydart2 as pydart import numpy as np import cMat import SimbiconController as SC import math import queue #import Cgui from guiModule import ModuleTest_drawMesh_new from wx import glcanvas from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import gym from gym impor...
null
gym-foo/gym_foo3d/envs/foo_env7.py
foo_env7.py
py
4,445
python
en
code
null
code-starcoder2
83
[ { "api_name": "gym.spaces.Box", "line_number": 38, "usage_type": "call" }, { "api_name": "gym.spaces", "line_number": 38, "usage_type": "name" }, { "api_name": "numpy.abs", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.abs", "line_number": 87...
375427939
from flask import Flask, render_template, request, Response, make_response, jsonify, json from flask import redirect, url_for import requests import os import re import html import sqlite3 import datetime app = Flask(__name__) connection = sqlite3.connect('data/chatapp.db') c = connection.cursor() c.execute('''CREA...
null
server_copy1.py
server_copy1.py
py
4,763
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlite3.connect", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 29, "usage_type": "call" }, { "api_name": "flask.render_templa...
180137818
import logging class TaskMaster: STATES = {1: 'new', 2: 'in_progress', 3: 'done'} def __init__(self, app): self.app = app self.logger = logging.getLogger('app') def create_task(self, name, text, owner): self.logger.info('Creating new task: ' + name + ' for ' + owner) erro...
null
tasks.py
tasks.py
py
1,363
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" } ]
148861673
import keras.layers as KL import keras.backend as K import math import tensorflow as tf import numpy as np from keras import losses from mrcnn import model # Block that creates the graph which results in the # probability of each bin and its residual angle values def bin_block(input_tensor, angle_number, bin_number, ...
null
mrcnn/orientation.py
orientation.py
py
20,227
python
en
code
null
code-starcoder2
83
[ { "api_name": "keras.layers.TimeDistributed", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.layers", "line_number": 15, "usage_type": "name" }, { "api_name": "keras.layers.Dense", "line_number": 15, "usage_type": "call" }, { "api_name": "keras.la...