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
641374358
#!/usr/bin/env python # coding: utf-8 import requests import os from datetime import datetime from os.path import join, dirname from dotenv import load_dotenv from sqlalchemy import create_engine dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) # MySQL接続 mysql_info = 'mysql+pymysql://' + os.env...
null
main.py
main.py
py
2,668
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.dirname", "line_number": 11, "usage_type": "call" }, { "api_name": "dotenv.load_dotenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.environ", "lin...
155794699
import re import xml.dom.minidom as dom from xml.parsers.expat import ExpatError import http.client, urllib.parse HTTP_TIMEOUT = 10 class SoapRequest(object): """ Base class for SOAP requests. """ SOAPENV_SCHEMA = "http://schemas.xmlsoap.org/soap/envelope/" def __init__(self, urn): ...
null
Libs/UI/soap_modules/soap.py
soap.py
py
3,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "xml.dom.minidom.Document", "line_number": 15, "usage_type": "call" }, { "api_name": "xml.dom.minidom", "line_number": 15, "usage_type": "name" }, { "api_name": "http.client.client.HTTPConnection", "line_number": 76, "usage_type": "call" }, { "api_na...
305505425
""" Create graph embedding from dbp file Example data : >>> db['1808.03258'] {'id': 'http://arxiv.org/abs/1808.03258v1', 'guidislink': True, 'link': 'http://arxiv.org/abs/1808.03258v1', 'updated': '2018-08-04T13:37:51Z', 'updated_parsed': time.struct_time(tm_year=2018, tm_mon=8, tm_mday=4, tm_hour=13, tm_min=37,...
null
aidistillery/graph_embeddings.py
graph_embeddings.py
py
8,757
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 70, "usage_type": "call" }, { "api_name": "dgl.DGLGraph", "line_number": 82, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 85, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_nu...
451108362
""" This file keeps all fixes for issues found """ import os import datetime from textwrap import dedent from unittest import TestCase import pyexcel as pe from pyexcel_xlsxw import save_data class TestBugFix(TestCase): def test_pyexcel_issue_5(self): """pyexcel issue #5 datetime is not prop...
null
tests/test_bug_fixes.py
test_bug_fixes.py
py
3,007
python
en
code
null
code-starcoder2
76
[ { "api_name": "unittest.TestCase", "line_number": 15, "usage_type": "name" }, { "api_name": "pyexcel.load", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 22, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
19408596
import matplotlib.pyplot as plt import numpy as np import sys from plotting.util import read_files_dict, pretty_xlim def main(): uc_trunc = int(sys.argv[1]) if len(sys.argv) > 1 else 0 #8 c_trunc = int(sys.argv[2]) if len(sys.argv) > 2 else 0 #-6 uc_dict = read_files_dict("experiments/mf/results/output_uc", sort...
null
experiments/mf/scripts/plot.py
plot.py
py
2,431
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "plotting.util.read_files_dict", "line_number": 10, "usage_type": "call" }, { "api_name": "plotting.util...
183407716
""" BehaviorRobot class that can be used in VR as an avatar, or as a robot. It has two hands, a body and a head link, so is very close to a humanoid avatar. Takes in a numpy action space each frame to update its positions. Action space (all non-normalized values that will be clipped if they are too large) * See init ...
null
igibson/robots/behavior_robot.py
behavior_robot.py
py
60,190
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.zeros", "line_number": 148, "usage_type": "call" }, { "api_name": "pybullet.multiplyTransforms", "line_number": 196, "usage_type": "call" }, { "api_name": "pybullet.multiplyTransforms", "line_number": 198, "usage_type": "call" }, { "api_name":...
628744997
import discord from discord.ext.commands import group from discord.ext.commands import bot from discord.ext.commands import RoleConverter from discord.ext import commands import cfg import json class Custom: def __init__(self, bot): self.bot = bot #load custom command list try: with open('cc.json') as f: ...
null
cogs/custom.py
custom.py
py
6,454
python
en
code
null
code-starcoder2
76
[ { "api_name": "discord.ext.commands.bot", "line_number": 11, "usage_type": "name" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "cfg.bot", "line_number": 21, "usage_type": "attribute" }, { "api_name": "cfg.bot", "line_n...
9968031
# -*- coding: utf-8 -*- """systems """ import logging import math import random import datetime from typing import List, Tuple import esper import pygame as pg from pygame import Vector2 import flappy_bird.components as cmp import flappy_bird.entities as ent from flappy_bird.common import load_sound from flappy_bird....
null
flappy_bird/systems.py
systems.py
py
9,098
python
en
code
null
code-starcoder2
76
[ { "api_name": "random.seed", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 19, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 19, "usage_type": "attribute" }, { "api_name": "esper.Proces...
627009311
from time import time import gensim from keras.utils import to_categorical from nltk import WordNetLemmatizer, word_tokenize, FreqDist from sklearn import metrics from sklearn.cross_validation import train_test_split import preprocess as pre import pandas as pd from keras.preprocessing.text import Tokenizer from kera...
null
final/nerualNetModel.py
nerualNetModel.py
py
12,562
python
en
code
null
code-starcoder2
76
[ { "api_name": "keras.preprocessing.sequence.pad_sequences", "line_number": 23, "usage_type": "call" }, { "api_name": "keras.preprocessing.sequence.pad_sequences", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame.from_dict", "line_number": 220, "u...
198313333
import datetime from django.shortcuts import render from django.http import HttpResponse from django.template import RequestContext, loader from django_twilio.decorators import twilio_view from django.utils import timezone from twilio.twiml import Response def index(request): # Pull any data we need from DB # ...
null
circly/views.py
views.py
py
3,437
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.template.loader.get_template", "line_number": 16, "usage_type": "call" }, { "api_name": "django.template.loader", "line_number": 16, "usage_type": "name" }, { "api_name": "django.template.RequestContext", "line_number": 17, "usage_type": "call" }, ...
449522908
#!/usr/bin/env python3 import spotipy import spotipy.util as util import configparser import datetime import sys import os def is_discover_weekly(playlist_dict): return playlist_dict['name'] == 'Discover Weekly' def aggregate_spotify(sp, api_fun, params): resp = api_fun(params) agg = resp['items'] ...
null
discover-weekly-saver.py
discover-weekly-saver.py
py
2,882
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 26, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 27, "usage_type": "attribute" }, { "api_name": "configparser.ConfigParser", "line_number": 28, "usage_type": "call" }, { "api_name": "spotipy.util....
328948899
from transformers import BertModel, RobertaModel, XLNetModel, AlbertModel, ElectraModel import torch import torch.nn as nn import torch.nn.functional as F class BiGraphEncoder(nn.Module): def __init__(self, word_embedding: nn.Embedding, hidden_dim: int, dropout_...
null
nn/encode.py
encode.py
py
6,512
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Embedding", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "l...
265815945
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect from django.views import generic from links.models import Link class IndexView(generic.ListView): template_name = "links/index.html" context_object_name = "results" def get_queryset(self): return Li...
null
speeddial/links/views.py
views.py
py
521
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.views.generic.ListView", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 6, "usage_type": "name" }, { "api_name": "links.models.Link.objects.order_by", "line_number": 11, "usage_type": "call" }, ...
61647478
''' dict1 = str({'name':'xiaoming','age':18,'color':'blue'}) f = open('D:\Imooc_Interface\Other\ProvinceMemu.txt','w') f.write(dict1) f.close() f = open('D:\Imooc_Interface\Other\ProvinceMemu.txt','r') data = f.read()#data此时是str data_new = eval(data)#使用eval()函数把str 变成dict print(type(data_new)) print(data_new['name'])...
null
Other/dumps和loads的学习.py
dumps和loads的学习.py
py
3,654
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.dumps", "line_number": 90, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 97, "usage_type": "call" } ]
41795956
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf import settings from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^grappelli/', include('grappelli.urls')), url(r'^admin/', include(admi...
null
webverde/urls.py
urls.py
py
722
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 6, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.conf.urls.patterns", "line_number": 8, "usage_type": "call" }, { "api...
605613861
from __future__ import with_statement from fabric.context_managers import shell_env from fabric.api import run, env, cd __author__ = 'mm' env.hosts = ['mmcardle@mmcardle.webfactional.com'] code_dir = '/home/mmcardle/webapps/django_builder/builder' apache_bin = '/home/mmcardle/webapps/django_builder/apache2/bin/restar...
null
fabfile.py
fabfile.py
py
719
python
en
code
null
code-starcoder2
76
[ { "api_name": "fabric.api.env.hosts", "line_number": 7, "usage_type": "attribute" }, { "api_name": "fabric.api.env", "line_number": 7, "usage_type": "name" }, { "api_name": "fabric.api.run", "line_number": 13, "usage_type": "call" }, { "api_name": "fabric.api.run"...
607647902
import math from typing import Dict, Optional, Tuple, Sequence import numpy as np import pandas as pd class DataBundle: def __init__(self, x: np.ndarray, y: np.ndarray): self.x = x self.y = y @classmethod def from_unbalanced_data_bundle(cls, data_bundle: "DataBundle") -> "DataBundle": ...
null
toai/data/DataBundle.py
DataBundle.py
py
1,998
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.ndarray", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.unique", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.argwhere", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.concatenate", ...
211219103
import tensorflow as tf import os import pickle import numpy as np import tqdm import gym import logz import time import math class Config(object): def __init__(self, filename, dropout=0.5, hidden_size=[128,256,64], batch_size=256, ...
null
hw1/BehavioralCloning.py
BehavioralCloning.py
py
10,661
python
en
code
null
code-starcoder2
76
[ { "api_name": "pickle.load", "line_number": 36, "usage_type": "call" }, { "api_name": "tensorflow.placeholder", "line_number": 52, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 52, "usage_type": "attribute" }, { "api_name": "tensorflow...
444636781
from . import DATA_DIR, INVENTORY_DIR from .clean_datasets import DatabaseCleaner from .data_collection import IAMDataCollection from .electricity import Electricity from .renewables import SolarPV from .inventory_imports import ( CarmaCCSInventory, BiofuelInventory, DACInventory, HydrogenInventory, ...
null
premise/ecoinvent_modification.py
ecoinvent_modification.py
py
26,250
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 160, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 165, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 228, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_nu...
537443309
import random import pandas import matplotlib.pyplot as plt data = pandas.read_csv("bgg_db.csv", encoding="ISO-8859-1") # 1) Comparison - display a bar chart that displays how many games came out from the year 2000 to present day comparison_data = data[data["year"] >= 2000][["year", "names"]] comparison_data.hist() p...
null
basic data visualizations/lab4.py
lab4.py
py
1,913
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 5, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.title", "line_number": 10, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 10, "usage_type": "name" }, { "api_name": "matplotlib.p...
558600477
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may # not use this file except in compliance with the License. A copy of the # License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanyin...
null
test/e2e/tests/test_table.py
test_table.py
py
4,390
python
en
code
null
code-starcoder2
76
[ { "api_name": "acktest.resources.random_suffix_name", "line_number": 43, "usage_type": "call" }, { "api_name": "e2e.replacement_values.REPLACEMENT_VALUES.copy", "line_number": 45, "usage_type": "call" }, { "api_name": "e2e.replacement_values.REPLACEMENT_VALUES", "line_number"...
394617881
from django.shortcuts import render,redirect # from pwn.forms import CuisineForm from pwn.models import AdminLoginModel,StateModel,CityModel,CuisineModel from django.contrib import messages def showIndex(request): return render(request,"pwn/login.html") def pwn_login_check(request): if request.method == "PO...
null
OnlineFood/pwn/views.py
views.py
py
5,891
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "pwn.models.AdminLoginModel.objects.get", "line_number": 14, "usage_type": "call" }, { "api_name": "pwn.models.AdminLoginModel.objects", "line_number": 14, "usage_type": "attr...
16527108
from django.conf.urls import patterns, url from root import views urlpatterns = patterns('', url(r'^$', views.search, name='search'), url(r'^login$', 'app.account.login'), url(r'^logout$', 'app.account.logout'), url(r'^signup$', 'app.account.signup'), )
null
Website/root/urls.py
urls.py
py
260
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 5, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "root.views.search", "line_number": 6, "usage_type": "attribute" }, { "api_name": "ro...
443018062
import os import csv import configparser import re from pathlib import Path class CsvRename(): """ csv """ def csvRename(self): """ """ path = self.__csvFolderPath() filePathList = self.__getCsvFilePath(path) for filePath in filePathList: ...
null
csvRename.py
csvRename.py
py
2,122
python
en
code
null
code-starcoder2
76
[ { "api_name": "configparser.ConfigParser", "line_number": 27, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path", ...
509350527
import copy import math import numpy as np import torch from torch.nn import Parameter, init from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # Implementation of Twin Delayed Deep Deterministic Policy Gradi...
null
TD3.py
TD3.py
py
11,928
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.device", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn.Module"...
366818972
from collections import Counter import numpy as np def gen(X, y, augment, balanced): n = len(X) if balanced: counter = Counter(y) weights = np.array([1 / counter[val] for val in y]) weights /= weights.sum() idxs = np.random.choice(range(n), n, p=weights) else: idxs ...
null
utils/data.py
data.py
py
666
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 8, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", ...
12958522
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 22 22:46:09 2021 @author: botond if 91*109*91 then voxel size is 2mm (standard MNI space) """ # ============================================================================= # Setup # ==============================================================...
null
neurofunction/neurofunction_fig_sex_strat.py
neurofunction_fig_sex_strat.py
py
5,715
python
en
code
null
code-starcoder2
76
[ { "api_name": "IPython.get_ipython", "line_number": 25, "usage_type": "call" }, { "api_name": "IPython.get_ipython", "line_number": 27, "usage_type": "call" }, { "api_name": "IPython.get_ipython", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.a...
589686899
import pandas as pd import numpy as np import os os.environ['LIBROSA_CACHE_DIR'] = '/tmp/librosa_cache' # Enable librosa cache import librosa as lb import utils_audio_transcript as utils from csv import reader from pickle import load, dump, HIGHEST_PROTOCOL from os.path import isfile from sklearn.neural_netwo...
null
music_detection.py
music_detection.py
py
32,916
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.environ", "line_number": 4, "usage_type": "attribute" }, { "api_name": "numpy.mean", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.sqrt", "line_number": 32, "usage_type": "call" }, { "api_name": "numpy.random.randn", "line_n...
487667760
#=============================================================================== # # Pack Compile Test All # # GENERAL DESCRIPTION # Script for compiling all Pack CompileTest Builds # # Copyright (c) 2011-2012 by QUALCOMM Technologies, Incorporated. # All Rights Reserved. # QUALCOMM Proprietary/GTDR # #-------------...
null
office1/nhlos/modem_proc/pack/pack_compile_test_all.py
pack_compile_test_all.py
py
18,553
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.path.append", "line_number": 56, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 56, "usage_type": "attribute" }, { "api_name": "os.path.isdir", "line_number": 110, "usage_type": "call" }, { "api_name": "os.path", "line_numb...
327216898
# -*- coding: utf-8 -*- # run.py for lyp_bridge, lieying_plugin python3 to C# .net bridge, sceext <sceext@foxmail.com> # version 0.2.0.0 test201509220850 # import # NOTE try to fix import try: from .lib import main except Exception: from lib import main # functions # exports functions, just call functions ...
null
src/run.py
run.py
py
517
python
en
code
null
code-starcoder2
76
[ { "api_name": "lib.main.GetVersion", "line_number": 16, "usage_type": "attribute" }, { "api_name": "lib.main", "line_number": 16, "usage_type": "name" }, { "api_name": "lib.main.Install", "line_number": 17, "usage_type": "attribute" }, { "api_name": "lib.main", ...
612298893
#!/usr/bin/env python3 from sys import argv import numpy as np from scipy.spatial import Voronoi def poly_area(verts): # print('verts =', verts) tot = 0 for i in range(len(verts)): j = (i+1) % len(verts) # print('i =', i, 'j =', j) tot += verts[i][0] * verts[j][1] - verts[i][1] * vert...
null
day06/chronal_voronoi.py
chronal_voronoi.py
py
990
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 24, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.spatial.Voronoi", "line_number": 33, "usage_type": "call" } ]
233824742
#Importing the libraries import pandas as pd import matplotlib.pyplot as plt import numpy as np #importing the datasets path = '/Users/apple/Desktop/machine learning template/CLASSIFIER/SVM/' dataset = pd.read_csv(path + 'pulsar_stars.csv') X = dataset.iloc[:,:-1].values y = dataset.iloc[:,-1].values dataset.columns ...
null
SVM/SVM.py
SVM.py
py
1,775
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 16, "usage_type": "name" }, { "api_name": "matplotlib....
37810261
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('userstory', '0007_auto_20150429_2108'), ('flujos', '0006_flujo_copia'), ] operations = [ migrations.AddField( ...
null
apps/flujos/migrations/0007_auto_20150430_0233.py
0007_auto_20150430_0233.py
py
694
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 15, "usage_type": "call" }, { ...
120915876
""" Tests for pejnet.structure.py """ import re from unittest import mock import pytest from pejnet.pipeline.structure import clean_quote from pejnet.pipeline.structure import jsonify_quote from pejnet.pipeline.structure import find_character from pejnet.pipeline.structure import find_quote from pejnet.pipeline.char...
null
tests/structure_test.py
structure_test.py
py
1,616
python
en
code
null
code-starcoder2
76
[ { "api_name": "pejnet.pipeline.structure.clean_quote", "line_number": 34, "usage_type": "call" }, { "api_name": "pytest.mark.parametrize", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.mark", "line_number": 17, "usage_type": "attribute" }, { "ap...
206746343
import os, urllib3 import json import datetime http = urllib3.PoolManager() url = os.environ.get('chime_url') def format_time(tstamp): return datetime.datetime.fromtimestamp(float(tstamp)).strftime("%Y-%m-%d %H:%M:%S") def lambda_handler(event, context): for record in event['Records']: item = r...
null
lambda-functions/lambda_notifier.py
lambda_notifier.py
py
2,398
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib3.PoolManager", "line_number": 5, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 7, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.fro...
220111389
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Mar 23 14:07:34 2017 @author: arvardaz """ import os,sys from glob import glob1 from scipy.misc import imread, imsave import numpy as np from time import time def randomSlice(im): a = np.random.choice(im.shape[0], 2, replace=False) b = np....
null
thesis/misc/generate_image_slices.py
generate_image_slices.py
py
792
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.choice", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 16, "usage_type": "attribute" }, { "api_name": "numpy.random.choice", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.rando...
508863492
import os import sys import csv import shutil import copy def mixDS(lNames, lLabels): """ lNames: list of list of str, names of datasets lLabels: list of list of list of 5-int box return: dict, k: str, filename. v: list of 5-int box, all boxes in the image. """ if len(lNames) ...
null
det/functions.py
functions.py
py
5,930
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.exit", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.isdir", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path", "line_number": 34, ...
421285580
__author__ = 'Bouhm' #Methods that access API and return dictionary/JSON files of data #d import requests import json import re import pprint from constants import URL_RIOT_API as API, API_VERSIONS as VER class RiotAPIData(object): def __init__(self, api_key, region='na'): self.api_key = api_key ...
null
riot_API_data.py
riot_API_data.py
py
8,596
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 24, "usage_type": "call" }, { "api_name": "constants.URL_RIOT_API", "line_number": 25, "usage_type": "name" }, { "api_name": "constants.URL_RIOT_API", "line_number": 38, "usage_type": "name" }, { "api_name": "constants....
117445673
#!/usr/bin/python from __future__ import print_function import libvirt import sched, time CONFIG_FILE = '../vmlist.conf' global conn global vmlist global vmobjlist global cpulist global vminfolist global numpcpu global s s = sched.scheduler(time.time, time.sleep) def get_pcpu(): hostinfo = conn.getInfo() r...
null
Project 1/test/cpu/monitor.py
monitor.py
py
1,750
python
en
code
null
code-starcoder2
76
[ { "api_name": "sched.scheduler", "line_number": 17, "usage_type": "call" }, { "api_name": "time.time", "line_number": 17, "usage_type": "attribute" }, { "api_name": "time.sleep", "line_number": 17, "usage_type": "attribute" }, { "api_name": "libvirt.open", "li...
269812988
from .utils import * from .ApiKeyGetter import * from .Crosssection_dialog import CrosssectionDialog from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtSvg import QSvgWidget, QSvgRenderer from PyQt5.QtWebKitWidgets import QWebView from qgis.gui import * from qgis.core import...
null
GeoAtlasQGIS/Crosssection.py
Crosssection.py
py
18,257
python
en
code
null
code-starcoder2
76
[ { "api_name": "processing.core.Processing.Processing.initialize", "line_number": 24, "usage_type": "call" }, { "api_name": "processing.core.Processing.Processing", "line_number": 24, "usage_type": "name" }, { "api_name": "qgis.analysis.QgsNativeAlgorithms", "line_number": 25,...
12461874
import collections class Solution(object): def findTargetSumWays(self, nums, S): """ :type nums: List[int] :type S: int :rtype: int """ num_len = len(nums) dp = [collections.defaultdict(int) for _ in range(num_len + 1)] dp[0][0] = 1 for i, nu...
null
stacks/target-sum.py
target-sum.py
py
559
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.defaultdict", "line_number": 11, "usage_type": "call" } ]
523869796
""" This file is part of SleekBot. http://github.com/hgrecco/SleekBot See the README file for more information. """ import re import cPickle import logging import random import thread import time import copy from sleekbot.commandbot import botcmd from sleekbot.plugbot import BotPlugin import sleekbot.configha...
null
sleekbot/plugins/remember.py
remember.py
py
6,230
python
en
code
null
code-starcoder2
76
[ { "api_name": "sleekbot.plugbot.BotPlugin", "line_number": 21, "usage_type": "name" }, { "api_name": "sleekbot.plugbot.BotPlugin.__init__", "line_number": 25, "usage_type": "call" }, { "api_name": "sleekbot.plugbot.BotPlugin", "line_number": 25, "usage_type": "name" }, ...
426027440
import pyautogui import time import win32api import random import keyboard from playsound import playsound ## Configuration # Set the horizontal limit: 5 means a maximum of 5 pixels to the left or to the right every shot horizontal_range = 2 # Set the minimum and maximum amount of pixels to move the mouse ev...
null
master recoil.py
master recoil.py
py
2,142
python
en
code
null
code-starcoder2
76
[ { "api_name": "win32api.GetKeyState", "line_number": 24, "usage_type": "call" }, { "api_name": "playsound.playsound", "line_number": 29, "usage_type": "call" }, { "api_name": "playsound.playsound", "line_number": 31, "usage_type": "call" }, { "api_name": "keyboard...
280268566
import mysql.connector import json import os ''' database was stored locally so fill in the host user password and database based on the profile of your machine ''' mydb = mysql.connector.connect( host="localhost", user="username", password="password", database="database_name" ) mycursor = m...
null
stackoversight/flaskapp/database_connect.py
database_connect.py
py
2,164
python
en
code
null
code-starcoder2
76
[ { "api_name": "mysql.connector.connector.connect", "line_number": 7, "usage_type": "call" }, { "api_name": "mysql.connector.connector", "line_number": 7, "usage_type": "attribute" }, { "api_name": "mysql.connector", "line_number": 7, "usage_type": "name" }, { "api...
426485300
""" CSC108 Assignment 3: Social Networks - Starter code """ from typing import List, Tuple, Dict, TextIO def get_first_name(s: List[str]) -> str: """Get a person's first name from string s which elements are words of his/her name. >>> get_first_name(['Haley', 'Gwendolyn', 'Dunphy']) 'Haley Gwendo...
null
A3/network_functions.py
network_functions.py
py
15,705
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 5, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.Dict", "line_number": 4...
292854341
import os from sys import platform import jax.numpy as np import jax.random as random from jax.scipy.special import logsumexp from jax import grad, value_and_grad, jit, ops import matplotlib.pyplot as plt import scipy.io as sio import numpy as onp import time from scipy.optimize import minimize from matplotlib.backen...
null
jax_caleb/ssn_multi_probes.py
ssn_multi_probes.py
py
21,141
python
en
code
null
code-starcoder2
76
[ { "api_name": "jax.numpy.array", "line_number": 43, "usage_type": "call" }, { "api_name": "jax.numpy", "line_number": 43, "usage_type": "name" }, { "api_name": "jax.numpy.arange", "line_number": 61, "usage_type": "call" }, { "api_name": "jax.numpy", "line_numb...
261313631
from density_forest.random_forest import get_grid_labels from density_forest.helpers import get_values_preorder, draw_subsamples from helpers.helpers import get_padded_im, get_n_patches from helpers.create_data import data_to_clusters from matplotlib.pyplot import cm from matplotlib.patches import Ellipse, Rectangle im...
null
density_forest/helpers/plots.py
plots.py
py
17,205
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.offsetbox.OffsetImage", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.atleast_1d", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.offsetbox.AnnotationBbox", "line_number": 19, "usage_type": "call" }, { ...
472207913
import os import numpy as np from PIL import Image import torch import torchvision.transforms as transforms import dla image_dir = '/root/data/ODIR-5K_training' checkpoint_path = '/root/codes/fundus_dla/trained_model/checkpoint_008.pth.tar' evaluate_txt = '/root/data/ODIR-5K_label/lable2_val.txt' tested_txt = '/roo...
null
predict.py
predict.py
py
1,399
python
en
code
null
code-starcoder2
76
[ { "api_name": "dla.__dict__", "line_number": 19, "usage_type": "attribute" }, { "api_name": "torch.nn.DataParallel", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.load", ...
371446853
import os import jinja2 def render(tpl_path, context): path, filename = os.path.split(tpl_path) return jinja2.Environment( loader=jinja2.FileSystemLoader(path or './') ).get_template(filename).render(context) context = { 'callysto_html_url': "http://hub.jupyter.cybera.ca", 'callysto_html_domai...
null
mock_deploy.py
mock_deploy.py
py
1,152
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.split", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "jinja2.Environment", "line_number": 6, "usage_type": "call" }, { "api_name": "jinja2.FileSystemLoader", ...
3704188
import ssl import socket import logging import binascii import threading from argparse import ArgumentParser logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def connect_dns_tls_server(dns, ca_path): # according to: https://tools.ietf.org/html/rfc7858 # opening socket stream conn...
null
proxy.py
proxy.py
py
4,197
python
en
code
null
code-starcoder2
76
[ { "api_name": "logging.basicConfig", "line_number": 9, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 9, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "socket.socket",...
3551452
from django.shortcuts import render, redirect, get_object_or_404 from .models import Contact from .forms import ContactForm, NoteForm # Create your views here. def list_contacts(request): contacts = Contact.objects.all() return render(request, "contacts/list_contacts.html", {"contacts": contacts}) def conta...
null
contacts/views.py
views.py
py
2,312
python
en
code
null
code-starcoder2
76
[ { "api_name": "models.Contact.objects.all", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Contact.objects", "line_number": 8, "usage_type": "attribute" }, { "api_name": "models.Contact", "line_number": 8, "usage_type": "name" }, { "api_name": "dj...
5704120
#!/usr/bin/python3.9 import os os.chdir('root/Github/BenchyBot') import discord from discord.ext import commands import sys import platform import datetime import json import database import TerminalLogger import logging logger = logging.getLogger('discord') logger.setLevel(logging.INFO) handler = logging.FileHandl...
null
main.py
main.py
py
3,657
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.chdir", "line_number": 4, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.FileHandler", ...
93008823
from django.shortcuts import render_to_response import os import urllib def rank(request): # module_dir = os.path.dirname(__file__) # get current directory # file_path = os.path.join(module_dir, 'apr.txt') # apr_file = open('http://s3.amazonaws.com/match-history/apr.txt','r') opener = urllib.URLopener() apr_fi...
null
rank/views.py
views.py
py
1,251
python
en
code
null
code-starcoder2
76
[ { "api_name": "urllib.URLopener", "line_number": 11, "usage_type": "call" }, { "api_name": "django.shortcuts.render_to_response", "line_number": 44, "usage_type": "call" } ]
432347511
# coding: utf-8 """ Database access layer for pydici staffing module @author: Sébastien Renard (sebastien.renard@digitalfox.org) @license: AGPL v3 or newer (http://www.gnu.org/licenses/agpl-3.0.html) """ from django.db import models, connections from django.db.models import Sum, Min from django.utils.translation impor...
null
staffing/models.py
models.py
py
22,039
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.models.Model", "line_number": 27, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 27, "usage_type": "name" }, { "api_name": "django.utils.translation.ugettext", "line_number": 29, "usage_type": "call" }, { "ap...
253968631
import sys import os import time from lxml import etree from selenium import webdriver def get_comments(project_comments_url): # Opens project comments page driver = webdriver.Firefox() driver.get(project_comments_url) print("Comments loading", flush=True) # Get comments container and buttons to...
null
kingmaker.py
kingmaker.py
py
4,647
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Firefox", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 28, "usage_type": "call" }, { "api_name": "lxml.etree.f...
353477719
import logging import os import re import sys from os.path import dirname, isdir, isfile, join, realpath import aspen from aspen import resources, sockets from nose.tools import with_setup def convert_path(path): """Given a Unix path, convert it for the current platform. """ return os.sep.join(path.split...
null
aspen/tests/fsfix.py
fsfix.py
py
3,229
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.sep.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.sep", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 35, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number"...
102112404
# -*- coding: utf-8 -*- from bson.objectid import ObjectId from pyramid.security import ( Allow, Deny, Everyone, Authenticated, ALL_PERMISSIONS ) from pyramid.traversal import find_root class Resource(dict): def __init__(self, ref, parent, **kwargs): super().__init__(**kwargs) ...
null
hel/resources.py
resources.py
py
3,711
python
en
code
null
code-starcoder2
76
[ { "api_name": "pyramid.security.Allow", "line_number": 31, "usage_type": "name" }, { "api_name": "pyramid.security.ALL_PERMISSIONS", "line_number": 31, "usage_type": "name" }, { "api_name": "pyramid.security.Allow", "line_number": 32, "usage_type": "name" }, { "ap...
402689318
#!/usr/bin/env python # coding=UTF-8 ''' @Description: @Author: Raysuner @Github: https://github.com/Raysuner @LastEditors: Raysuner @Email: 17775306795@163.com @Date: 2019-05-09 19:14:40 @LastEditTime: 2019-05-24 16:04:07 ''' import datetime train_dir = './project/Subscribe/dataset/train/' test_dir = './project/Su...
null
my_dataset.py
my_dataset.py
py
981
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.datetime.now", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "attribute" } ]
32472078
"""Admin posts""" # Django from django.contrib import admin from django.utils.html import mark_safe # Models from posts.models import Post @admin.register(Post) class PostsUsers(admin.ModelAdmin): list_display = ('title', 'photo', 'user', 'created') search_fields = ( 'title', 'user__username'...
null
posts/admin.py
admin.py
py
875
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 10, "usage_type": "name" }, { "api_name": "django.utils.html.mark_safe", "line_number": 36, "usage_type": "call" }, { ...
531985784
#!/usr/bin/python3 import json def process(r, w): with open(r, 'r') as file: tweets_hash = json.load(file) tweets = [] for key in sorted(tweets_hash.keys()): tweets.append(tweets_hash[key]) import csv with open(w, 'w', newline='', encoding='utf-8') as file: csv_writer = csv.writer(file, deli...
null
src/new/osn-data/02etl_json_csv.py
02etl_json_csv.py
py
642
python
en
code
null
code-starcoder2
76
[ { "api_name": "json.load", "line_number": 7, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 15, "usage_type": "call" }, { "api_name": "json.load", "line_number": 21, "usage_type": "call" } ]
100748362
import datetime import numpy as np import itertools import tarfile import os def synthesize_route(station_lists): """ Given a list of station lists (that is: a list of lists, where each sublist consists of the series of stations which a train was purported to be heading towards at any one time), returns t...
null
gtfs_tripify/utils.py
utils.py
py
5,754
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 65, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 68, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 87, "usage_type": "call" }, { "api_name": "tarfile.open", "line_...
286305266
import pandas as pd import numpy as np from sklearn.svm import LinearSVC from sklearn.model_selection import train_test_split from sklearn.svm import SVC from sklearn.neighbors import KNeighborsClassifier # %matplotlib inline np.set_printoptions(precision=2) data = pd.read_csv(r'car.data.txt', encoding='utf-8', header...
null
SVM.py
SVM.py
py
2,363
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.set_printoptions", "line_number": 9, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.get_dummies", "line_number": 23, "usage_type": "call" }, { "api_name": "sklearn.mode...
64763087
from setuptools import setup import pybitturk with open("README.md", "r") as f: README = f.read() with open("requirements.txt", "r") as f: DEPS = f.readlines() with open("dev.requirements.txt", "r") as f: TEST_DEPS = f.readlines() GITHUB_RELEASE_URL = "https://github.com/erayerdin/pybitturk/archive/v{}...
null
pypi_install_script/pybitturk-0.1.0a2.tar/setup.py
setup.py
py
1,552
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.setup", "line_number": 16, "usage_type": "call" }, { "api_name": "pybitturk.__version__", "line_number": 18, "usage_type": "attribute" }, { "api_name": "pybitturk.__version__", "line_number": 23, "usage_type": "attribute" }, { "api_name":...
612883678
#!/usr/bin/env python # coding: utf-8 # Lab 2 Report # Cedric Kong & Tyan Trinh # In[19]: get_ipython().run_line_magic('matplotlib', 'notebook') import numpy as np import matplotlib import matplotlib.pyplot as plt import scipy from scipy.io import wavfile as wav from scipy import signal as sig import simpleaudio as...
null
Lab2-CK.TT.py
Lab2-CK.TT.py
py
3,100
python
en
code
null
code-starcoder2
76
[ { "api_name": "decimal.Decimal", "line_number": 30, "usage_type": "call" }, { "api_name": "scipy.signal.resample_poly", "line_number": 31, "usage_type": "call" }, { "api_name": "scipy.signal", "line_number": 31, "usage_type": "name" }, { "api_name": "numpy.arange"...
75458878
# status를 이용해서 최소 3개이상 이니셜 되어 있어야 한다고 표시 # sender = self.sender() # self.statusBar().showMessage("") import sys import random import time from PyQt5.QtMultimedia import QSound from PyQt5.QtCore import ( Qt, QBasicTimer ) from PyQt5.QtGui import ( QBrush, QPixmap ) from PyQt5.QtWidgets import ( QApp...
null
YoungSeo/Main/CustomizeScreen.py
CustomizeScreen.py
py
11,148
python
en
code
null
code-starcoder2
76
[ { "api_name": "PyQt5.QtWidgets.QWidget", "line_number": 45, "usage_type": "name" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 58, "usage_type": "call" }, { "api_name": "PyQt5.QtWidgets.QLabel", "line_number": 59, "usage_type": "call" }, { "api_name": ...
351519495
import sys from enum import Enum import logging import curses import curses.ascii from curses import wrapper import argparse import time from zmachine.interpreter import Story,Interpreter,OutputStream,OutputStreams,Memory,QuitException,\ StoryFileException,InterpreterException,Memory...
null
experiments/debug.py
debug.py
py
20,174
python
en
code
null
code-starcoder2
76
[ { "api_name": "zmachine.interpreter.pc", "line_number": 44, "usage_type": "attribute" }, { "api_name": "zmachine.interpreter", "line_number": 44, "usage_type": "name" }, { "api_name": "zmachine.interpreter.instruction_at", "line_number": 48, "usage_type": "call" }, { ...
544615656
import cv2 import cv2.aruco as aruco import numpy as np from picamera.array import PiRGBArray from picamera import PiCamera import time import math import glob #detects aruco markers in an image and the angle def getAngle(img, height, width, corners, ids, currentMarker): #finding angle FIELDOFVIEW = 54 c...
null
FinalDemo/Raspberry Pi/CameraFunctions.py
CameraFunctions.py
py
4,741
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 69, "usage_type": "call" }, { "api_name": "cv2.TERM_CRITERIA_EPS", "line...
341013650
import os import numpy as np import scipy.misc import h5py import cv2 import tensorflow as tf np.random.seed(123) # loading data from .h5 class DataLoaderH5(object): def __init__(self, **kwargs): self.load_size = int(kwargs['load_size']) self.fine_size = int(kwargs['fine_size']) self.data_m...
null
model/tensorflow/DataLoader.py
DataLoader.py
py
8,960
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 14, "usage_type": "call" }, { "api_name": "h5py.File", "line_n...
596074700
from copy import deepcopy from itertools import count, zip_longest from typing import Any, Generator, List EMPTY = "L" OCCUPIED = "#" FLOOR = "." def neighborsv1(matrix: List[List[Any]], i: int, j: int) -> Generator[Any, None, None]: indices = [ (i, j + 1), (i, j - 1), (i + 1, j), ...
null
year2020/d11.py
d11.py
py
2,953
python
en
code
null
code-starcoder2
76
[ { "api_name": "typing.List", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.Generator", "line_number": 10, "usage_type": "name" }, { "api_name": "typing.List", "line_numbe...
12577151
#!/usr/bin/python3 # # Output the package set that would be installed if the packages on the cmdline were installed # import os import sys import dnf import argparse import tempfile from pykickstart.errors import KickstartError from pykickstart.parser import KickstartParser from pykickstart.version import DEVEL, make...
null
depsolve-ks.py
depsolve-ks.py
py
5,040
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 17, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 52, "usage_type": "call" }, { "api_name": "os.path", "line_number": 52, "usage_type": "attribute" }, { "api_name": "os.path.isdir", ...
496437679
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2017, Battelle Memorial Institute. # # 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...
null
MixMarketServiceAgent/setup.py
setup.py
py
3,024
python
en
code
null
code-starcoder2
76
[ { "api_name": "setuptools.find_packages", "line_number": 45, "usage_type": "call" }, { "api_name": "setuptools.find_packages", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 49, "usage_type": "call" }, { "api_name": "os.p...
172376313
from django.conf.urls import patterns, url from sandman import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^ajax/$', views.ajax, name='ajax'), url(r'^dom/$', views.dom, name='dom'), url(r'^help/$', views.help, name='help'), url(r'^charmed/$', vi...
null
sleep_app/sandman/urls.py
urls.py
py
533
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 5, "usage_type": "call" }, { "api_name": "sandman.views.index", "line_number": 5, "usage_type": "attribute" }, { "api_name": "...
450545777
from sklearn.datasets import fetch_20newsgroups from sklearn.decomposition import TruncatedSVD from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn import metrics from sklearn.cluster import AgglomerativeClusteri...
null
Agglomerative-Clustering-20.py
Agglomerative-Clustering-20.py
py
2,290
python
en
code
null
code-starcoder2
76
[ { "api_name": "sklearn.datasets.fetch_20newsgroups", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.unique", "line_number": 21, "usage_type": "call" }, { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 23, "usage_type": "call...
1771272
#!/usr/bin/python3 import urllib import urllib.request import sys import json # equipe 7 (lp) API_TOKEN="b9f4e922-345d-4a56-9eac-20158a493c8e" # token de l'equipe NUM_PROBLEM = int(sys.argv[1]) # numero du probleme def envoyer_solution(solution): PRIVATE_URL='http://icfp15.de-falco.fr/teams/private/' + API_TOKE...
null
envoie_solution.py
envoie_solution.py
py
710
python
en
code
null
code-starcoder2
76
[ { "api_name": "sys.argv", "line_number": 11, "usage_type": "attribute" }, { "api_name": "urllib.request.Request", "line_number": 15, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 15, "usage_type": "attribute" }, { "api_name": "json.dumps",...
64085660
#!/usr/bin/env python """ support for netcdf XRD files from **DETECTOR NAME** in Epics Mapping Mode -- copied from xmap_netcdf.py (larch plugins) mkak 2016.07.06 """ import numpy as np import os import copy from copy import deepcopy ## Package for reading netcdf files (in scipy) try: import scipy.io.netcdf ne...
null
plugins/xrmmap/xrd_netcdf.py
xrd_netcdf.py
py
1,361
python
en
code
null
code-starcoder2
76
[ { "api_name": "scipy.io.netcdf.io", "line_number": 16, "usage_type": "attribute" }, { "api_name": "scipy.io.netcdf", "line_number": 16, "usage_type": "name" }, { "api_name": "os.stat", "line_number": 44, "usage_type": "call" } ]
577947235
#!/usr/bin/env python # coding: utf8 import random import requests from flask import Flask, make_response, render_template from flask import session, request, redirect, url_for from aes import AESCipher from mysql.connector.pooling import MySQLConnectionPool import os import hashlib import logging import argparse fr...
null
report.py
report.py
py
7,486
python
en
code
null
code-starcoder2
76
[ { "api_name": "datetime.timedelta", "line_number": 25, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 27, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.d...
61416439
# 15-112: Principles of Programming and Computer Science # Project: Camera Object/Tracking, Drawing and Image Manipulation # Name : Mohammad Al-Sooj # AndrewID : msooj # File Created: 5-11-2017 # Modification History: # Start End # 5/11 9:30 AM 5/11 1:00 PM ...
null
msoojProject.py
msoojProject.py
py
19,704
python
en
code
null
code-starcoder2
76
[ { "api_name": "cv2.VideoCapture", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.namedWindow", "line_number": 44, "usage_type": "call" }, { "api_name": "cv2.createTrackbar", "line_number": 45, "usage_type": "call" }, { "api_name": "cv2.createTrackba...
83117448
# main imports import logging import os import random # module imports from macop.solutions.BinarySolution import BinarySolution from macop.evaluators.EvaluatorExample import evaluatorExample from macop.operators.mutators.SimpleMutation import SimpleMutation from macop.operators.mutators.SimpleBinaryMutation import S...
null
examples/knapsackExample.py
knapsackExample.py
py
2,246
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.makedirs", "line_number": 22, "usage_type": "call" }, { "api_name": "logging.basicConfig", "li...
21100570
import os from nose.tools import assert_equal import sqlplain from sqlplain.util import abspath, PatchAttr, when_available thisdir = os.path.dirname(__file__) def test_abspath(): testdir = abspath('test', sqlplain) assert testdir == thisdir, testdir def test_PatchAttr(): class C(object): a = 1 ...
null
test/test_util.py
test_util.py
py
1,443
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "sqlplain.util.abspath", "line_number": 10, "usage_type": "call" }, { "api_name": "sqlplain.util.PatchA...
585066962
from src.common import FileHandler from typing import Tuple, List import pandas import numpy import os class XLSXHandler: REQUIRED_COLUMNS = ( 'name', 'surname', 'email', 'password', 'phone number' ) @staticmethod def read_xlsx(filename: str) -> pandas.DataFra...
null
src/xlsx/XLSXHandler.py
XLSXHandler.py
py
1,626
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_excel", "line_number": 21, "usage_type": "call" }, { "api_name": "os._exit", "line_number": 24, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 19, "usage_type": "attribute" }, { "api_name": "src.common.FileHandl...
368430469
from collections import Counter class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: target_freq = Counter(p) start = end = 0 char_freq = Counter() result = [] while end < len(s): char = s[end] char_freq[char] += 1 ...
null
leetcode/find_all_anagrams_in_a_string.py
find_all_anagrams_in_a_string.py
py
669
python
en
code
null
code-starcoder2
76
[ { "api_name": "collections.Counter", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 6, "usage_type": "call" } ]
427285493
import time from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities desired_cap = { 'acceptSslCerts': True, 'javascript_enabled': True, 'browser': 'Chrome', 'browser_version': '80.0', 'os': 'Windows', 'os_versi...
null
behave-sample-02/features/browserstack-lms-qa.py
browserstack-lms-qa.py
py
790
python
en
code
null
code-starcoder2
76
[ { "api_name": "selenium.webdriver.Remote", "line_number": 18, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 18, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 24, "usage_type": "call" } ]
132222108
import numpy as np np.random.seed(1337) from keras.models import Sequential from keras.layers import Dense, Activation, Dropout, Conv2D, MaxPooling2D, Flatten import matplotlib.pyplot as plt from keras.datasets import mnist from keras.optimizers import RMSprop from keras.utils import np_utils # data preprocessing (X_...
null
keras_classifier_0to9.py
keras_classifier_0to9.py
py
1,718
python
en
code
null
code-starcoder2
76
[ { "api_name": "numpy.random.seed", "line_number": 2, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 2, "usage_type": "attribute" }, { "api_name": "keras.datasets.mnist.load_data", "line_number": 11, "usage_type": "call" }, { "api_name": "kera...
153854487
#!/usr/bin/env python3 """ Determine the approriate destination for a completed transmission torrent download. See the [[file:~/.dotfiles/programs/transmission/README.org][README]]. """ import os import sys import json import logging import pathlib as p from watch_config import WatchConfig def Path(path): retur...
null
programs/transmission/scripts/dest_path.py
dest_path.py
py
5,011
python
en
code
null
code-starcoder2
76
[ { "api_name": "pathlib.Path", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.warning", "line_number": 25, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "logging.warning", ...
265221921
"""AdaGrad optimization algorithm.""" import numpy as np from ._base import BaseOptimizer from ..utils.validation import check_float class AdaGrad(BaseOptimizer): r"""The AdaGrad algorithm. The AdaGrad (*adaptive gradient*) algorithm [1]_ is a modification of gradient descent that individually adapts t...
null
deeplib/optimizer/_adagrad.py
_adagrad.py
py
2,801
python
en
code
null
code-starcoder2
76
[ { "api_name": "_base.BaseOptimizer", "line_number": 9, "usage_type": "name" }, { "api_name": "utils.validation.check_float", "line_number": 55, "usage_type": "call" }, { "api_name": "utils.validation.check_float", "line_number": 57, "usage_type": "call" }, { "api_...
286476598
# python test shapefiles import os try: from osgeo import ogr, osr except: import ogr. osr # Get Shapefile Feature Count with open("output.txt", "w") as a: for path, subdirs, files in os.walk(r'.'): for filename in files: f = os.path.join(path, filename) if f.endswith(".s...
null
tutotial_data/shapefy.py
shapefy.py
py
2,999
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.walk", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "osgeo.ogr.GetDriverByName", "li...
442141112
import torch import torch.nn as nn import torch.nn.functional as F # TODO: Change code to deal with multiple environments input class Manager(nn.Module): def __init__(self, num_actions): super(Manager, self).__init__() self.fc = nn.Linear(num_actions * 16, num_actions * 16) # todo: change ...
null
lstm_a2c/model.py
model.py
py
4,173
python
en
code
null
code-starcoder2
76
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
59696634
#!/usr/bin/python # author: cssidy # Posts Lenny emoji in response to creeper-potential comments. # ( ͡° ͜ʖ ͡°) # open Reddit in browser # run script from terminal # refresh browser to see changes # enter ctrl+c in terminal to stop script # WARNING! may get your account suspended, or many angry inbox messages # for ...
null
lenny_bot.py
lenny_bot.py
py
760
python
en
code
null
code-starcoder2
76
[ { "api_name": "praw.Reddit", "line_number": 20, "usage_type": "call" } ]
292467704
#!/usr/bin/env python import os import sys import numpy as np import pandas as pd from matplotlib import pyplot as plt def fpte_rmsd(): if ( (not os.path.exists("CONTCAR")) or (not os.path.exists("OUTCAR")) or (not os.path.exists("OSZICAR")) ): sys.exit( "\n.... Oo...
null
FPTE/FPTE_RMSD.py
FPTE_RMSD.py
py
2,014
python
en
code
null
code-starcoder2
76
[ { "api_name": "os.path.exists", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number...
624147536
#!/bin/bash from scipy.signal import convolve2d from misio.optilio.lost_wumpus import run_agent from misio.lost_wumpus.testing import test_locally from misio.lost_wumpus.agents import SnakeAgent, AgentStub, RandomAgent from misio.lost_wumpus._wumpus import Action, Field import numpy as np optilio_mode = True debug_mo...
null
optilio/lab3.py
lab3.py
py
7,602
python
en
code
null
code-starcoder2
76
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 18, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 18, "usage_type": "name" }, { "api_name": "misio.lost_wumpus._wumpus.Action", "line_number": 32, "usage_type": "name" }, { "api...
93830627
import requests from bs4 import BeautifulSoup url = "http://www.mzitu.com/" header = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36", "Referer": "http://www.mzitu.com/", } # # response = requests.get(url, he...
null
blog/meinv.py
meinv.py
py
849
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 29, "usage_type": "call" } ]
102339879
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('invigilator', '0001_initial'), ] operations = [ migrations.CreateModel( name='Institution', fields=[...
null
invigilator/migrations/0002_auto_20150402_1542.py
0002_auto_20150402_1542.py
py
886
python
en
code
null
code-starcoder2
76
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 14, "usage_type": "call" }, ...
413905757
import time import texttable as tt import os import requests import re import pywikibot.family # take out one of the comment from below #p = PageviewsClient('Amit') #p = PageviewsClient('Zac') from Delete_page import * from Access_time_detection import * from Checking_edit_time_of_page import * from Compare_edit_tim...
null
core/Milestone1_final.py
Milestone1_final.py
py
14,619
python
en
code
null
code-starcoder2
76
[ { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 29, "usage_type": "call" }, { "api_name": "os.system", "line_number": 39, "usage_type": "call" }, { "api_name": "os.system", "line_number": 40, ...
221221975
""" Frontend which scrobbles the music you play to your `Last.fm <http://www.last.fm>`_ profile. .. note:: This frontend requires a free user account at Last.fm. **Dependencies:** .. literalinclude:: ../../../requirements/lastfm.txt **Settings:** - :attr:`mopidy.settings.LASTFM_USERNAME` - :attr:`mopidy.setti...
null
mopidy/frontends/lastfm.py
lastfm.py
py
4,033
python
en
code
null
code-starcoder2
76
[ { "api_name": "mopidy.exceptions.OptionalDependencyError", "line_number": 38, "usage_type": "call" }, { "api_name": "mopidy.exceptions", "line_number": 38, "usage_type": "name" }, { "api_name": "logging.getLogger", "line_number": 40, "usage_type": "call" }, { "api...
162897479
#encoding=utf8 import pandas as pd import pymongo import pdb def get_risk_comp_classify(): f = open("./risk_comp_classify_tmp.txt","a+") df = pd.read_csv("/home/siyuan/bond_risk/bond_risk_sec/pic/bond/result2018-04-26_19:31:15.csv") conn = pymongo.MongoClient("mongodb://10.6.5.32:27017") db = conn['myDB'] co...
null
BondRisk/risk_dbscan_classify_with_comp.py
risk_dbscan_classify_with_comp.py
py
747
python
en
code
null
code-starcoder2
76
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pymongo.MongoClient", "line_number": 9, "usage_type": "call" } ]
421568075
from .document import Document import os import re import spacy from tqdm import tqdm import numpy as np from collections import defaultdict from torch.utils.tensorboard import SummaryWriter class Embeder: def __init__(self, corpus_dir): self._data = self._load_data(corpus_dir) def _load_data(self, ...
null
src/embeder.py
embeder.py
py
2,548
python
en
code
null
code-starcoder2
76
[ { "api_name": "spacy.load", "line_number": 18, "usage_type": "call" }, { "api_name": "os.walk", "line_number": 19, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 23, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 24, ...
58040973
from flask import Flask, request, Response import logging import requests import os import json app = Flask(__name__) logger = None format_string = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' logger = logging.getLogger('snowstorm') # Log to stdout stdout_handler = logging.StreamHandler() stdout_handler.s...
null
service/main.py
main.py
py
1,721
python
en
code
null
code-starcoder2
76
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 11, "usage_type": "call" }, { "api_name": "logging.StreamHandler", "line_number": 14, "usage_type": "call" }, { "api_name": "logging.Formatter"...
66536269
# -*- coding: utf-8 -*- """ Created on Tue Feb 10 10:52:24 2015 @author: markus """ from __future__ import print_function from argparse import ArgumentParser #%% def add_start_stop(in_file, n = 1): line_count = 0 # current line lines = [] # lines last_line_newline = False # bool that indicates if l...
null
code/partA/start_stop_adder.py
start_stop_adder.py
py
2,356
python
en
code
null
code-starcoder2
76
[ { "api_name": "argparse.ArgumentParser", "line_number": 63, "usage_type": "call" } ]
637840192
from re import compile from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from .models import InvitationToken INVITATION_EXEMPT_URLS = [ compile(r'^%s/?' % reverse('django_rocket:request_invitation').lstrip('/')), compile(r'^%s/?' % rever...
null
django_rocket/middleware.py
middleware.py
py
1,263
python
en
code
null
code-starcoder2
76
[ { "api_name": "re.compile", "line_number": 9, "usage_type": "call" }, { "api_name": "django.core.urlresolvers.reverse", "line_number": 9, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 10, "usage_type": "call" }, { "api_name": "django.core.urlr...
161674698
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean CLI v1.0. Copyright 2021 QuantConnect Corporation. # # 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...
null
lean/models/products/security/equity_option.py
equity_option.py
py
4,134
python
en
code
null
code-starcoder2
76
[ { "api_name": "enum.Enum", "line_number": 25, "usage_type": "name" }, { "api_name": "lean.models.products.security.base.SecurityMasterSecurityProduct", "line_number": 42, "usage_type": "name" }, { "api_name": "lean.models.products.security.base.DataType", "line_number": 46, ...