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
517664945
# -*- coding: utf-8 -*- """Provides GUIs to find files containing combinations of keywords and move files. @author: Donald Erb Created on Mon Sep 2 22:08:12 2019 """ from pathlib import Path import shutil import itertools import PySimpleGUI as sg from utils import safely_close_window, WindowCloseError, validate_in...
null
Data Processing/file_organizer.py
file_organizer.py
py
22,264
python
en
code
null
code-starcoder2
66
[ { "api_name": "PySimpleGUI.Text", "line_number": 97, "usage_type": "call" }, { "api_name": "PySimpleGUI.Input", "line_number": 98, "usage_type": "call" }, { "api_name": "PySimpleGUI.FolderBrowse", "line_number": 100, "usage_type": "call" }, { "api_name": "PySimple...
522574806
from getinput import get_input import itertools import textwrap from grid import Loc2, Loc2Grid from enum import Enum from priorityqueue import PriorityQueue from typing import List, Tuple class CaveItem(Enum): NOTHING = 0 TORCH = 1 CLIMBING = 2 class RegionType(Enum): ROCKY = 0 WET = 1 NARR...
null
2018/day22.py
day22.py
py
4,831
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 10, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 16, "usage_type": "name" }, { "api_name": "grid.Loc2", "line_number": 80, "usage_type": "call" }, { "api_name": "grid.Loc2.adj_L1", "line_number": 9...
369235027
#!/usr/bin/env python3 from enum import Enum from collections import deque class GridSlot(Enum): GRID_WALL = 1 GRID_OPEN = 2 def __repr__(self): return "#" if self.value == 1 else "." class Goblin(object): def __init__(self, x, y): self.x = x self.y = y self.hp = 20...
null
day15/part2.py
part2.py
py
8,129
python
en
code
null
code-starcoder2
66
[ { "api_name": "enum.Enum", "line_number": 7, "usage_type": "name" }, { "api_name": "collections.deque", "line_number": 176, "usage_type": "call" } ]
645026470
import json import time import redis from datetime import datetime, timedelta from functools import partial, wraps from pytz import timezone from uuid import uuid4 from redis.exceptions import WatchError g_redis_db = redis.Redis() success = 0 TZ = "Asia/Shanghai" def cache_with_lock(func=None, *, lock_name=None, df...
null
libs/utils/helper.py
helper.py
py
5,014
python
en
code
null
code-starcoder2
66
[ { "api_name": "redis.Redis", "line_number": 10, "usage_type": "call" }, { "api_name": "functools.partial", "line_number": 19, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 29, "usage_type": "call" }, { "api_name": "functools.wraps", "line_...
213650003
""" Tools for vk-bot """ from module import Blueprint from typing import Optional bp = Blueprint() __all__ = ( "get_chat", "send_msg", "get_msg_id", "get_msg_ids", "get_history", "edit_msg", "get_attachments", "bp" ) async def get_attachments(message_id: int) -> Optional[str]: attachments...
null
dutymanager/units/utils.py
utils.py
py
2,200
python
en
code
null
code-starcoder2
66
[ { "api_name": "module.Blueprint", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" } ]
372249876
import os import requests import signal import time import urllib from bs4 import BeautifulSoup from selenium import webdriver from urllib.parse import urlparse, unquote from .caching import FileCache, CacheControlAdapter from ricecooker.config import LOGGER, PHANTOMJS_PATH, STRICT # create a default session with ...
null
ricecooker/utils/html.py
html.py
py
5,635
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.Session", "line_number": 17, "usage_type": "call" }, { "api_name": "caching.FileCache", "line_number": 18, "usage_type": "call" }, { "api_name": "caching.CacheControlAdapter", "line_number": 19, "usage_type": "call" }, { "api_name": "riceco...
638047947
from typing import Any, Optional, Sequence, List import pandas as pd from ray.util.data import MLDataset as MLDatasetType from xgboost_ray.data_sources.data_source import DataSource, RayFileType class MLDataset(DataSource): """Read from distributed Ray MLDataset. The Ray MLDataset is a distributed dataset b...
null
xgboost_ray/data_sources/ml_dataset.py
ml_dataset.py
py
1,433
python
en
code
null
code-starcoder2
66
[ { "api_name": "xgboost_ray.data_sources.data_source.DataSource", "line_number": 8, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 22, "usage_type": "name" }, { "api_nam...
37986312
import numpy as np import torch import viz import utils from create_explainer import get_explainer from preprocess import get_preprocess import copy from collections import Iterable import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import torchvision.transforms as transforms impo...
null
plot/sparsity_and_vanilla_overlap.py
sparsity_and_vanilla_overlap.py
py
2,298
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.use", "line_number": 16, "usage_type": "call" }, { "api_name": "glob.iglob", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_...
633779486
# coding:utf-8 __author__ = 'lenovo' from selenium.webdriver import Remote from selenium import webdriver def browser(): dr = webdriver.Firefox() return dr if __name__ == "__main__": dr = browser() dr.get('http://www.baidu.com') dr.quit()
null
Page object test/bbs/report/driver.py
driver.py
py
261
python
en
code
null
code-starcoder2
66
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" } ]
429750240
#!/usr/bin/env python3 from DataBase import FinVizDataBase from tabulate import tabulate import getopt import sys strategies =["RSI_startegy", "holly_grail", "relative_volume", "ATR", "Extremes52W", "OverBoughtSold", "MovingAverages", ...
null
scripts/analyze.py
analyze.py
py
5,165
python
en
code
null
code-starcoder2
66
[ { "api_name": "getopt.getopt", "line_number": 37, "usage_type": "call" }, { "api_name": "getopt.GetoptError", "line_number": 38, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 60, "usage_type": "call" }, { "api_name": "sys.exit", "line_n...
573890703
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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...
null
src/rogerthat/to/news.py
news.py
py
26,289
python
en
code
null
code-starcoder2
66
[ { "api_name": "mcfw.properties.unicode_property", "line_number": 39, "usage_type": "call" }, { "api_name": "mcfw.properties.unicode_property", "line_number": 40, "usage_type": "call" }, { "api_name": "mcfw.properties.long_property", "line_number": 41, "usage_type": "call"...
306482207
import torch import torchvision # using cuda use_cuda = torch.cuda.is_available() from torch.utils.tensorboard import SummaryWriter # tensorboard # Writer will output to ./runs/ directory by default # must be in python scripts folder (parent folder of runs) # tensorboard --logdir=runs -> Run on command li...
null
scripts/mnist_pytorch_fp.py
mnist_pytorch_fp.py
py
10,918
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.cuda.is_available", "line_number": 5, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 5, "usage_type": "attribute" }, { "api_name": "torch.backends", "line_number": 28, "usage_type": "attribute" }, { "api_name": "torch.manua...
85797183
import cv2 import numpy as np import argparse import os import datetime import random import math from tqdm import tqdm import datetime import sys sys.path.append('..\Common') from pyBoost import * from vocBoost import * class FUSION_TYPE: PASTE = 0 CV2_NORMAL_CLONE = 1 CV2_MIXED_CLONE = 2 SMOOTH_B...
null
pyFusion/pyFusion_recode.py
pyFusion_recode.py
py
19,366
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 13, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "numpy.concatenate", "line_number": 111, "usage_type": "call" }, { "api_name": "numpy.concatenate", ...
240345683
import requests import json def ocr_space_file(filename, overlay=False, api_key='helloworld', language='eng'): payload = {'isOverlayRequired': overlay, 'apikey': '722d5f934d88957', 'language': language, 'OCREngine': 2 } with open(filename, 'rb') as f...
null
scripty_v1/ScriptyHome/scripty_ocr.py
scripty_ocr.py
py
1,229
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 12, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 27, "usage_type": "call" }, { "api_name": "json.loads", "line_number"...
491692458
from django.shortcuts import render from django.views.generic import ListView,DetailView from .models import Sale from .forms import SalesSearchForm import pandas as pd from reports.forms import ReportForm from .utils import * from django.contrib.auth.mixins import LoginRequiredMixin # Create your views here. def home...
null
src/sales/views.py
views.py
py
2,972
python
en
code
null
code-starcoder2
66
[ { "api_name": "forms.SalesSearchForm", "line_number": 18, "usage_type": "call" }, { "api_name": "reports.forms.ReportForm", "line_number": 19, "usage_type": "call" }, { "api_name": "models.Sale.objects.all", "line_number": 21, "usage_type": "call" }, { "api_name":...
211081355
from __future__ import print_function from __future__ import absolute_import from __future__ import division try: basestring except NameError: basestring = str import compas_rhino from compas.utilities import iterable_like from compas_rhino.artists._primitiveartist import PrimitiveArtist __all__ = ['CircleA...
null
src/compas_rhino/artists/circleartist.py
circleartist.py
py
3,375
python
en
code
null
code-starcoder2
66
[ { "api_name": "compas_rhino.artists._primitiveartist.PrimitiveArtist", "line_number": 18, "usage_type": "name" }, { "api_name": "compas_rhino.draw_circles", "line_number": 44, "usage_type": "call" }, { "api_name": "compas.utilities.iterable_like", "line_number": 79, "usag...
437177809
import pytest import tequila.quantumchemistry as qc import numpy import os, glob import tequila.simulators.simulator_api from tequila.objective import ExpectationValue from tequila.quantumchemistry.encodings import known_encodings from tequila.simulators.simulator_api import simulate HAS_PYSCF = "pyscf" in qc.INSTALL...
null
tests/test_chemistry.py
test_chemistry.py
py
18,764
python
en
code
null
code-starcoder2
66
[ { "api_name": "tequila.quantumchemistry.INSTALLED_QCHEMISTRY_BACKENDS", "line_number": 11, "usage_type": "attribute" }, { "api_name": "tequila.quantumchemistry", "line_number": 11, "usage_type": "name" }, { "api_name": "tequila.quantumchemistry.INSTALLED_QCHEMISTRY_BACKENDS", ...
414713997
"""Utility functions for OSA pipeline provenance.""" import os from importlib.resources import files from pathlib import Path from osa.configs import options from osa.configs.config import cfg from osa.utils.utils import date_to_dir, get_lstchain_version __all__ = ["parse_variables", "get_log_config"] REDUCTION_TA...
null
osa/provenance/utils.py
utils.py
py
8,884
python
en
code
null
code-starcoder2
66
[ { "api_name": "osa.utils.utils.date_to_dir", "line_number": 39, "usage_type": "call" }, { "api_name": "osa.configs.options.date", "line_number": 39, "usage_type": "attribute" }, { "api_name": "osa.configs.options", "line_number": 39, "usage_type": "name" }, { "api...
315094274
from knock41 import get_chunk from graphviz import Digraph import pydot def src_dst_list(text): src_dst_list = [] for sentence in text: pair = [] for i in range(len(sentence)): srcs = sentence[i] if srcs.dst == -1: pass else: p...
null
wanghongfei/chapter05/knock44.py
knock44.py
py
567
python
en
code
null
code-starcoder2
66
[ { "api_name": "knock41.get_chunk", "line_number": 19, "usage_type": "call" }, { "api_name": "graphviz.Digraph", "line_number": 21, "usage_type": "call" } ]
308352946
from ase.io import read from pychemia.code.vasp import VaspXML import matplotlib.pyplot as plt from matplotlib import rc plt.rcParams['xtick.labelsize']=14 plt.rcParams['ytick.labelsize']=14 rc('text', usetex=True) mof = read('CONTCAR') Fe = [atom.index for atom in mof if atom.symbol == 'Fe'] Au = [atom.index for ato...
null
other/example_dos/LOJLAZ-LS/dos.py
dos.py
py
2,634
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 6, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 7, "usage_type": "attribute" }, { "ap...
548606841
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from wechat_sdk import WechatBasic from django.conf import settings class Command(BaseCommand): help = 'Init wechat menu' def handle(self, *args, **options): wechat = WechatBasic(conf = settings.WECHAT_CONF) ret = we...
null
wechat/management/commands/initmenu.py
initmenu.py
py
1,518
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 7, "usage_type": "name" }, { "api_name": "wechat_sdk.WechatBasic", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.settings.WECHAT_CONF", "line_number": 11, "usage_type": "attrib...
20040674
from Tkinter import * import tkMessageBox import tkFont as tkfont import ttk import logging from ui.world import World from ui.world import Shape, Point, Line, Circle, Rectangle #from astar.algorithm import Astar from astar.algo2 import Astar from threading import Thread from PIL import ImageTk from PIL import Image ...
null
Astar_GUI.py
Astar_GUI.py
py
21,268
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 16, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 16, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "tkFont.Font"...
87389378
#!/usr/bin/env python # encoding: utf-8 from tornado import gen from tornado import httputil from tornado.ioloop import IOLoop from tornado.iostream import StreamClosedError from tornado.netutil import ( Resolver, OverrideResolver, is_valid_ip, ) from tornado.log import gen_log import collections import f...
null
simple_udpclient.py
simple_udpclient.py
py
19,756
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 29, "usage_type": "attribute" }, { "api_name": "asynclient.UDPClientError", "line_number": 41, "usage_type": "name" }, { "api_name": "asynclient.UDPClientError", "line_number": 57, "usage_type": "name" }, { "api...
311187606
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2014-10-28 @author: didia ''' import unittest import datetime from base_test import DatastoreTest from trackdidia.models import user from trackdidia.models.custom_exceptions import BadArgumentError from trackdidia.models.custom_exceptions import DeleteTaskF...
null
trackdidia/tests/test_user.py
test_user.py
py
8,312
python
en
code
null
code-starcoder2
66
[ { "api_name": "base_test.DatastoreTest", "line_number": 17, "usage_type": "name" }, { "api_name": "trackdidia.models.user.create_user", "line_number": 20, "usage_type": "call" }, { "api_name": "trackdidia.models.user", "line_number": 20, "usage_type": "name" }, { ...
462281831
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import subprocess import req...
null
speech_api_nict.py
speech_api_nict.py
py
15,912
python
en
code
null
code-starcoder2
66
[ { "api_name": "requests.post", "line_number": 59, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 80, "usage_type": "call" }, { "api_name": "requests.post", "line_number": 101, "usage_type": "call" }, { "api_name": "requests.get", "line_n...
210014564
from types import GeneratorType from scrapy.exceptions import DontCloseSpider from scrapy import signals, Spider, Request from scrapy.utils.trackref import live_refs MAX_REQUEST_QUEUE_FACTOR = 15 class IdleSpider(Spider): def next_requests(self): raise NotImplementedError def setup_idle(self, crawl...
null
spider_frame/scrapy_downloaders/my_scrapy/idle_spider.py
idle_spider.py
py
2,135
python
en
code
null
code-starcoder2
66
[ { "api_name": "scrapy.Spider", "line_number": 10, "usage_type": "name" }, { "api_name": "scrapy.signals.spider_idle", "line_number": 21, "usage_type": "attribute" }, { "api_name": "scrapy.signals", "line_number": 21, "usage_type": "name" }, { "api_name": "scrapy.s...
299521218
import json import re file_name = "test" def file_load(jsonResult, t): if t == 'w': with open('%s.json'%(file_name), 'w', encoding='utf8') as outfile: readable_result = json.dumps(jsonResult, indent=4, sort_keys=True, ensure_ascii=False) outfile.write(readable_result) p...
null
03.Data_Science/1.Collection/3.JSon/ITT_Student_Search.py
ITT_Student_Search.py
py
14,894
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.dumps", "line_number": 9, "usage_type": "call" }, { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 46, "usage_type": "call" } ]
448231424
import numpy as np import matplotlib.pyplot as plt from utils import win_taper, ms2smp grain_len = 35 # ms overlap = 0.3 fs = 16000 data_type = np.int16 # derived parameters MAX_VAL = np.iinfo(data_type).max grain_len_samp = ms2smp(grain_len, fs) grain_stride = grain_len_samp - int(grain_len_samp * overlap / 2) - ...
null
scripts/granular_synthesis/windowing_viz.py
windowing_viz.py
py
1,052
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.int16", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.iinfo", "line_number": 12, "usage_type": "call" }, { "api_name": "utils.ms2smp", "line_number": 13, "usage_type": "call" }, { "api_name": "utils.win_taper", "line_...
560386752
from django import template from poems.models import Poem from django.forms import CheckboxInput from django.shortcuts import render, render_to_response from datetime import datetime register = template.Library() @register.inclusion_tag('poems/tags/top_literature.html') def top_literature(type="all", limit=10): ...
null
poems/templatetags/poem_tags.py
poem_tags.py
py
1,344
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.template.Library", "line_number": 7, "usage_type": "call" }, { "api_name": "django.template", "line_number": 7, "usage_type": "name" }, { "api_name": "poems.models.Poem.objects.filter", "line_number": 13, "usage_type": "call" }, { "api_name":...
24745499
import bs4 as bs import urllib.request import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import roc_auc_score from keras.models import Sequential from keras.layers import Dense, Embedding from keras.layers import LSTM # load French NET dataset file = 'htt...
null
scripts/ner_training.py
ner_training.py
py
6,370
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.request.request.urlopen", "line_number": 19, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 19, "usage_type": "attribute" }, { "api_na...
55055735
from textblob import TextBlob from nltk.corpus import stopwords import nltk import os import re import string import pandas as pd from collections import Counter, defaultdict import wordcloud from wordcloud import STOPWORDS from PIL import Image import numpy as np import operator import glob import matplotlib.pyplot ...
null
Intro/Python/Py_scripts/ngramWordcloudPlainText-Py.py
ngramWordcloudPlainText-Py.py
py
2,989
python
en
code
null
code-starcoder2
66
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 21, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 21, "usage_type": "name" }, { "api_name": "re.sub", "line_number": 28, "usage_type": "call" }, { "api_name": "re.split", ...
192176848
import sys import gym import tensorflow as tf from baselines import deepq from baselines import bench from baselines import logger from baselines.ppo2 import ppo2 from baselines.common.vec_env import DummyVecEnv dirs = '../logs/' def main(gpu, envid, seed, path): with tf.device('/device:GPU:%s' % gpu): ...
null
experiments/mujoco_baselines.py
mujoco_baselines.py
py
1,443
python
en
code
null
code-starcoder2
66
[ { "api_name": "tensorflow.device", "line_number": 16, "usage_type": "call" }, { "api_name": "baselines.logger.configure", "line_number": 18, "usage_type": "call" }, { "api_name": "baselines.logger", "line_number": 18, "usage_type": "name" }, { "api_name": "gym.mak...
50175107
"""Test loading functionality.""" from enum import Enum from typing import (List, Sequence, MutableSequence, Tuple, Any, Set, MutableSet, FrozenSet, MutableMapping, Mapping, Dict, Optional, Union) from pytest import raises from hypothesis import given from hypothesis.strategies...
null
tests/test_loads.py
test_loads.py
py
8,577
python
en
code
null
code-starcoder2
66
[ { "api_name": "hypothesis.strategies.sampled_from", "line_number": 17, "usage_type": "call" }, { "api_name": "hypothesis.strategies.integers", "line_number": 17, "usage_type": "call" }, { "api_name": "hypothesis.strategies.floats", "line_number": 18, "usage_type": "call" ...
635279734
import random import string from django import forms from django.core.exceptions import ValidationError from django.contrib.auth.models import User from symposion.speakers.models import Speaker from symposion.proposals.models import ProposalKind from pybay.proposals.models import TalkProposal class CallForProposalF...
null
pybay/forms.py
forms.py
py
2,806
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.Form", "line_number": 13, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 13, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 14, "usage_type": "call" }, { "api_name": "django.for...
272910538
"""CycleGAN model for image-to-image translation. python test.py --dataroot ./datasets/285cyclegan --name 285cyclegan_cyclegan --model cycle_gan """ import os import ntpath import configuration as cnf from data import create_dataset from models import create_model from options.test_options import TestOptions from u...
null
test.py
test.py
py
2,711
python
en
code
null
code-starcoder2
66
[ { "api_name": "ntpath.basename", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "util.util.tensor2im", ...
439982298
# Create pairs input/output from multiple layers # The first layer correspond to mountain sketch # The others define the area where the trees are located. After we use google quick draw sketches to place tree drawing. from PIL import Image import numpy as np import cv2 from quickdraw import QuickDrawData from resizeim...
null
scripts/create-ds-from-segmentation.py
create-ds-from-segmentation.py
py
3,311
python
en
code
null
code-starcoder2
66
[ { "api_name": "quickdraw.QuickDrawData", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_number": 23, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 23, "usage_type": "name" }, { "api_name": "numpy.array", "li...
490996380
import os import sys import math import glob import pprint import numpy as np from osgeo import gdal, osr, gdalnumeric import subprocess home_dir = os.path.expanduser("~") def get_landsat_by_pathrow(year: int, path: int, row: int, sensor: str): # search_str_base = "/home/tq/tq-data0ZZZ/landsat_sr/SSS/01/PPP...
null
data_prepare/data_stack.py
data_stack.py
py
7,344
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.expanduser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_nu...
474976894
# server/tests/test_main.py import json from api.tests.base import BaseTestCase class TestMain(BaseTestCase): """Main Tests""" def test_ping(self): """Ensure the /ping route behaves correctly.""" response = self.client.get('/ping') data = json.loads(response.data.decode()) ...
null
server/api/tests/test_main.py
test_main.py
py
461
python
en
code
null
code-starcoder2
66
[ { "api_name": "api.tests.base.BaseTestCase", "line_number": 9, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 15, "usage_type": "call" } ]
636514196
import pyttsx3 engine = pyttsx3.init() def onEnd(name, completed): if name == 'fox': engine.endLoop() engine.connect('finished-utterance', onEnd) engine.say('totally non offensive words', 'fox') engine.startLoop() print("words")
null
test.py
test.py
py
241
python
en
code
null
code-starcoder2
66
[ { "api_name": "pyttsx3.init", "line_number": 3, "usage_type": "call" } ]
463631495
import json with open('/tmp/ec2_instances.json', 'r') as f: ec2 = json.loads(f.read()) with open('stack.json', 'r') as f: stack = json.loads(f.read()) apps_list = [] for app in stack['apps']: for i in range(stack['apps'][app]['instances']): apps_list.append(app) for i, instance in enumerate(ec2['...
null
installation/bind_instances.py
bind_instances.py
py
392
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 4, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 6, "usage_type": "call" } ]
187994562
#coding:utf-8 __author__ = 'zlj' import sys reload(sys) sys.setdefaultencoding('utf8') from pyspark import SparkContext from pyspark.sql import * from pyspark.sql.types import * import time import rapidjson as json sc = SparkContext(appName="cmt") sqlContext = SQLContext(sc) hiveContext = HiveContext(sc) def decode...
null
zlj/project/base_data_process/ec_tb/sku/sku.py
sku.py
py
1,496
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.setdefaultencoding", "line_number": 6, "usage_type": "call" }, { "api_name": "pyspark.SparkContext", "line_number": 14, "usage_type": "call" }, { "api_name": "zlib.compress", "line_number": 38, "usage_type": "call" }, { "api_name": "base64.b64en...
572101270
# -*- coding: utf-8 -*- from flask import Flask, render_template, request, session, redirect from flask_socketio import SocketIO, send, emit import random import numpy as np import time as time from math import * from generate_map import * map, map_width, map_height, inner_slide = load_map("./static/map_alpha.png") ...
null
serv.py
serv.py
py
18,522
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask_socketio.SocketIO", "line_number": 16, "usage_type": "call" }, { "api_name": "time.clock", "line_number": 18, "usage_type": "call" }, { "api_name": "time.clock", "line...
247800455
import matplotlib.pyplot as plt import numpy as np time = np.arange(0, 10,0.002) frequency = 2.4 * (10**9) print(frequency ) plt.ion() for phase in range(0, 720,10): plt.ylim(-10,10) plt.title('Radar Simulation') vco = 6*np.sin(2 * np.pi * time * frequency + 40 * np.pi/180) LOintermediate = 3*np.sin...
null
main/Simulations/testClutter.py
testClutter.py
py
1,174
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.arange", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.ion", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 8, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.y...
174240998
import MySQLdb import pymysql alllo=[] class ConnMysql(object): def __init__(self): # 连接数据库 self.db = pymysql.connect(host='39.97.241.101', port=3306, database='testsitedb', user='root', ...
null
src/s.py
s.py
py
1,436
python
en
code
null
code-starcoder2
66
[ { "api_name": "pymysql.connect", "line_number": 7, "usage_type": "call" } ]
21492405
# -*- coding: UTF-8 -*- import talib import datetime import pandas as pd import tushare as ts pro = ts.pro_api() history = pro.daily(ts_code= "601005.SH") history = history[["trade_date","open", "close","low","high"]] history["trade_date"] = pd.to_datetime(history["trade_date"], format="%Y%m%d") history.index = histo...
null
Investment/Quantitative Trading/日本蜡烛图技术/上吊线和下锤线策略.py
上吊线和下锤线策略.py
py
3,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "tushare.pro_api", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.to_datetime", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.set_option...
291110803
"""tscast URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
null
src/tscast/tscast/urls.py
urls.py
py
2,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.contrib.admin.site", "line_number": 23, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 23, "usage_type": "name" }, { "api_name": "django.contrib.admin.site", "line_number": 24, "usage_type": "attribute" }, { ...
68534559
import pytest from elasticsearch import Elasticsearch from elasticsearch import client from elasticsearch_dsl import Search import tube.settings as config from tube.etl.indexers.interpreter import create_translators from tests.utils import items_in_file from tests.utils_db import SQLQuery from tests.utils_es import ge...
null
tests/test_es/test_es.py
test_es.py
py
3,200
python
en
code
null
code-starcoder2
66
[ { "api_name": "tube.etl.indexers.interpreter.create_translators", "line_number": 18, "usage_type": "call" }, { "api_name": "tube.settings", "line_number": 18, "usage_type": "argument" }, { "api_name": "pytest.fixture", "line_number": 16, "usage_type": "attribute" }, {...
71063156
import os import requests import re import logging import datetime import json from bs4 import BeautifulSoup as soup from word2number import w2n from graphc.data.abs2020 import LGA2020 from graphc.da import da_arcpy import pprint local_json_directory = r'E:\Documents2\tmp\COVID19' class VicDailyUpdateParser(objec...
null
graphc/covid/source/VIC_SourceData.py
VIC_SourceData.py
py
31,012
python
en
code
null
code-starcoder2
66
[ { "api_name": "graphc.data.abs2020.LGA2020.centroids", "line_number": 22, "usage_type": "call" }, { "api_name": "graphc.data.abs2020.LGA2020", "line_number": 22, "usage_type": "name" }, { "api_name": "re.search", "line_number": 29, "usage_type": "call" }, { "api_n...
124503653
import datetime from django.test import TestCase from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from polls.models import Question, Choice class QuestionAndChoiceModelsTest(TestCase): def test_saving_and_retrieving_questions_an...
null
polls/tests.py
tests.py
py
1,649
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 10, "usage_type": "name" }, { "api_name": "polls.models.Question", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 15, "usage_type": "call" }, { "api_name": "datetime...
456804922
from django.test import TestCase from .models import UserList from rest_framework import APIClient from rest_framework import status from django.reverse import reverse # Create your tests here. class ModelTestCase(TestCase): def setUp(self): self.userlist_name = "User" self.userlist = Use...
null
djangorest/api/tests.py
tests.py
py
1,791
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "models.UserList", "line_number": 11, "usage_type": "call" }, { "api_name": "models.UserList.objects.count", "line_number": 14, "usage_type": "call" }, { "api_name": "mod...
118415132
from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.svm import SVC from sklearn.pipeline import Pipeline from sklearn.metrics import accuracy_score, f1_score from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression, RidgeClassifier from sklearn.mode...
null
trainer/trainer.py
trainer.py
py
4,614
python
en
code
null
code-starcoder2
66
[ { "api_name": "helpers.Normalize", "line_number": 32, "usage_type": "call" }, { "api_name": "helpers.RemoveOutliers", "line_number": 33, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 35, "usage_type": "call" }, { ...
388523881
import sqlite3 import networkx as nx import matplotlib.pyplot as plt import Tkinter banco = sqlite3.connect("BANCO.DB") cursor = banco.cursor() def imprimir_caminho_recomendacoes(G, eu, amigosRecomendados): pos=nx.spring_layout(G) todosNomes = [] amigos = [] for edges in G.edges(): if edges[0] not in todos...
null
10 - Etapa Final - Aplicação/recomendacaoAmigos.py
recomendacaoAmigos.py
py
3,855
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 6, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 12, "usage_type": "call" }, { "api_name": "networkx.draw_networkx_nodes", "line_number": 69, "usage_type": "call" }, { "api_name": "ne...
630402371
import os from django.test import TestCase from orders.views import home_page from orders.models import Order from orders.forms import NewOrderForm TEST_FILE = '../salad.txt' EMAIL = 'email@example.com' class ViewsTest(TestCase): def test_home_page_renders_home_template(self): response = self.client.get(...
null
orders/tests.py
tests.py
py
1,785
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.test.TestCase", "line_number": 11, "usage_type": "name" }, { "api_name": "orders.models.Order.objects.first", "line_number": 22, "usage_type": "call" }, { "api_name": "orders.models.Order.objects", "line_number": 22, "usage_type": "attribute" }, ...
277603550
"""Server for ACNH recipes lookup and calculator app.""" from flask import Flask, render_template, request, flash, session, jsonify from model import connect_to_db import crud app = Flask(__name__) app.secret_key = "dev" @app.route('/', defaults={'path':''}) @app.route('/<path:path>') def show_app(path): """Sh...
null
server.py
server.py
py
5,203
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.render_template", "line_number": 17, "usage_type": "call" }, { "api_name": "crud.get_recipes", "line_number": 24, "usage_type": "call" }, { "api_name": "flask.jsonify", ...
68388003
import urllib.request from bs4 import BeautifulSoup import codecs import argparse class Html: def __init__(self,siteUrl="https://g1.globo.com/"): self.siteUrl = siteUrl def getHtml(self): f = urllib.request.urlopen(self.siteUrl) htmlString = f.read().decode("utf8") ...
null
TrabalhoDois/noticias.py
noticias.py
py
2,607
python
en
code
null
code-starcoder2
66
[ { "api_name": "urllib.request.request.urlopen", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 12, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 12, "usage_type": "name" }, { "api_nam...
75909544
# Brain Tumor Classification # Script for Resizing Brain Volumes # Author: Qixun Qu # Create on: 2017/10/29 # Modify on: 2017/11/28 # ,,, ,,, # ;" '; ;' ", # ; @.ss$$$$$$s.@ ; # `s$$$$$$$$$$$$$$$' # $$$$$$$$$$$$$$$$$$ # $$$$P""Y$$$Y""W$$$$$ # $$$$ p"$$$"q $$$$$ # $$$$ .$$$$$. $$$$'...
null
src/btc_volumes.py
btc_volumes.py
py
5,954
python
en
code
null
code-starcoder2
66
[ { "api_name": "warnings.simplefilter", "line_number": 41, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 69, "usage_type": "call" }, { "api_name": "os.path", "line_number": 69, "usage_type": "attribute" }, { "api_name": "os.path.isdir", ...
22248094
#!/usr/bin/env python3 #-*- coding: utf-8 -*- # Programmiertechniken in der Computerlinguistik II # Uebung 4, Aufgabe 1.1 # Autoren: Salome Wildermuth, Frederik Bauer from typing import BinaryIO import bz2 import gzip import json def mk_meme_corpus( infile: BinaryIO , outfile: str ...
null
comment_picker.py
comment_picker.py
py
1,284
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.BinaryIO", "line_number": 14, "usage_type": "name" }, { "api_name": "gzip.open", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 22, "usage_type": "call" } ]
439212050
import cv2 import numpy as np #Read the images from your directory dim=(1024,768) path1=r'C:\Users\ACS\Desktop/image2.jpg' path2=r'C:\Users\ACS\Desktop/image1.jpg' left=cv2.imread(path1,cv2.IMREAD_COLOR) left=cv2.resize(left,dim,interpolation = cv2.INTER_AREA) #ReSize to (1024,768) right=cv2.imread(path2,...
null
ModifiedPro.py
ModifiedPro.py
py
732
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.IMREAD_COLOR", "line_number": 9, "usage_type": "attribute" }, { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_...
189850294
#!/usr/bin/python import sealang import clang from clang import cindex buf = """ #define VALUE_ONE 1 int test(int argc) { return argc > VALUE_ONE; } """ clang.cindex.Config.set_library_file("/usr/lib/llvm-6.0/lib/libclang.so") idx = cindex.Index.create() tu = idx.parse(path="t.c", unsaved_files=[("t.c", buf)]) ...
null
examples/test.py
test.py
py
758
python
en
code
null
code-starcoder2
66
[ { "api_name": "clang.cindex.Config.set_library_file", "line_number": 17, "usage_type": "call" }, { "api_name": "clang.cindex", "line_number": 17, "usage_type": "attribute" }, { "api_name": "clang.cindex.Index.create", "line_number": 18, "usage_type": "call" }, { "...
16075721
from django.http import HttpResponse, Http404 from django.utils import timezone from .models import Post, Comment from .forms import CommentForm from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render, redirect from users.tasks import sen...
null
main/views.py
views.py
py
1,558
python
en
code
null
code-starcoder2
66
[ { "api_name": "models.Post.objects.filter", "line_number": 14, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 14, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 14, "usage_type": "name" }, { "api_name": "djang...
339521193
# filter and list non prod servers (tag with env:dev) import boto3 session = boto3.Session(profile_name="devops", region_name="us-east-2") ec2client = session.client(service_name="ec2", region_name="us-east-2") response = ec2client.describe_instances( Filters=[ { 'Name': 'tag:env', ...
null
boto3_learning/boto3_filter_listnonprod.py
boto3_filter_listnonprod.py
py
633
python
en
code
null
code-starcoder2
66
[ { "api_name": "boto3.Session", "line_number": 4, "usage_type": "call" } ]
627727064
from collections import deque my_list = [[1,2], [3,4], [5,6], [7,8]] num_history = 3 d = deque(maxlen = 3) def deque_avg(deque, num_history): """Find the average of each component in a list of lists Args: deque (deque): deque = [[a1, b1], [a2, b2], ...] a historical list of the parameters of ...
null
src/simple-lane-lines/sandbox.py
sandbox.py
py
744
python
en
code
null
code-starcoder2
66
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 17, "usage_type": "argument" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "argument" }, { "api_name": "collecti...
425878179
#!/usr/bin/env python #- * - coding:utf-8 - * - import logging import sys from logging.handlers import RotatingFileHandler ''' class colorLoggingHandler(ColorizingStreamHandler): level_map = { logging.DEBUG: (None, 'cyan', False), logging.INFO: (None, 'white', False), logging.WARNING: (None...
null
log.py
log.py
py
1,874
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.addLevelName", "line_number": 29, "usage_type": "call" }, { "api_name": "logutils.colorize.ColorizingStreamHandler", "line_number": 31, "usage_type": "call" }, { "...
618997093
import os from glob import glob import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import pandas as pd import geopandas as gpd import contextily as ctx from tqdm import tqdm import imageio def draw_hist2d_ctx(ax, x, y, lon_lim, lat_lim, norm=None, title=No...
null
visualization/order_density_visualization.py
order_density_visualization.py
py
3,823
python
en
code
null
code-starcoder2
66
[ { "api_name": "contextily.add_basemap", "line_number": 19, "usage_type": "call" }, { "api_name": "glob.glob", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path", "line_num...
403982395
# Copyright (c) 2018 Uber Technologies, 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 ag...
null
examples/es_hyperneat/tmaze.py
tmaze.py
py
4,682
python
en
code
null
code-starcoder2
66
[ { "api_name": "pytorch_neat.cppn.create_cppn", "line_number": 50, "usage_type": "call" }, { "api_name": "pytorch_neat.es_hyperneat.ESNetwork", "line_number": 51, "usage_type": "call" }, { "api_name": "pytorch_neat.substrate.Substrate", "line_number": 51, "usage_type": "ca...
617541247
import boto3 import os import sys from pathlib import Path from typing import Tuple try: ACCESS_KEY = os.environ["AWS_ACCESS_KEY"] SECRET_KEY = os.environ["AWS_SECRET_KEY"] SESSION_TOKEN = os.environ["AWS_SESSION_TOKEN"] except KeyError as e: sys.exit(f"Error: Missing environment variable - {e}") BAS...
null
code/attack_script.py
attack_script.py
py
2,580
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.environ", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_nu...
104657855
# -*- coding: utf-8 -*- import os import sys from setuptools import setup, Extension try: import py2exe use_py2exe = True except ImportError: use_py2exe = False if use_py2exe: # This is an temporary workaround to deal with importing errors using py2exe. if "py2exe" in sys.argv: sys.path.app...
null
setup-internal.py
setup-internal.py
py
2,039
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 13, "usage_type": "attribute" }, { "api_name": "sys.path.append", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "sys.path.append", "li...
515535981
# -*- encoding: utf-8 -*- import sys from itertools import permutations r_input = sys.stdin.readline N, M, K = map(int, r_input().split()) # N x M 행렬, 연산 K번 수행 array = {} # 배열 for i in range(1, N+1): array[i] = [0] + list(map(int, r_input().split())) def turn(left_r, left_c, right_r, right...
null
Algorithm/Baekjoon/17406 배열 돌리기 4/17406.py
17406.py
py
1,698
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.stdin", "line_number": 4, "usage_type": "attribute" }, { "api_name": "itertools.permutations", "line_number": 51, "usage_type": "call" } ]
127978057
import numpy as np import tensorflow as tf import random from sklearn.preprocessing import normalize from pandas import DataFrame from math import acos, pi from scipy.stats import entropy import sys np.random.seed(13) if len(sys.argv) == 2: STOP = int(sys.argv[1]) elif len(sys.argv) == 1: STOP = 50000 # i.e. ...
null
crossval_1.py
crossval_1.py
py
6,833
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_...
462114965
import sys from PIL import Image, ImageDraw, ImageFont, ImageChops, ImageFilter import imgtools font = ImageFont.truetype("/home/jamesb/.fonts/IBMPlexSans-Medium.otf", 18) def extract(im): im = im.copy() (w, h) = im.size a = im blank = Image.new("L", im.size, 0) ap = im.load() i = 0 subs ...
null
emu/assets/extract.py
extract.py
py
2,240
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.ImageFont.truetype", "line_number": 6, "usage_type": "call" }, { "api_name": "PIL.ImageFont", "line_number": 6, "usage_type": "name" }, { "api_name": "PIL.Image.new", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "lin...
512197812
__author__ = "Luke Liu" #encoding="utf-8" import cv2 import matplotlib.pyplot as plt import numpy as np img1 = cv2.imread("1.jpg") img2 = cv2.imread("2.jpg") gray1 =cv2.cvtColor(img1,cv2.COLOR_BGR2GRAY) gray2 =cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY) orb=cv2.ORB_create(nfeatures=100) kp1,des1=orb.detectAndCompute(im...
null
特征检测与特征描述/特征匹配算法/BruteForce暴力匹配.py
BruteForce暴力匹配.py
py
1,027
python
en
code
null
code-starcoder2
66
[ { "api_name": "cv2.imread", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 9, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_numbe...
114098727
#!/usr/bin/env python # coding: utf-8 # In[187]: import pandas as pd import json import sys import matplotlib.pyplot as plt plt.style.use('seaborn-whitegrid') import numpy as np path = "sample_data.xlsx" # path = "Dynamic_Navigation_Study 2021_RawData05122021.xlsx" # path = "Group_none.xlsx" dataset = pd.read_excel...
null
DataAnalysis/DataAnalysis_script.py
DataAnalysis_script.py
py
1,541
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.style.use", "line_number": 11, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.style", "line_number": 11, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 11, "usage_type": "name" }, { "api_na...
537520619
from keras.preprocessing.image import ImageDataGenerator from keras.applications import VGG16 from keras.models import Model from keras.callbacks import ModelCheckpoint, EarlyStopping from keras.layers import Dropout, Flatten, Dense from keras.optimizers import Nadam import matplotlib.pyplot as plt from keras import re...
null
vgg16bottletrain.py
vgg16bottletrain.py
py
2,774
python
en
code
null
code-starcoder2
66
[ { "api_name": "keras.applications.VGG16", "line_number": 17, "usage_type": "call" }, { "api_name": "keras.layers.Flatten", "line_number": 26, "usage_type": "call" }, { "api_name": "keras.layers.Dense", "line_number": 27, "usage_type": "call" }, { "api_name": "kera...
267955302
# -*- coding: utf-8 -*- from django import forms from django.utils.html import escape from django_countries import countries from api.models import Event from taggit.forms import TagField class AddEvent(forms.ModelForm): class Meta: model = Event fields = ['title', 'organizer', 'description', 'location', 'countr...
null
codeweekeu/web/forms/event_form.py
event_form.py
py
5,537
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.forms.ModelForm", "line_number": 9, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 9, "usage_type": "name" }, { "api_name": "api.models.Event", "line_number": 11, "usage_type": "name" }, { "api_name": "django.forms....
466053535
import base64 from playwright.async_api import async_playwright path_to_extension = "./saya/ChineseDict/chrome/extension/ad" user_data_dir = "./saya/ChineseDict/chrome/data" _browser = None async def init(): global _browser browser = await async_playwright().start() _browser = await browser.chromium.la...
null
saya/ChineseDict/page_screenshot.py
page_screenshot.py
py
1,292
python
en
code
null
code-starcoder2
66
[ { "api_name": "playwright.async_api.async_playwright", "line_number": 13, "usage_type": "call" }, { "api_name": "base64.b64encode", "line_number": 35, "usage_type": "call" }, { "api_name": "os.system", "line_number": 45, "usage_type": "call" } ]
394716122
import pygame from utility.game_backend import Game, Board, Null, Flame, Warrior def mouse_index(mx, my, buffer, tile_size): s_row = (my - buffer)//tile_size s_col = (mx - buffer)//tile_size return s_col + s_row*10 def draw_board(buffer, tile_size, game, piece, move, move_locations, shoot_locations): ...
null
game.py
game.py
py
5,753
python
en
code
null
code-starcoder2
66
[ { "api_name": "pygame.image.load", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 11, "usage_type": "call" }, { "api_name": "pygame.image", ...
575853771
#! /usr/bin/env python import pathlib import re from collections import defaultdict def parse_rules(data): rules = {} for line in data: bag = re.match(r"([a-z]+ [a-z]+)(?= bags contain)", line).group() match = re.findall(r"(?<=contain )([0-9]+) ([a-z]+ [a-z]+)", line) if match: ...
null
7/main.py
main.py
py
1,447
python
en
code
null
code-starcoder2
66
[ { "api_name": "re.match", "line_number": 9, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 10, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 13, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 51, ...
35008794
import yaml class Parser(object): def __init__(self, src): super(Parser, self).__init__() self.src = src def parser(self): result = "" with open(self.src, 'r') as stream: try: result = yaml.load(stream) except yaml.YAMLError as e: ...
null
parser.py
parser.py
py
383
python
en
code
null
code-starcoder2
66
[ { "api_name": "yaml.load", "line_number": 11, "usage_type": "call" }, { "api_name": "yaml.YAMLError", "line_number": 12, "usage_type": "attribute" } ]
639102701
import sqlite3 class BancoDeDados: """ Classe que representa o banco de dados (database) da aplicaçao """ def __init__(self, nome = 'banco.db'): self.nome, self.conexao = nome, None def conecta(self): #conecta passando o nome do arquivo self.conexao = sqlite3.connect(s...
null
database.py
database.py
py
3,239
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "sqlite3.IntegrityError", "line_number": 47, "usage_type": "attribute" } ]
512447067
"""Pylons bootstrap environment. Place 'pylons_config_file' into alembic.ini, and the application will be loaded from there. """ from alembic import context from ConfigParser import ConfigParser from logging.config import fileConfig from sqlalchemy.engine.base import Engine from sqlalchemy import engine_from_config f...
null
alembic/env.py
env.py
py
1,645
python
en
code
null
code-starcoder2
66
[ { "api_name": "ConfigParser.ConfigParser", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path", "line_number": 19, "usage_type": "name" }, { "api_name": "os.path.dirname", ...
406065564
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
null
msgraph-cli-extensions/src/groupsendpoint/azext_groupsendpoint/vendored_sdks/groupsendpoint/models/_models_py3.py
_models_py3.py
py
7,030
python
en
code
null
code-starcoder2
66
[ { "api_name": "msrest.serialization.serialization", "line_number": 16, "usage_type": "attribute" }, { "api_name": "msrest.serialization", "line_number": 16, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 33, "usage_type": "name" }, { "api_...
14177150
import os import tempfile import contextlib import shutil import zipfile from io import BytesIO from hypothesis import given from hypothesis import strategies as st from typing import Union, List from autotester.server.utils import file_management as fm @st.composite def nested_dir_structure(draw) -> Union[List, int]...
null
src/autotester/server/utils/tests/file_management_test.py
file_management_test.py
py
8,209
python
en
code
null
code-starcoder2
66
[ { "api_name": "hypothesis.strategies.recursive", "line_number": 16, "usage_type": "call" }, { "api_name": "hypothesis.strategies", "line_number": 16, "usage_type": "name" }, { "api_name": "hypothesis.strategies.integers", "line_number": 16, "usage_type": "call" }, { ...
628809250
############################################################################## # # Copyright (c) 2006 ROBOTECH Logistiksysteme GmbH # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWAR...
null
z3c.zalchemy/sandbox/src/z3c/zalchemy/metaconfigure.py
metaconfigure.py
py
1,696
python
en
code
null
code-starcoder2
66
[ { "api_name": "zope.component", "line_number": 22, "usage_type": "name" }, { "api_name": "datamanager.AlchemyEngineUtility", "line_number": 22, "usage_type": "call" }, { "api_name": "zope.app.component.metaconfigure.utility", "line_number": 26, "usage_type": "call" }, ...
604613445
import audio_ss_nnio #import matplotlib.pyplot as plt import torch import torchaudio class BaseNNIO(audio_ss_nnio.AudioSSNNIO): def __init__(self, sr, duration, n_fft=300, normalized=False): super().__init__(sr, duration) self.n_fft = n_fft self.normalized = normalized def au...
null
awsapi/base_nnio.py
base_nnio.py
py
2,867
python
en
code
null
code-starcoder2
66
[ { "api_name": "audio_ss_nnio.AudioSSNNIO", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torchaudio.functional.istft", "line_number": 30, "usage_type": "call" }, { "api_name": "torchaudio.functional", "line_number": 30, "usage_type": "attribute" }, { ...
51661955
import torch from torch import nn import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from copy import deepcopy class NeuromodulationNet(nn.Module): """ Deep Backpropamine Network based on Miconi et al paper: https://openreview.net/pdf?id=r1lrAiA5Ym """ def...
null
DHP/NeuromodulationNetwork.py
NeuromodulationNetwork.py
py
7,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.functional.mse_loss", "line_number": 15, "usage_type": "attribute" }, { "api_name": "torch...
359942570
import json import copy def processIocs(iocs1,iocs2,iocs3): # Import Saci with open('../../config/current/saciTemplate.json') as file: saciTemplate = json.load(file) # IOCs iocs = dict() cpus4 = dict() tss4 = dict() iocs_names = [] for ioc in iocs1: iocs_names.append(i...
null
tools/saciImporter/processIocs.py
processIocs.py
py
5,076
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 26, "usage_type": "call" } ]
195006643
from flask import Flask, render_template, request, redirect, url_for import csv import time import datetime as dt from datetime import datetime, date app = Flask(__name__) app.config['SECRET_KEY'] = 'entersecretkey' uncompleted_tasks = [] def update_uncompleted_tasks(): with open('Eisenhower.csv', newline='') ...
null
app.py
app.py
py
9,570
python
en
code
null
code-starcoder2
66
[ { "api_name": "flask.Flask", "line_number": 8, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 30, "usage_type": "call" }, { "api_name": "datetime.datetime.today", ...
379580669
import json """ Find all path to the files in the `obj` with the name `filename`. Return list of path where path is a list of string of directory name and file name. ex. [ ['path', 'to', 'file1'], ['anotherpath', 'file1'] ] The obj should be formatted like this: { "_files": [ "fileA", "fileB", ...] , "direc...
null
Prob#2 - File search/script.py
script.py
py
1,135
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.loads", "line_number": 32, "usage_type": "call" } ]
22414499
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 21 08:52:21 2021 @author: jeb """ import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.colors import ListedColormap, LinearSegmentedColormap from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np import os fr...
null
CARRA_annual_3h_accum_rain_v2.py
CARRA_annual_3h_accum_rain_v2.py
py
13,859
python
en
code
null
code-starcoder2
66
[ { "api_name": "matplotlib.pyplot.rcParams", "line_number": 26, "usage_type": "attribute" }, { "api_name": "matplotlib.pyplot", "line_number": 26, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 27, "usage_type": "attribute" }, { ...
13821338
import numpy as np import matplotlib.pyplot as plt import pandas as pd import pickle path_to_files = '/afs/ipp-garching.mpg.de/home/o/osam/workspace/python3_projects/Simple_ST_model/' df = pd.read_csv(path_to_files + 'statistics_united.csv') # print(df) # df.columns # df['fB [kHz]'] freqs = ['0.3<f<=1', '1<f<=2', ...
null
python3_projects/Simple_ST_model/statistics_to_pandas.py
statistics_to_pandas.py
py
4,469
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 26, "usage_type": "call" }, { "api_name": "pickle.load", "line_number...
474048622
import serial import time PORT = "/dev/ttyACM0" BAUD_RATE = 9600 PARITY = serial.PARITY_NONE STOPBITS = serial.STOPBITS_ONE BYTESIZE = serial.EIGHTBITS TIMEOUT = 3 def initialize_serial(): ser = serial.Serial(port=PORT, parity=PARITY, stopbits=STOPBITS, bytesize=BYTESIZE, timeout=TIMEOUT) return ser def sen...
null
utils.py
utils.py
py
675
python
en
code
null
code-starcoder2
66
[ { "api_name": "serial.PARITY_NONE", "line_number": 6, "usage_type": "attribute" }, { "api_name": "serial.STOPBITS_ONE", "line_number": 7, "usage_type": "attribute" }, { "api_name": "serial.EIGHTBITS", "line_number": 8, "usage_type": "attribute" }, { "api_name": "s...
266093237
import cv2 as cv import numpy as np from PIL import Image import phase_Two def preProcessor(path): # primarly using PIL to reduce the DPI of the image image = Image.open(path) image.save("stepOne-00.png", dpi=(600, 600)) # reading again to perform the peration and convertio to grayscale image ima...
null
preProcessor.py
preProcessor.py
py
2,406
python
en
code
null
code-starcoder2
66
[ { "api_name": "PIL.Image.open", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 9, "usage_type": "name" }, { "api_name": "cv2.imread", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 1...
81932863
# @Time : 2019/6/4 17:07 # @Author : Xu Huipeng # @Blog : https://brycexxx.github.io/ from typing import List class Solution: def minSubArrayLen(self, s: int, nums: List[int]) -> int: min_len = float('inf') left = sum_ = 0 for right in range(len(nums)): sum_ += nums[rig...
null
minSubArrayLen.py
minSubArrayLen.py
py
643
python
en
code
null
code-starcoder2
66
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
171460586
#!/usr/bin/env python import argparse from P4 import P4 from universum import __main__ as universum def main(): parser = argparse.ArgumentParser() parser.add_argument("--p4-port") parser.add_argument("--p4-user") parser.add_argument("--p4-password") parser.add_argument("--p4-client") parser.a...
null
examples/p4_to_git.py
p4_to_git.py
py
1,685
python
en
code
null
code-starcoder2
66
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "P4.P4", "line_number": 21, "usage_type": "call" }, { "api_name": "universum.__main__.main", "line_number": 47, "usage_type": "call" }, { "api_name": "universum.__main...
289186037
# -*- coding: utf-8 -*- from django.conf.urls import patterns, include, url from signature.views import YousignSuccessView, YousignCancelView, YousignErrorView, InvestorBookView urlpatterns = patterns('', url(r'investor-book/$', InvestorBookView.as_view(), name='signature_investor_book'), url(r'yousign/suc...
null
api/signature/urls.py
urls.py
py
589
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.conf.urls.patterns", "line_number": 7, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "signature.views.InvestorBookView.as_view", "line_number": 9, "usage_type": "call" }, { ...
418890326
import docx import google_trans_new import googletrans import time #source start = time.time() path = "input.docx" name_file = path.split(".")[0] source = docx.Document(path) paras = source.paragraphs #var count count_cha_limit = 0 text_input = str() for i in range(0,len(paras)): text = paras[i].text count_cha_...
null
main.py
main.py
py
672
python
en
code
null
code-starcoder2
66
[ { "api_name": "time.time", "line_number": 6, "usage_type": "call" }, { "api_name": "docx.Document", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_number": 25, "usage_type": "call" } ]
241643515
import pandas as pd from sklearn import svm #importing previous files vecs = pd.read_pickle('/users/madke/documents/TOLSTvecs.pkl') vecs1 = pd.read_pickle("/users/madke/documents/vecs_w2v.pkl") new = pd.read_csv('/users/madke/documents/012320_reformedexp.csv', index_col = 0) dnev = pd.read_csv('/users/madke/docum...
null
012720svmrun.py
012720svmrun.py
py
963
python
en
code
null
code-starcoder2
66
[ { "api_name": "pandas.read_pickle", "line_number": 4, "usage_type": "call" }, { "api_name": "pandas.read_pickle", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 6, "usage_type": "call" }, { "api_name": "pandas.read_csv", ...
341111090
import numpy as np import time import cv2 import datetime import sys from camera import Camera from picamera.array import PiRGBArray from picamera import PiCamera from fractions import Fraction from threading import Thread # Raspberry Pi Camera Module With IR class RaspberryPiCamera(Camera): def __init__(self, pr...
null
cam/raspi_cam.py
raspi_cam.py
py
2,181
python
en
code
null
code-starcoder2
66
[ { "api_name": "camera.Camera", "line_number": 14, "usage_type": "name" }, { "api_name": "picamera.PiCamera", "line_number": 17, "usage_type": "call" }, { "api_name": "picamera.array.PiRGBArray", "line_number": 19, "usage_type": "call" }, { "api_name": "cv2.VideoWr...
263617583
from django.urls import path from . import views from appsong.views import * from django.urls import re_path from django.conf.urls import url app_name = 'appsong' urlpatterns = [ #path(r'^search/$', views.search, name='search'), path('princ/', views.gen_page_principale, name='page_princ'), path('...
null
appsong/urls.py
urls.py
py
1,171
python
en
code
null
code-starcoder2
66
[ { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 11, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 12, "usage_type": "call" }, { "api_name": "django.urls.path",...
37500135
#!/usr/bin/python # encoding: utf-8 import sys, json from workflow import Workflow, ICON_WEB, web sets = { 'Basic': 'classic.png', 'Blackrock Mountain': 'brm.png', 'Classic': 'classic.png', 'Mean Streets of Gadgetzan': 'gadgetzan.png', 'Goblins vs Gnomes': 'gvg.png', 'Hall of Fame': 'hof.pn...
null
hs.py
hs.py
py
4,548
python
en
code
null
code-starcoder2
66
[ { "api_name": "json.load", "line_number": 72, "usage_type": "call" }, { "api_name": "workflow.Workflow", "line_number": 112, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 116, "usage_type": "call" } ]