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
569619653
import os.path from datetime import datetime from tablib import Dataset from core.admin import AuthorAdmin, BookAdmin, BookResource, CustomBookAdmin from core.models import Author, Book, Category, EBook, Parent from django.contrib.admin.models import LogEntry from django.contrib.auth.models import User from django.co...
null
tests/core/tests/test_admin_integration.py
test_admin_integration.py
py
15,642
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.testcases.TestCase", "line_number": 18, "usage_type": "name" }, { "api_name": "django.contrib.auth.models.User.objects.create_user", "line_number": 21, "usage_type": "call" }, { "api_name": "django.contrib.auth.models.User.objects", "line_number": 2...
83107207
import pickle import sys import numpy as np from gpar import GPARRegressor from lab import B from wbml.data.air_temp import load as load_temp B.epsilon = 1e-6 d_size = 0 if len(sys.argv) < 2 else int(sys.argv[1]) d_all, d_train, d_tests = load_temp()[d_size] n_ind = [10 * 10 + 1, 10 * 15 + 1, 10 * 31 + 1][d_size] ...
null
examples/paper/air_temp.py
air_temp.py
py
1,449
python
en
code
null
code-starcoder2
66
[ { "api_name": "lab.B.epsilon", "line_number": 9, "usage_type": "attribute" }, { "api_name": "lab.B", "line_number": 9, "usage_type": "name" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "wbml.data.air_temp.load", "l...
243174731
"""APP Module with all the available endpoints and the FastAPI initialization. """ # # Native # # import asyncio import contextlib # # Installed # # import uvicorn import fastapi # # Project # # from .settings_handler import settings __all__ = ("app", "run") app = fastapi.FastAPI( title=settings.name, desc...
null
my_api/app.py
app.py
py
731
python
en
code
null
code-starcoder2
66
[ { "api_name": "fastapi.FastAPI", "line_number": 18, "usage_type": "call" }, { "api_name": "settings_handler.settings.name", "line_number": 19, "usage_type": "attribute" }, { "api_name": "settings_handler.settings", "line_number": 19, "usage_type": "name" }, { "api...
378776582
from functools import wraps import graphene import graphql_jwt from . import mixins from .testcases import SchemaTestCase def input_variables(f): @wraps(f) def wrapper(self, variables): return f(self, {'input': variables}) return wrapper class ObtainJSONWebTokenTests(mixins.ObtainJSONWebToken...
null
tests/test_relay.py
test_relay.py
py
1,759
python
en
code
null
code-starcoder2
66
[ { "api_name": "functools.wraps", "line_number": 12, "usage_type": "call" }, { "api_name": "testcases.SchemaTestCase", "line_number": 19, "usage_type": "name" }, { "api_name": "graphene.ObjectType", "line_number": 21, "usage_type": "attribute" }, { "api_name": "gra...
81009005
""" Copyright 2019 Alexander Meulemans 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 """ import sys sys.path.append('.') from layers.layer import Rel...
null
experiments/run_mnist_capsules.py
run_mnist_capsules.py
py
3,824
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.cuda.manual_see...
8477789
# from hashlib import md5 # import base64 # import os # import chardet import time import requests import traceback from tools import cntools def RequestGet(url, timeout = 1, retry_times=3,sleep_time = 0): res = None if retry_times > 0: for i in range(retry_times): try: res...
null
MyRequest.py
MyRequest.py
py
794
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 16, "usage_type": "call" }, { "api_name": "traceback.print_exc", "line_number": 19, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_...
115178539
import re from collections import Counter class Solution: def mostCommonWord(self, paragraph: str, banned: List[str]) -> str: if not paragraph: return ans = '' l = re.split('\W',paragraph) l = [i.lower() for i in l if i] c = Counter(l) banned = s...
null
leetcode/amazon/mostCommonWord.py
mostCommonWord.py
py
606
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.split", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" } ]
557280374
import requests import os import json import datetime import time from datetime import timedelta import dateutil.parser from bs4 import BeautifulSoup from datetime import datetime import threading # For sports, if you want to add another category, all you need to is add the link to the list alllinks = ["ht...
null
Faster_Generate.py
Faster_Generate.py
py
2,910
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 27, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 29, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 36, "usage_type": "call" }, { "api_name": "json.loads", "line_nu...
626965441
import requests import json import pymysql import re conn = pymysql.connect( host="localhost", port=3306, user="root", password="123456", database="goods", charset="utf8", ) cursor = conn.cursor() url = "http://tlzf12345.tieling.gov.cn:8082/Api/V1/Problem/GetProblemHuiFuGengDuo" payload = "Cha...
null
03/0320/铁岭市.py
铁岭市.py
py
3,250
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymysql.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 29, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 31, "usage_type": "call" }, { "api_name": "requests.request", "li...
304077177
from django.utils import timezone from django.utils.deprecation import MiddlewareMixin class UpdateLastRequestMiddleware(MiddlewareMixin): """Last activity middleware""" def process_view(self, request, view_func, view_args, view_kwargs): """Update user last_request""" assert hasattr( ...
null
accounts/middleware.py
middleware.py
py
597
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.utils.deprecation.MiddlewareMixin", "line_number": 5, "usage_type": "name" }, { "api_name": "django.utils.timezone.now", "line_number": 14, "usage_type": "call" }, { "api_name": "django.utils.timezone", "line_number": 14, "usage_type": "name" } ]
388030834
# -*- coding: utf-8 -*- import re import scrapy from cctv_OpinionMonitor3 import helper from cctv_OpinionMonitor3.items import YoutubeItem from scrapy_splash import SplashRequest from scrapy.conf import settings class YoutubeSearchSpider(scrapy.Spider): name = 'youtube.search' limittime = settings.get('CRAWL_...
null
cctv_OpinionMonitor3/cctv_OpinionMonitor3/spiders/youtube_search.py
youtube_search.py
py
4,435
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "attribute" }, { "api_name": "scrapy.conf.settings.get", "line_number": 12, "usage_type": "call" }, { "api_name": "scrapy.conf.settings", "line_number": 12, "usage_type": "name" }, { "api_name": "scra...
180368815
#!/usr/bin/env python3 '''\ A fake Eureka server. Spinning the whole Spring Framework Netflix Eureka would take too long, thus we are going to fake the responses. ''' import sys import asyncio from aiohttp import web import logging as LOG routes = web.RouteTableDef() # Followjng the responses from https://github...
null
deployments/docker/images/cega/eureka.py
eureka.py
py
1,990
python
en
code
null
code-starcoder2
66
[ { "api_name": "aiohttp.web.RouteTableDef", "line_number": 17, "usage_type": "call" }, { "api_name": "aiohttp.web", "line_number": 17, "usage_type": "name" }, { "api_name": "aiohttp.web.HTTPNoContent", "line_number": 25, "usage_type": "call" }, { "api_name": "aioht...
135625788
from __future__ import unicode_literals import json from moto.core.responses import BaseResponse from .models import ecr_backends class ECSContainerRegistryResponse(BaseResponse): @property def ecr_backend(self): return ecr_backends[self.region] @property def request_params(self): tr...
null
moto/ecr/responses.py
responses.py
py
2,343
python
en
code
null
code-starcoder2
66
[ { "api_name": "moto.core.responses.BaseResponse", "line_number": 8, "usage_type": "name" }, { "api_name": "models.ecr_backends", "line_number": 11, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "json.d...
334177351
from django.http import HttpResponse, Http404, HttpResponseServerError from django.template.context_processors import csrf from django.views.decorators.csrf import csrf_exempt from django.conf import settings from django.shortcuts import render_to_response def index(request): return HttpResponse("Well this is good...
null
Bank/views.py
views.py
py
1,183
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.http.HttpResponse", "line_number": 8, "usage_type": "call" }, { "api_name": "django.template.context_processors.csrf", "line_number": 14, "usage_type": "call" }, { "api_name": "django.conf.settings.BASE_DIR", "line_number": 23, "usage_type": "attribu...
161563148
import requests import sys import urllib from bs4 import BeautifulSoup from urllib.parse import quote class DRAR: def __init__(self,name): self.name=name def get_download_link(self): print('开始搜索小说《%s》'%(self.name)) req=requests.get(url='http://www.zxcs.me/index.php?keyword='+quote(...
null
DFN.py
DFN.py
py
2,198
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.get", "line_number": 13, "usage_type": "call" }, { "api_name": "urllib.parse.quote", "line_number": 13, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 16, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup",...
623669013
import inspect import re import typing from functools import reduce def _python_type_to_schema_type(p): if p == 'str': dtype = 'string' elif p == 'int' or p == 'float': dtype = 'number' elif p in {'typing.List[str]', 'typing.Tuple[str]', 'list', 'tuple'}: dtype = 'array' elif p...
null
jina/schemas/helper.py
helper.py
py
4,778
python
en
code
null
code-starcoder2
66
[ { "api_name": "inspect.signature", "line_number": 76, "usage_type": "call" }, { "api_name": "inspect._empty", "line_number": 85, "usage_type": "attribute" }, { "api_name": "inspect._empty", "line_number": 89, "usage_type": "attribute" }, { "api_name": "typing.Unio...
561505554
import sqlite3 import os conn = sqlite3.connect('rpg_db.sqlite3') cursorObj = conn.cursor() # cursorObj.execute('SELECT name FROM sqlite_master where type= "table"') # for x in cursorObj.fetchall(): # print(x[0]) # How many total Characters are there? print(os.listdir()) print(os.path.abspath(os.getcwd())...
null
module1-introduction-to-sql/mod1_query.py
mod1_query.py
py
3,135
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 4, "usage_type": "call" }, { "api_name": "os.listdir", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.abspath", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_number"...
175714490
import requests import rollbar from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.views.decorators.http import require_POST from podcasts.lookup import get_podcast @require_POST @login_required def submit(req): pod = get_podc...
null
dashboard/views_spotify.py
views_spotify.py
py
1,424
python
en
code
null
code-starcoder2
66
[ { "api_name": "podcasts.lookup.get_podcast", "line_number": 13, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.HttpResponse", "line_number": 17, "usage_type": "call" }, { "api...
176134523
#Types. from typing import Dict, List, IO, Any #Blockchain class. from PythonTests.Classes.Merit.Blockchain import Blockchain #Meros classes. from PythonTests.Meros.RPC import RPC from PythonTests.Meros.Liver import Liver from PythonTests.Meros.Syncer import Syncer #JSON standard lib. import json def ChainAdvanceme...
null
PythonTests/Tests/Merit/ChainAdvancementTest.py
ChainAdvancementTest.py
py
851
python
en
code
null
code-starcoder2
66
[ { "api_name": "PythonTests.Meros.RPC.RPC", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.IO", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 18, "usage_type": "name" }, { "api_name": "typing.List", "lin...
421580907
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import logging import warnings from functools import wraps from main.settings import Config from main.mixins.models import BaseLogMixin, BaseMixin def save_log(logger): # check if model has required interface by inheritance if not issubclass(logger, BaseLogMix...
null
main/utils/logger.py
logger.py
py
1,790
python
en
code
null
code-starcoder2
66
[ { "api_name": "main.mixins.models.BaseLogMixin", "line_number": 15, "usage_type": "argument" }, { "api_name": "main.mixins.models.BaseMixin", "line_number": 16, "usage_type": "argument" }, { "api_name": "warnings.catch_warnings", "line_number": 24, "usage_type": "call" ...
466554039
# -*- coding: utf-8 -*- from flask import Flask , render_template, request, jsonify import time import serial from threading import Thread import threading import struct import sys import string import binascii import datetime # initialisation port serie Arduino # Pour Pi2 # ser = serial.Serial('/dev/ttyAMA0', 9600) ...
null
Pi/webserie.py
webserie.py
py
7,207
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.Serial", "line_number": 18, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 27, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 31, "usage_type": "call" }, { "api_name": "threading.Lock", ...
620392657
import re import inspect import logging import glob from importlib.util import find_spec, module_from_spec from zope.interface import implementer, Interface, Attribute from zope.interface.verify import verifyObject from zope.interface.exceptions import BrokenImplementation from detectem.settings import PLUGIN_PACKAG...
null
detectem/plugin.py
plugin.py
py
4,495
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 54, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 57, "usage_type": "call" }, { "api_name": "zope.interface.verify.verifyObject...
646239994
#!/usr/bin/env python import pygame import random import sigil WIDTH = 800 HEIGHT = 600 SCALE = .01 LIMIT = .01 Screen = sigil.screen.Screen((WIDTH, HEIGHT), "Zoom Test") Camera = sigil.screen.ZoomCamera( 0, 0, WIDTH, HEIGHT, 0, 1000, 0, 1000, SCALE, LIMIT, #S_x=1, #M_x=1, P_x=1 ) Group = sigil...
null
OtherCodeIhaveYetToSiftThrough/Sigil Project/Previous Work/CE proj/zoomExample.py
zoomExample.py
py
4,010
python
en
code
null
code-starcoder2
66
[ { "api_name": "sigil.screen.Screen", "line_number": 12, "usage_type": "call" }, { "api_name": "sigil.screen", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sigil.screen.ZoomCamera", "line_number": 14, "usage_type": "call" }, { "api_name": "sigil.s...
127831375
''' 이 글은 아래 'Data ScienceTutorial for Beginners'를 번역한 글 입니다. 최대한 부드럽게 번역하려 노력했으며, 원글의 표현에서 벗어나지 않는 선에서 초월번역(?)을 했습니다. 원글은 아래 링크를 통해 확인하실 수 있습니다. 영어가 필요하다 싶은 부분들은 원문 그대로 썼으며, 많이 부족하다보니 언제든지 피드백 환영합니다. 함수 파라미터 관련은 번역이 필요하면 번역합니다. ''' # https://www.kaggle.com/kanncaa1/data-sciencetutorial-for-beginners/ # Data Science...
null
transcription/Data_ScienceTutorial_for_Beginners.py
Data_ScienceTutorial_for_Beginners.py
py
10,433
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.check_output", "line_number": 138, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 144, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 146, "usage_type": "call" }, { "api_name": "os.path", "line_n...
312680508
# Megan Salvatore # sources: # https://www.youtube.com/watch?v=VW8qJxy4XcQ # https://stackoverflow.com/questions/16877422/whats-the-best-way-to-parse-a-json-response-from-the-requests-library # https://stackoverflow.com/questions/50588755/api-call-for-marvel-developers-only-receiving-one-page # https://stackabuse.com/...
null
services.py
services.py
py
3,286
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 24, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 25, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 28, "usage_type": "call" }, { "api_name": "flask_httpauth.HTTPBasicAuth"...
228216299
"""Tests for the Block class.""" from nose.tools import assert_equal, assert_raises from codetools.blocks.api import Block from codetools.contexts.api import DataContext def test_basic_01(): """Test basic use of a Block.""" code = 'x = 100\ny = x + 1' b = Block(code) assert_equal(b.inputs, set([])) ...
null
codetools/blocks/tests/test_block.py
test_block.py
py
3,299
python
en
code
null
code-starcoder2
66
[ { "api_name": "codetools.blocks.api.Block", "line_number": 12, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 13, "usage_type": "call" }, { "api_name": "nose.tools.assert_equal", "line_number": 14, "usage_type": "call" }, { "api_na...
168593120
import logging import unittest import uuid from typing import Any import aiounittest from ttls.client import Twinkly, TwinklyFrame _LOGGER = logging.getLogger(__name__) class TwinklyMock(Twinkly): async def send_frame(self, frame: TwinklyFrame) -> None: _LOGGER.debug("MOCK: send_frame()") async de...
null
tests/test_generic.py
test_generic.py
py
1,917
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "ttls.client.Twinkly", "line_number": 13, "usage_type": "name" }, { "api_name": "ttls.client.TwinklyFrame", "line_number": 14, "usage_type": "name" }, { "api_name": "typing...
518279561
import numpy as np import matplotlib.pyplot as plt import networkx as nx from scipy import fftpack from scipy import signal data = np.loadtxt('Ach_spike.txt') W = np.loadtxt('strangr_1_2.txt') data_array = np.loadtxt('Ach_array.txt') plt.figure() plt.scatter(data[:,0],data[:,1],cmap='viridis',linewidth=0.5,color="k",...
null
time_scatter.py
time_scatter.py
py
6,542
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.loadtxt", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
156481768
import os from sense_hat import SenseHat import sqlite3 as lite from datetime import datetime class SensorReading: __temperature = NotImplemented __humidity = NotImplemented __temp_diff = NotImplemented __humid_diff = NotImplemented def __init__(self): sense = SenseHat() sense.cl...
null
record.py
record.py
py
1,544
python
en
code
null
code-starcoder2
66
[ { "api_name": "sense_hat.SenseHat", "line_number": 15, "usage_type": "call" }, { "api_name": "os.popen", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 42, "usage_type": "call" }, { "api_name": "datetime.datetime",...
378537862
from collections import deque start, end = input().split() N = int(input()) S = set([input() for _ in range(N)]) S.add(start) S.add(end) S = list(S) N = len(S) edges = [[] for _ in range(N)] startI, endI = S.index(start), S.index(end) def canChange(S, T): ret = 0 for s, t in zip(S, T): if s != t: ...
null
AtCoder/arc/011c_3.py
011c_3.py
py
1,001
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 31, "usage_type": "call" } ]
268919744
from uuid import UUID import pytest from citrine._session import Session from citrine._utils.functions import scrub_none from citrine.exceptions import BadRequest from citrine.resources.api_error import ValidationError from citrine.resources.material_run import MaterialRunCollection from gemd.entity.bounds.integer_bou...
null
tests/resources/test_material_run.py
test_material_run.py
py
14,414
python
en
code
null
code-starcoder2
66
[ { "api_name": "tests.utils.session.FakeSession", "line_number": 21, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 19, "usage_type": "attribute" }, { "api_name": "tests.utils.session.FakeSession", "line_number": 20, "usage_type": "name" }, { ...
319786075
#!/usr/bin/env python import math from math import sin, cos, pi import rospy import tf from nav_msgs.msg import Odometry from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3 from sensor_msgs.msg import JointState global Angle def callback(msg): global Angle Angle = msg.position[msg...
null
ROS/실습/실습_RVIZ 3D자동차 주행 프로그래밍/소스코드/rviz_odom.py
rviz_odom.py
py
2,009
python
en
code
null
code-starcoder2
66
[ { "api_name": "rospy.Subscriber", "line_number": 18, "usage_type": "call" }, { "api_name": "sensor_msgs.msg.JointState", "line_number": 18, "usage_type": "argument" }, { "api_name": "rospy.init_node", "line_number": 20, "usage_type": "call" }, { "api_name": "rospy...
654473468
import torch from torchvision import datasets, transforms import numpy as np import timeit from collections import OrderedDict from pprint import pformat from knn import knn def compute_score(acc, min_thres, max_thres): if acc <= min_thres: base_score = 0.0 elif acc >= max_thres: base_score = ...
null
Week 2/Assignment 1/main.py
main.py
py
3,611
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.cuda.is_available", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 24, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda.get_d...
578274559
from . import error, tool, types from collections import namedtuple, deque from contextlib import contextmanager import llvmlite.ir as ir import llvmlite.binding as llvm from . tool import extends Chunk = namedtuple('Chunk', 'type code') class Polymorphic(Exception): pass class State(object): _on_init = []...
null
slip/codegen.py
codegen.py
py
19,053
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" }, { "api_name": "tool.Context", "line_number": 35, "usage_type": "call" }, { "api_name": "tool.Context", "line_number": 36, "usage_type": "call" }, { "api_name": "llvmlite.ir.Module",...
640679624
# -*- coding: utf-8 -*- """ Created on Sat Feb 2 16:30:44 2019 @author: SmartDATA """ import scipy.io import numpy as np import torch import torch.nn as nn import torch.utils.data import matplotlib.pyplot as plt import seaborn as sns sns.set_style("whitegrid") import pickle '''-------------------...
null
autoencoder_vibration_signal_correlation_coeff.py
autoencoder_vibration_signal_correlation_coeff.py
py
7,703
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set_style", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.corrcoef", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.array", "line_...
51769916
from kivy.uix.screenmanager import Screen from kivy.properties import ListProperty, StringProperty, BooleanProperty from kivy.properties import NumericProperty from kivy.clock import Clock from kivy.app import App from os import linesep from functools import partial # Self created components from components import Th...
null
app/screens/frontscreen.py
frontscreen.py
py
7,449
python
en
code
null
code-starcoder2
66
[ { "api_name": "kivy.uix.screenmanager.Screen", "line_number": 21, "usage_type": "name" }, { "api_name": "kivy.properties.ListProperty", "line_number": 23, "usage_type": "call" }, { "api_name": "kivy.properties.ListProperty", "line_number": 24, "usage_type": "call" }, ...
258105400
#!/usr/bin/python3 """cppnamelint. Usage: cppnamelint.py check <srcdir> <config> [--includes=<dirs>] [--ignores=<paths>] cppnamelint.py pack <rootdir> <outputdir> cppnamelint.py test <srcdir> <config> cppnamelint.py test-sample <sampledir> cppnamelint.py (-h | --help) cppnamelint.py (-v | --version) c...
null
Script/cppnamelint.py
cppnamelint.py
py
13,213
python
en
code
null
code-starcoder2
66
[ { "api_name": "subprocess.Popen", "line_number": 56, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 56, "usage_type": "name" }, { "api_name": "os.path.basename", "line_number": 68, "usage_type": "call" }, { "api_name": "os.path", "line...
531224072
from __future__ import absolute_import, unicode_literals from celery import shared_task import pusher import time import json from SentimentAnalysis import Sentiment_Analysis as sa from spot_auth.models import Profile class LogPusher(object): def __init__(self, channel, event): self.pusher_client = pushe...
null
spot_auth/tasks.py
tasks.py
py
2,657
python
en
code
null
code-starcoder2
66
[ { "api_name": "pusher.Pusher", "line_number": 13, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 24, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 32, "usage_type": "call" }, { "api_name": "celery.shared_task", "line_nu...
470305251
# -*- coding: utf-8 -*- import falcon from elasticsearch import TransportError from falcon.util import to_query_str from mcod import settings from mcod.histories.models import History from mcod.core.api.parsers import Parser class BaseHandler: def __init__(self, request, response): self.request = reques...
null
mcod/lib/handlers.py
handlers.py
py
5,043
python
en
code
null
code-starcoder2
66
[ { "api_name": "mcod.core.api.parsers.Parser", "line_number": 30, "usage_type": "call" }, { "api_name": "falcon.util.to_query_str", "line_number": 52, "usage_type": "call" }, { "api_name": "mcod.settings.PER_PAGE_DEFAULT", "line_number": 76, "usage_type": "attribute" }, ...
247050350
from js9 import j from .http import HTTPServer from .dhcp import DHCP from .firewall import Firewall from ..abstracts import Collection from .network import Networks from .cloudinit import CloudInit import yaml import time class DestBind: def __init__(self, ipaddress, port): """ Portforward target...
null
JumpScale9Lib/clients/zero_os/sal/gateway/gateway.py
gateway.py
py
26,692
python
en
code
null
code-starcoder2
66
[ { "api_name": "abstracts.Collection", "line_number": 102, "usage_type": "name" }, { "api_name": "abstracts.Collection", "line_number": 153, "usage_type": "name" }, { "api_name": "network.Networks", "line_number": 186, "usage_type": "call" }, { "api_name": "network...
448801483
# -*- coding: utf-8 -*- import configparser from demo.utils.Logger import Logger logger = Logger.get_logger('LOG_FILE.LOG') class ConfigUtils(object): @staticmethod def get_config(file_path): try: config = configparser.ConfigParser() return config.read(file_path) exce...
null
demo/utils/ConfigFileUtils.py
ConfigFileUtils.py
py
3,005
python
en
code
null
code-starcoder2
66
[ { "api_name": "demo.utils.Logger.Logger.get_logger", "line_number": 5, "usage_type": "call" }, { "api_name": "demo.utils.Logger.Logger", "line_number": 5, "usage_type": "name" }, { "api_name": "configparser.ConfigParser", "line_number": 13, "usage_type": "call" }, { ...
9211809
#!/usr/bin/env python import time from pescan.utils import getEpicsPV from ophyd.controls import EpicsSignal class Shutter(object): """Open and close fast shutter. """ def __init__(self, basepvname): self._setEpicsShutterCommands(basepvname) self._setEpicsShutterStatus(basepvname) ...
null
archived/profile_2015_collection/pescan/shuttercontrol.py
shuttercontrol.py
py
1,678
python
en
code
null
code-starcoder2
66
[ { "api_name": "pescan.utils.getEpicsPV", "line_number": 19, "usage_type": "call" }, { "api_name": "pescan.utils.getEpicsPV", "line_number": 20, "usage_type": "call" }, { "api_name": "ophyd.controls.EpicsSignal", "line_number": 21, "usage_type": "call" }, { "api_na...
236957085
# run with cat categorical_features.txt | parallel --jobs 6 python 4_mean_target_value.py {} # coding: utf-8 import sys from time import time import pandas as pd import numpy as np import feather column = sys.argv[1] C = 12 print('processing column %s...' % column) df_all = feather.read_dataframe('tmp/clicks_train_5...
null
4_mean_target_value.py
4_mean_target_value.py
py
3,754
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "feather.read_dataframe", "line_number": 14, "usage_type": "call" }, { "api_name": "feather.read_dataframe", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.re...
290737472
import random from sim.cal_groupsim import cal_2avglinkage import numpy as np from sklearn.metrics import roc_curve, auc import matplotlib.pyplot as plt from sim.cal_individualsim import cal_2indicosine, cal_2indijaccard, cal_2indilin, cal_2indimathurscore def jizhunji(path, method): y_test_jizhun = [] # 0/1 真...
null
result/测量疾病数为4方法为avglinkage的个体疾病方法.py
测量疾病数为4方法为avglinkage的个体疾病方法.py
py
5,236
python
en
code
null
code-starcoder2
66
[ { "api_name": "sim.cal_groupsim", "line_number": 23, "usage_type": "name" }, { "api_name": "sim.cal_groupsim.cal_2avglinkage", "line_number": 23, "usage_type": "call" }, { "api_name": "sim.cal_groupsim", "line_number": 24, "usage_type": "name" }, { "api_name": "si...
316297473
import os import termios import struct import zlib from enum import Enum from fractions import Fraction import logging from artiq.language import core as core_language from artiq.language import units from artiq.language.context import * from artiq.coredevice.runtime import Environment from artiq.coredevice import run...
null
artiq/coredevice/comm_serial.py
comm_serial.py
py
7,178
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 23, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 31, "usage_type": "name" }, { "api_name": "os.open", "line_number": 69...
596884270
from rdflib import Graph class GraphStore: casesInstance = None newsInstance = None articlesInstance = None @staticmethod def getInstance(graph_type): if graph_type == "cases": if GraphStore.casesInstance is None: GraphStore.casesInstance = Graph().parse(f"../c...
null
coda_graph/graph_store.py
graph_store.py
py
912
python
en
code
null
code-starcoder2
66
[ { "api_name": "rdflib.Graph", "line_number": 13, "usage_type": "call" }, { "api_name": "rdflib.Graph", "line_number": 17, "usage_type": "call" }, { "api_name": "rdflib.Graph", "line_number": 21, "usage_type": "call" } ]
112971903
from core.solver_e2e import CaptioningSolver from core.model_attention import CaptionGenerator #from core.rl_solve_debug import CaptioningSolver #from core.rl_model import CaptionGenerator from core.dataset import * #from core.utils import load_coco_data import os,pickle import mxnet as mx def main(): # load train...
null
train.py
train.py
py
2,019
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 25, "usage_type": "call" }, { "api_name": "core.model_attention.CaptionGen...
583091603
import json import requests from datetime import date, timedelta import statistics """finding dates of the 1st day of this month and today""" firstDay = date.today().replace(day=1) lastDay = date.today() """function for getting all the winning numbers for a specific date via OPAP's API""" def get_winning_numbers(da...
null
opap.py
opap.py
py
1,176
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.date.today", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 7, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 8, "usage_type": "call" }, { "api_name": "datetime.date", ...
527078918
from django.shortcuts import render,redirect from django.http import HttpResponse from models import Order,Product,OrderProduct from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core import serializers from django.db.models import Q from django.contrib.auth.models import User from dja...
null
ecomsite/ecommerce/views.py
views.py
py
4,569
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "models.Product.objects.filter", "line_number": 20, "usage_type": "call" }, { "api_name": "models.Product.objects", "line_number": 20, "usage_type": "attribute" }, { ...
144081104
from core.decorators import instance, command from core.db import DB from tools.text import Text from tools.command_param_types import Any from tools.chat_blob import ChatBlob @instance() class CharacterInfoController: def __init__(self): pass def inject(self, registry): self.db: DB = registr...
null
modules/core/whois/character_info_controller.py
character_info_controller.py
py
3,442
python
en
code
null
code-starcoder2
66
[ { "api_name": "core.db.DB", "line_number": 14, "usage_type": "name" }, { "api_name": "tools.text.Text", "line_number": 15, "usage_type": "name" }, { "api_name": "tools.chat_blob.ChatBlob", "line_number": 52, "usage_type": "call" }, { "api_name": "core.decorators.c...
443493292
#! /usr/bin/env python3 import argparse import json import logging import logging.config import os import sys import time import subprocess from logger import setup_custom_logger from concurrent import futures from datetime import datetime # Import config file from configparser import ConfigParser config = ConfigPar...
null
sse-aai-zsa/Zsa/ExtentionService_zsa.py
ExtentionService_zsa.py
py
9,603
python
en
code
null
code-starcoder2
66
[ { "api_name": "configparser.ConfigParser", "line_number": 18, "usage_type": "call" }, { "api_name": "logger.setup_custom_logger", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 31, "usage_type": "call" }, { "api_name": "...
150215303
import logging from math import inf from typing import Dict from gym_fin.envs import fin_base_sim as f from gym_fin.envs.sim_env import expose_to_plugins from gym_fin.envs import utils logger = logging.getLogger(__name__) class PensionSimError(Exception): pass class PensionSim(f.FinBaseSimulation): """Mai...
null
examples/pension.py
pension.py
py
13,224
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 9, "usage_type": "call" }, { "api_name": "gym_fin.envs.fin_base_sim.FinBaseSimulation", "line_number": 16, "usage_type": "attribute" }, { "api_name": "gym_fin.envs.fin_base_sim", "line_number": 16, "usage_type": "name" }...
88267944
# -*- coding: utf-8 -*- import os import sys import random import math import numpy as np import skimage.io import matplotlib import matplotlib.pyplot as plt import cv2 import time from mrcnn.config import Config from datetime import datetime from mrcnn import utils import mrcnn.model as modellib from m...
null
Mask_RCNN_code/test_model.py
test_model.py
py
4,460
python
en
code
null
code-starcoder2
66
[ { "api_name": "mrcnn.config.Config", "line_number": 23, "usage_type": "name" }, { "api_name": "os.getcwd", "line_number": 65, "usage_type": "call" }, { "api_name": "sys.path.append", "line_number": 68, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
475831621
"""The main command line module that defines the "gv_dashboard_data" tool.""" import datetime import click import numpy as np import simplejson as json from loguru import logger from . import DATA_DIR from .courts import CourtInfoByIncident from .geo import * from .homicides import PPDHomicideTotal from .shootings im...
null
gun_violence_dashboard_data/__main__.py
__main__.py
py
6,832
python
en
code
null
code-starcoder2
66
[ { "api_name": "click.group", "line_number": 17, "usage_type": "call" }, { "api_name": "click.version_option", "line_number": 18, "usage_type": "call" }, { "api_name": "streets.StreetHotSpots", "line_number": 35, "usage_type": "call" }, { "api_name": "loguru.logger...
349648451
''' @author: Star @time: 06-03-2018 This is to convert Formatted Code interface into JSON or read JSON file into FCI object ''' import os import json import hashlib from Interfaces.LogWriter import LogWriter from Interfaces.FormattedCodeInterface import FormattedCodeInterface def to_json_str(fci_object): if is...
null
Hester'sWorkSpace/Interfaces/FCIConverter.py
FCIConverter.py
py
2,629
python
en
code
null
code-starcoder2
66
[ { "api_name": "Interfaces.FormattedCodeInterface.FormattedCodeInterface", "line_number": 17, "usage_type": "argument" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "Interfaces.LogWriter.LogWriter", "line_number": 21, "usage_type":...
406767988
""" _SubscriptionList_ Module with data structures to handle PhEDEx subscriptions in bulk. """ import logging from WMCore.WMException import WMException PhEDEx_VALID_SUBSCRIPTION_PRIORITIES = ['low', 'normal', 'high', 'reserved'] class PhEDExSubscriptionException(WMException): """ _PhEDExSubscriptionExcept...
null
src/python/WMCore/Services/PhEDEx/DataStructs/SubscriptionList.py
SubscriptionList.py
py
11,967
python
en
code
null
code-starcoder2
66
[ { "api_name": "WMCore.WMException.WMException", "line_number": 14, "usage_type": "name" }, { "api_name": "logging.error", "line_number": 194, "usage_type": "call" } ]
150103480
import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import OneHotEncoder from sklearn.compose import ColumnTransformer from sklearn.metrics import confusion_matrix, accuracy_score from sklearn.ensemble import RandomForestClassifier from sklearn.svm import SVC #Data rea...
null
support_vector_machine_dataset1.py
support_vector_machine_dataset1.py
py
1,552
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.LabelEncoder", "line_number": 14, "usage_type": "call" }, { "api_name": "sklearn.preprocessing.OneHotEncoder", "line_number": 15, "usage_type": "call" }, {...
264763139
import yaml import numpy as np from functools import reduce import operator from astropy import wcs import astropy.units as u def OTF(source_ra, source_dec, time_step, start_time, rotation, x_length, y_length, separation, parameter_file_name): #function to append points, needed for OTF scan def _append(x,...
null
track.py
track.py
py
5,442
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.cos", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.sin", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.deg2rad", "line_number": ...
187005755
# Copyright 2019 Jij Inc. # 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, softwa...
null
openjij/model/model.py
model.py
py
6,519
python
en
code
null
code-starcoder2
66
[ { "api_name": "cimod.make_BinaryQuadraticModel", "line_number": 48, "usage_type": "call" }, { "api_name": "openjij.SPIN", "line_number": 61, "usage_type": "attribute" }, { "api_name": "cxxjij.graph", "line_number": 87, "usage_type": "attribute" }, { "api_name": "c...
626296960
# import libraries import tables as tb import numpy as np import pandas as pd import h5py import healpy as hp # Define simulation parameters nside = 16 npix = hp.nside2npix(nside) pix = range(0, npix) source_energies=[59, 186, 356, 662, 1332] #source_energies=[356, 662, 1332] nDet=4 detector='lamp_cllbc' file_prefix='...
null
Healpix/combinecllbcfiles.py
combinecllbcfiles.py
py
1,509
python
en
code
null
code-starcoder2
66
[ { "api_name": "healpy.nside2npix", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.empty", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.empty", "line_num...
435196263
import argparse import logging import colorlog from ga_snake.genetic_training import GeneticTraining log_levels = { 'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'error': logging.ERROR, 'fatal': logging.FATAL } log_names = list(log_levels) def set_up_logging(args): ...
null
ga_snake/__main__.py
__main__.py
py
4,465
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 10, "usage_type": "attribute" }, { "api_name": "logging.WARNING", "line_number": 11, "usage_type": "attribute" }, { "api_name": "logging.ERRO...
159717644
import re from helper import getSubtitles, getStartTimes TIME_STAMP_PATTERN = r'[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} -->' KR_OPEN_TAG_PATTERN = r'<c.korean><.*?>' KR_CLOSE_TAG_PATTERN = r'<\/.*?><\/c.korean>' GENERAL_OPEN_TAG_PATTERN = r'<.*?><c.*?>' GENERAL_CLOSE_TAG_PATTERN = r'<\/.*?><\/c.*?>' ''' OUTPUT {'00:58:57...
null
KoreanSubtitlesParser/dumpJsonForKoPos/parseLines.py
parseLines.py
py
1,833
python
en
code
null
code-starcoder2
66
[ { "api_name": "helper.getSubtitles", "line_number": 29, "usage_type": "call" }, { "api_name": "helper.getStartTimes", "line_number": 30, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 41, "usage_type": "call" }, { "api_name": "re.sub", "line_nu...
8229577
#! C:\Python34\python.exe # -*- coding: utf-8 -*- from urllib.request import Request, urlopen import bs4 as BSoup from threading import Thread header = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11', 'Accept': 'text/html,application...
null
Site.py
Site.py
py
3,552
python
en
code
null
code-starcoder2
66
[ { "api_name": "threading.Thread", "line_number": 18, "usage_type": "name" }, { "api_name": "threading.Thread.__init__", "line_number": 20, "usage_type": "call" }, { "api_name": "threading.Thread", "line_number": 20, "usage_type": "name" }, { "api_name": "urllib.re...
29581136
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on 2020/7/1 22:30 @author: merci """ import time import torch.optim as optim from dataLoader import * from model import * from utils import * from test import test from train import train def main(): device = torch.device('cuda:1' if torch.cu...
null
main.py
main.py
py
4,246
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.optim.device", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.optim", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.optim.cuda.is_available", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.op...
81852096
import pytest import requests import os,sys sys.path.append(os.getcwd()) import utils.exceltools as extool import utils.dbtools as db import utils.decorate as de @de.prt @de.geturl("获取问题详情",0) def test_01_getquestiondetail_success(res,url,head): assert res.json()["status"] == 200#状态码 assert res.status_code == ...
null
测谈网接口自动化1/case/获取接口/test_07_getquestiondetail.py
test_07_getquestiondetail.py
py
2,002
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 4, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 4, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 4, "usage_type": "call" }, { "api_name": "utils.decorate.prt", "line_n...
364338604
import os import pandas as pd from sklearn.model_selection import train_test_split from collections import namedtuple import csv def traing_data(file_name): fn = os.path.join(os.path.dirname(__file__), file_name) data = pd.read_csv(fn, sep='\t', lineterminator='\n', names=['id', 'sent', 'tweet']) data_cl...
null
src/helpers/data.py
data.py
py
2,782
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_nu...
257099080
import cv2 class FaceDetect: def __init__(self): self._load_file_cascade = './data/haarcascade_frontalface_alt.xml' self._load_file_girl = './data/girl.jpg' def read_file(self): cascade = cv2.CascadeClassifier(self._load_file_cascade) img = cv2.imread(self._load_file_girl) ...
null
cnn2/face_detect.py
face_detect.py
py
775
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.rectangle", "line_number": 18, "usage_type": "call" }, { "api_name": "cv2.imwrite", "line...
357026470
import requests import json from audio import play def post_request(url, data): print("Request sent to", url, " with data : ", data) r = requests.post(url = url, data = data) if(r.status_code == 200): print("Server answers : ", r.text) if(r.text.find("yes") != -1): play('sons/co...
null
client/server.py
server.py
py
564
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 7, "usage_type": "call" }, { "api_name": "audio.play", "line_number": 11, "usage_type": "call" }, { "api_name": "audio.play", "line_number": 13, "usage_type": "call" }, { "api_name": "audio.play", "line_number": 15...
627776653
# -*- coding: utf-8 -*- """ Created on Fri Apr 2 15:32:25 2021 @author: Admin """ import pandas as pd df = pd.read_pickle('siteA_weekly_data_20191118_20191124.pickle') #%% df['category_depth3'] = df.apply(lambda x: x['category'].split(' > ')[2], axis = 1) list_depth3 = df['category_depth3'].unique() df_res = d...
null
src/.ipynb_checkpoints/test-checkpoint.py
test-checkpoint.py
py
703
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_pickle", "line_number": 9, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rc", "line_number": 24, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 24, "usage_type": "name" }, { "api_name": "matplotlib.p...
393733080
from extra_geom.detectors import DetectorGeometryBase, GeometryFragment from cfelpyutils.crystfel_utils import load_crystfel_geometry class CrystfelGeom(DetectorGeometryBase): """CrystFEL geometry for a general detector This assumes that all panels have the same number & size of pixels. For now, it tr...
null
src/controller/panoscDEMO/cfel_geom.py
cfel_geom.py
py
2,439
python
en
code
null
code-starcoder2
66
[ { "api_name": "extra_geom.detectors.DetectorGeometryBase", "line_number": 4, "usage_type": "name" }, { "api_name": "extra_geom.detectors.GeometryFragment.from_panel_dict", "line_number": 26, "usage_type": "call" }, { "api_name": "extra_geom.detectors.GeometryFragment", "line_...
605962711
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from swagger_server.models.base_model_ import Model from swagger_server.models.courier_item import CourierItem # noqa: F401,E501 from swagger_server import util clas...
null
swagger_server/models/couriers_post_request.py
couriers_post_request.py
py
1,855
python
en
code
null
code-starcoder2
66
[ { "api_name": "swagger_server.models.base_model_.Model", "line_number": 13, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 18, "usage_type": "name" }, { "api_name": "swagger_server.models.courier_item.CourierItem", "line_number": 18, "usage_type": "na...
404359753
from flask_restful import Resource, request from models.achievement_model import Achievement, AchievementSchema from models.base_model import db from flask_login import login_required from auth import ( refresh_session, is_authorized_view, unauthorized ) achievement_schema = AchievementSchema() achievem...
null
resources/Achievement.py
Achievement.py
py
801
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.achievement_model.AchievementSchema", "line_number": 13, "usage_type": "call" }, { "api_name": "models.achievement_model.AchievementSchema", "line_number": 14, "usage_type": "call" }, { "api_name": "flask_restful.Resource", "line_number": 17, "usage_...
623170087
import numpy as np import cv2 import math face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') cap = cv2.VideoCapture(1) #cv2.namedWindow("original") cv2.namedWindow("smooth") frameSize = 500 ratio = 0.75 def getCoords(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = face_ca...
null
Testing/Tracking.py
Tracking.py
py
3,540
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.CascadeClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.VideoCapture", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", ...
463100072
# -*- coding: utf-8 -*- import os import codecs import itertools from smalltalk_replicas import SmalltalkReplicas from simple_facts_storage import SimpleFactsStorage class Files3FactsStorage(SimpleFactsStorage): """ Класс читает факты из нескольких файлов, игнорируя идентификатор собеседника. ...
null
PyModels/bot/files3_facts_storage.py
files3_facts_storage.py
py
4,028
python
en
code
null
code-starcoder2
66
[ { "api_name": "simple_facts_storage.SimpleFactsStorage", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, "usage_type": "attribute" }, { "api_name": "cod...
209216786
import json import shlex import subprocess from json import JSONDecodeError from src.main.python.tranquilitybase.lib.common.FileUtils import FileUtils # --- Logger --- import inspect from src.main.python.tranquilitybase.lib.common.local_logging import get_logger, get_frame_name logger = get_logger(get_frame_name(ins...
null
src/main/python/tranquilitybase/gcpdac/main/core/shell_wrappers/shell_utils.py
shell_utils.py
py
5,184
python
en
code
null
code-starcoder2
66
[ { "api_name": "src.main.python.tranquilitybase.lib.common.local_logging.get_logger", "line_number": 12, "usage_type": "call" }, { "api_name": "src.main.python.tranquilitybase.lib.common.local_logging.get_frame_name", "line_number": 12, "usage_type": "call" }, { "api_name": "inspe...
298250750
import numpy as np import mfanalysis as mf import utils import config as cfg import h5py import os from joblib import Parallel, delayed current_dir = os.path.dirname(os.path.abspath(__file__)) N_JOBS = 4 CONDITIONS = ['interictal', 'preictal'] #['test'] test_data_loc = '/volatile/omar/Documents/projects/seizure...
null
kaggle/extract_baseline_features.py
extract_baseline_features.py
py
5,701
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 11, "usage_type": "call" }, { "api_name": "mfanalysis.MFA", "li...
586105144
""" This script checks if a submission xls contains all samples that exist in the submitted files """ # pylint: disable=C0103 from __future__ import print_function import sys import argparse import utils def get_sample_diff(file_path, file_xml, sample_xml): submission_samples = utils.get_samples_from_xml(sample_x...
null
samples_checker/samples_checker/check_samples.py
check_samples.py
py
2,537
python
en
code
null
code-starcoder2
66
[ { "api_name": "utils.get_samples_from_xml", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.get_files_from_xml", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.get_sample_difference", "line_number": 18, "usage_type": "call" }, { "a...
57009937
import socket import json from datetime import datetime # 2.2.0-A serverPort = 5001 # Create a UDP socket serverSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Bind the socket to the port serverSocket.bind(('', serverPort)) print("The server is ready to receive") print("") chunks = {} hostedContents = {}...
null
Content_Discovery.py
Content_Discovery.py
py
1,579
python
en
code
null
code-starcoder2
66
[ { "api_name": "socket.socket", "line_number": 9, "usage_type": "call" }, { "api_name": "socket.AF_INET", "line_number": 9, "usage_type": "attribute" }, { "api_name": "socket.SOCK_DGRAM", "line_number": 9, "usage_type": "attribute" }, { "api_name": "datetime.dateti...
66890506
from selenium.webdriver.common.by import By import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class AlertListLocators(object): CSS_ALERT_INV_CARD_LIST = [ ".alert-chart.ng-scope._md.layout-align-center-center.layout-row", "[ng-if='alertListCtrl.sel...
null
lib/locator/alert.py
alert.py
py
1,743
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 4, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 5, "usage_type": "call" } ]
632901223
#!/usr/bin/env python import glob import os import sys import re import subprocess import unittest from setuptools import find_packages, setup, Extension from Cython.Build import cythonize from setuptools.command.test import test as TestCommand import numpy as np from toast.mpirunner import MPITestRunner def ge...
null
setup.py
setup.py
py
4,330
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.isfile", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_number": 23, "usage_type": "attribute" }, { "api_name": "re.match", "line_number": 26, "usage_type": "call" }, { "api_name": "os.path.join", "line_number"...
542589853
import MeCab from gensim import models def _split_to_words(text, to_stem=False): """ 入力: 'すべて自分のほうへ' 出力: tuple(['すべて', '自分', 'の', 'ほう', 'へ']) """ tagger = MeCab.Tagger('mecabrc') # 別のTaggerを使ってもいい mecab_result = tagger.parse(text) info_of_words = mecab_result.split('\n') words = [] ...
null
lib/utils.py
utils.py
py
2,687
python
en
code
null
code-starcoder2
66
[ { "api_name": "MeCab.Tagger", "line_number": 10, "usage_type": "call" }, { "api_name": "gensim.models.doc2vec.LabeledSentence", "line_number": 90, "usage_type": "call" }, { "api_name": "gensim.models.doc2vec", "line_number": 90, "usage_type": "attribute" }, { "api...
363854111
from setuptools import setup from setuptools import find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name="bmtool", version="0.2.3", author="Tyler Banks", author_email="tbanks@mail.missouri.edu", description="BMTools", long_description=long_description, ...
null
setup.py
setup.py
py
1,356
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 41, "usage_type": "call" } ]
236584756
""" Techable Object Recognizer - consists of two deep learning models - 1) object localizer - 2) object classifier written by Kyungjun Lee """ from TOR_localizer import Localizer from TOR_classifier import Classifier # retrain function from retrain import retrain_model import cv2 """ Recognize class - recognizes a...
null
TOR.py
TOR.py
py
3,747
python
en
code
null
code-starcoder2
66
[ { "api_name": "TOR_localizer.Localizer", "line_number": 32, "usage_type": "call" }, { "api_name": "TOR_classifier.Classifier", "line_number": 36, "usage_type": "call" }, { "api_name": "TOR_localizer.Localizer", "line_number": 67, "usage_type": "call" }, { "api_nam...
283383753
from django.db import models, migrations import mayan.apps.common.validators class Migration(migrations.Migration): dependencies = [ ('converter', '0006_auto_20150708_0120'), ] operations = [ migrations.AlterField( model_name='transformation', name='arguments', ...
null
mayan/apps/converter/migrations/0007_auto_20150711_0656.py
0007_auto_20150711_0656.py
py
683
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.db.migrations.Migration", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 6, "usage_type": "name" }, { "api_name": "django.db.migrations.AlterField", "line_number": 12, "usage_type": "call" }, {...
194364775
from django.core.exceptions import ObjectDoesNotExist from home.util_base import BaseUtil from project.models import ProjectFile from consult.models import ConsultFile from home.forms.file_forms import NewProjectFileForm, EditProjectFileForm from home.forms.file_forms import NewConsultFileForm, EditConsultFileForm ...
null
home/shared_utils/util_files.py
util_files.py
py
4,331
python
en
code
null
code-starcoder2
66
[ { "api_name": "home.util_base.BaseUtil", "line_number": 14, "usage_type": "name" }, { "api_name": "home.forms.file_forms.NewProjectFileForm", "line_number": 39, "usage_type": "call" }, { "api_name": "home.forms.file_forms.NewConsultFileForm", "line_number": 46, "usage_typ...
95308815
import logging import json import operator from jinja2 import PackageLoader, Environment import _pysha3 as sha3 import hashlib log = logging.getLogger(__name__) class Issue: def __init__( self, contract, function_name, address, swc_id, title, bytecode, ...
null
mythril/analysis/report.py
report.py
py
4,037
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "_pysha3.keccak_256", "line_number": 40, "usage_type": "call" }, { "api_name": "jinja2.Environment", "line_number": 85, "usage_type": "call" }, { "api_name": "jinja2.Package...
177583635
#!/usr/bin/env python3 # coding: utf-8 """ 此脚本用于从s3下载服务包, 入参1:-s <服务名> 入参2:-p <下载包的存储路径,其中包名需要跟原始包名一致(去掉包名中的'-dist')> """ import boto3 import argparse import glob import os bucket = 'xxxxxxx' aws_access_key_id='xxxxxxxxx' aws_secret_access_key='xxxxxxxxxxxxxxxxxx' def getArg(): argparser = argparse.ArgumentParse...
null
myansible/pb_data/project/roles/rcx-im/files/scripts/download_from_s3.py
download_from_s3.py
py
1,515
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "boto3.Session", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 40, "usage_type": "call" }, { "api_name": "os.path", "lin...
576873188
#!/usr/bin/python3 # encoding: utf-8 # @Time :17-09-20 下午5:14 # @Author : xiaorui # @File : xiami_music.py # @Software: PyCharm import os import time from urllib.parse import quote import requests from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui i...
null
xiami_music.py
xiami_music.py
py
2,745
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 27, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 27, "usage_type": "name" }, { "api_name": "selenium.webdriver.support.ui.WebDriverWait", "line_number": 36, "usage_type": "call" }, ...
568198620
from PyQt5 import QtCore from PyQt5 import QtNetwork import logging import struct from enum import Enum from math import sin import Adafruit_BBIO.ADC as ADC import Adafruit_BBIO.PWM as PWM import time log = logging.getLogger("drc bbb") AIN0 = "AIN0" PMIN = 0.025 PMAX = 0.125 PRANGE = PMAX-PMIN class state(Enum): ...
null
bbb/drc.py
drc.py
py
4,439
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "enum.Enum", "line_number": 18, "usage_type": "name" }, { "api_name": "PyQt5.QtCore.QObject", "line_number": 26, "usage_type": "attribute" }, { "api_name": "PyQt5.QtCore", ...
351095013
import streamlit as st import pandas as pd import numpy as np import base64 import pickle #streamlit def main(): st.set_page_config(page_title = 'Simulador - Case Ifood',\ page_icon = 'logo_dh.jpeg', layout='wide', initial_sidebar_st...
null
deploy_streamlit_case_ifood.py
deploy_streamlit_case_ifood.py
py
4,943
python
en
code
null
code-starcoder2
66
[ { "api_name": "streamlit.set_page_config", "line_number": 10, "usage_type": "call" }, { "api_name": "streamlit.columns", "line_number": 15, "usage_type": "call" }, { "api_name": "streamlit.expander", "line_number": 18, "usage_type": "call" }, { "api_name": "stream...
71307789
from __future__ import print_function, division import os, re, csv, math, codecs import datetime import argparse from rep_reader import RepReader from keras_spreadsheet_classifier import * from tqdm import tqdm import itertools def _str_to_bool(s): """Convert string to bool (in argparse context).""" if s.lowe...
null
04_expt_type_classifiers/classify_spreadsheet.py
classify_spreadsheet.py
py
3,754
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 26, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "...
420293026
import logging mpl_logger = logging.getLogger('matplotlib') mpl_logger.setLevel(logging.WARNING) from ROOT import TF1,TMath,Double from matplotlib import container import rootpy import defs import re import matplotlib from rootpy.plotting import Canvas from rootpy.plotting import Legend from rootpy.plotting import Gr...
null
DrawFinalFits.py
DrawFinalFits.py
py
17,492
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 2, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 3, "usage_type": "attribute" }, { "api_name": "rootpy.plotting.Graph", "line_number": 53, "usage_type": "call" }, { "api_name": "rootpy.plo...
523196829
#:coding=utf8: from django.conf.urls import patterns, url from django.views.generic import RedirectView from homepage.blog.feeds import ( LatestEnglishBlogEntries, LatestJapaneseBlogEntries, ) from homepage.redirects import redirect_to urlpatterns = patterns( 'django.views.generic.simple', # Old ta...
null
homepage/homepage/blog/urls.py
urls.py
py
1,424
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.patterns", "line_number": 13, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 17, "usage_type": "call" }, { "api_name": "homepage.redirects.redirect_to", "line_number": 17, "usage_type": "argument" }, { ...
24431949
from django.urls import path from . import views # URL mapování - seznam URL adres pro aplikaci bazar urlpatterns = [ path('', views.index, name='index'), path('list', views.BazarListView.as_view(), name='list'), path('detail/<int:pk>/', views.BazarDetailView.as_view(), name='detail'), path('zbozi/crea...
null
bazar/urls.py
urls.py
py
552
python
en
code
null
code-starcoder2
66
[ { "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", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", ...
216464729
from openpyxl import Workbook from bs4 import BeautifulSoup from selenium import webdriver driver = webdriver.Chrome('chromedriver') url = "https://mail.naver.com/#%7B%22fClass%22%3A%22list%22%2C%22oParameter%22%3A%7B%22page%22%3A1%2C%22sortField%22%3A1%2C%22sortType%22%3A0%2C%22folderSN%22%3A%22-1%22%2C%22type...
null
datasuzip.py
datasuzip.py
py
1,347
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 5, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 5, "usage_type": "name" }, { "api_name": "bs4.BeautifulSoup", "line_number": 11, "usage_type": "call" }, { "api_name": "openpyxl...
415148760
import sys, json, time, logging, logs.config.server_config_log, decorators, select from config import * from socket import * from descriptors import * from meta import * from server_database import * log = logging.getLogger('Server_log') logger = decorators.Log(log) #класс серверного сокета class ServerSocket(socket)...
null
Block4/Homework4/server.py
server.py
py
16,605
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "decorators.Log", "line_number": 9, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 46, "usage_type": "call" }, { "api_name": "json.dumps", "line_numb...
575099132
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import argparse import pickle import json import pdb import cv2 from os import listdir from pathlib import Path from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split from widedeep.utils.data_util...
null
prepare_data_t1.py
prepare_data_t1.py
py
7,186
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.options", "line_number": 17, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "attribute" }, { "api_name": "widedeep.utils.data_utils.label_encode", "line_number": 75, "usage_type": "call" }, { "...
108673523
import datetime import threading import schedule from time import sleep def Time_Get(): dt_now = datetime.datetime.now() str_day = dt_now.strftime("%Y年%m月%d日") str_time = dt_now.strftime("%H:%M:%S") #print(str_day) #print(str_day) return str_day ,str_day def Time_Get2(): #02 スケジュー...
null
TodayTime.py
TodayTime.py
py
511
python
en
code
null
code-starcoder2
66
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "schedule.every", "line_number": 17, "usage_type": "call" }, { "api_name": "schedule.ru...
217965365
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) def ecdf(data): """ Compute x, y values for an empirical distribution """ #data is a vector of values x =np.sort(data) ...
null
Day_3/lesson23-24_ex3.py
lesson23-24_ex3.py
py
880
python
en
code
null
code-starcoder2
66
[ { "api_name": "seaborn.set", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.sort", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.arange", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number":...
469879771
# -*- coding:utf-8 -*- from PIL import Image, ImageDraw, ImageFont def draw_num(img,number): draw = ImageDraw.Draw(img) fontsize = int(min(img.size) / 5) numFont = ImageFont.truetype(font = "C:\\Windows\\Fonts\\arial.ttf", size = fontsize) draw.text((img.size[0] - fontsize, 0), number, fill = ...
null
the 0000th problem.py
the 0000th problem.py
py
598
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.ImageDraw.Draw", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.ImageDraw", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.ImageFont.truetype", "line_number": 8, "usage_type": "call" }, { "api_name": "PIL.ImageFont", ...