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
6555235
import scrapy from ..items import GuaziItem class GuaziSpider(scrapy.Spider): name = 'guazi2' allowed_domains = ['www.guazi.com'] #重写start_url start_requests()方法 def start_requests(self): """生成所有的url地址,一次性交给调度器""" for i in range(1,6): url = 'https://www.guazi.com/ty/buy/o...
null
Spider/day08/Guazi/Guazi/spiders/guazi2.py
guazi2.py
py
962
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.Spider", "line_number": 4, "usage_type": "attribute" }, { "api_name": "scrapy.Request", "line_number": 13, "usage_type": "call" }, { "api_name": "items.GuaziItem", "line_number": 18, "usage_type": "call" } ]
565145640
from django.test import TestCase from django.urls import reverse from complaint.apps import ComplaintConfig from complaint.models import Complaint from django.utils import timezone class ComplaintConfigTest(TestCase): def test_apps(self): self.assertEqual(ComplaintConfig.name, "complaint") class Complai...
null
complaint/tests.py
tests.py
py
2,300
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 8, "usage_type": "name" }, { "api_name": "complaint.apps.ComplaintConfig.name", "line_number": 10, "usage_type": "attribute" }, { "api_name": "complaint.apps.ComplaintConfig", "line_number": 10, "usage_type": "name" }...
43966129
import json import datetime from collections import Counter import json import datetime import sys out = {"books": [], "cds": [], "films": []} everything = {"library": {}} helabiblan = "my_library_register.json" def get_inputs_book(): #user input to record the log dbok = {} print("***********...
null
tonymain.py
tonymain.py
py
8,879
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.dump", "line_number": 105, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 112, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 112, "usage_type": "attribute" }, { "api_name": "datetime.da...
464662086
import codecs from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from scrapy.utils.log import configure_logging from website_scraper.spiders.presales_spider import PresalesSpider from elasticsearch import Elasticsearch from urlparse import urlparse, urlunparse ELASTICSEA...
null
presales_scraper/scrape_companies.py
scrape_companies.py
py
3,142
python
en
code
null
code-starcoder2
83
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 48, "usage_type": "call" }, { "api_name": "codecs.open", "line_number": 55, "usage_type": "call" }, { "api_name": "urlparse.urlparse", "line_number": 57, "usage_type": "call" }, { "api_name": "urlparse.ur...
392703441
from math import sqrt, atan2, log import pygame.gfxdraw as gfx import pygame NICE = True if NICE: def line(surface, colour, start, end, width=1): dx = end[0] - start[0] dy = end[1] - start[1] linelength = sqrt(dx * dx + dy * dy) if linelength == 0: return dx...
null
animlib/draw.py
draw.py
py
3,050
python
en
code
null
code-starcoder2
83
[ { "api_name": "math.sqrt", "line_number": 13, "usage_type": "call" }, { "api_name": "pygame.gfxdraw.filled_polygon", "line_number": 32, "usage_type": "call" }, { "api_name": "pygame.gfxdraw", "line_number": 32, "usage_type": "name" }, { "api_name": "pygame.gfxdraw...
335574123
from stdnet.exceptions import * from stdnet.utils import encoders from .fields import Field from . import related from .struct import * __all__ = ['ManyFieldManagerProxy', 'Many2ManyManagerProxy', 'MultiField', 'SetField', 'ListField', 'HashField'] ...
null
stdnet/orm/std.py
std.py
py
8,337
python
en
code
null
code-starcoder2
83
[ { "api_name": "fields.Field", "line_number": 69, "usage_type": "name" }, { "api_name": "stdnet.utils.encoders.Json", "line_number": 111, "usage_type": "call" }, { "api_name": "stdnet.utils.encoders", "line_number": 111, "usage_type": "name" }, { "api_name": "stdne...
397230784
from __future__ import print_function from PIL import Image from numpy import clip from math import pi,atan2,hypot,floor import os import shutil import time restriction=['Cancel', 'cancel', 'CANCEL', ' Cancel', ' cancel', ' CANCEL', 'Cancel ', 'cancel ', 'CANCEL '] print("Wirte a direction as the example or w...
null
Python Converter/360image.py
360image.py
py
11,487
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.walk", "line_number": 22, "usage_type": "call" }, { "api_name": "os.mkdir", "line_number": 24, "usage_type": "call" }, { "api_name": "math.atan2", "line_number": 68, "usage_type": "call" }, { "api_name": "math.hypot", "line_number": 69, "...
575439170
#-*- coding:utf-8 -*- ''' Normal Distribution, also called Gaussian Distribution ''' import numpy as np import matplotlib.pyplot as plt def simple_plot(): x = np.linspace(0, 10, 10000) y = np.random.normal(0, x) z = np.cos(x**2) plt.figure(figsize = (8, 4)) plt.plot(x, y, label = "sin(x)", color ...
null
python/distribution/Gaussian.py
Gaussian.py
py
1,404
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.linspace", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.random.normal", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 11, "usage_type": "attribute" }, { "api_name": "numpy.cos", ...
512803119
from django.contrib.auth import authenticate, login from django.shortcuts import redirect from django.views.decorators.csrf import csrf_exempt from .models import * from django.http import HttpResponse from django.core import serializers from app.settings import PROJECT_ROOT import json import os @csrf_exempt def logi...
null
skalvi/ApiFunctions.py
ApiFunctions.py
py
6,023
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.contrib.auth.authenticate", "line_number": 61, "usage_type": "call" }, { "api_name": "django.contrib.auth.login", "line_number": 76, "usage_type": "call" }, { "api_name": "django.shortcuts.redirect", "line_number": 81, "usage_type": "call" }, { ...
295428308
import os import yaml import torch import nibabel as nib import numpy as np import pandas as pd import torch.nn as nn import torch.nn.functional as F from torch import optim import time import pickle from torch.utils.data import Dataset, DataLoader from torch.optim.lr_scheduler import LambdaLR,MultiStepLR import matplo...
null
Models/Model 1/Additional Hyperparameter Tuning Scripts/pretrained_point001_point6.py
pretrained_point001_point6.py
py
5,721
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 19, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 19, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_number...
624394066
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.9 (default, Apr 18 2020, 01:56:04) # [GCC 8.4.0] # Embedded file name: build/bdist.macosx-10.7-x86_64/egg/airflow/contrib/sensors/aws_sqs_sensor.py # Compiled at: 2019-09-11 03:47:34 # Size of source mod 2**32: 3692 bytes from airflo...
null
pycfiles/apache_airflow_arup-1.10.5-py3.6/aws_sqs_sensor.cpython-36.py
aws_sqs_sensor.cpython-36.py
py
2,946
python
en
code
null
code-starcoder2
83
[ { "api_name": "airflow.sensors.base_sensor_operator.BaseSensorOperator", "line_number": 13, "usage_type": "name" }, { "api_name": "airflow.utils.decorators.apply_defaults", "line_number": 17, "usage_type": "name" }, { "api_name": "airflow.contrib.hooks.aws_sqs_hook.SQSHook", ...
521203540
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import parler.models import aldryn_translation_tools.models import django.contrib.postgres.fields import djangocms_text_ckeditor.fields class Migration(migrations.Migration): dependencies = [ ('aldry...
null
aldryn_people/migrations/0020_auto_20170228_1549.py
0020_auto_20170228_1549.py
py
3,217
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.db.migrations.Migration", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 11, "usage_type": "name" }, { "api_name": "django.db.migrations.CreateModel", "line_number": 18, "usage_type": "call" }, ...
395763368
import cv2 import numpy as np from keras.models import model_from_json import base64 import face.CNN_MODEL as cnn def predict_emotion(face_image_gray,sess): resized_img = cv2.resize(face_image_gray, (48,48), interpolation = cv2.INTER_AREA) pixel = np.zeros((48,48)) for i in range(48): for j in range...
null
face/FACE.py
FACE.py
py
1,127
python
en
code
null
code-starcoder2
83
[ { "api_name": "cv2.resize", "line_number": 10, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "line_number": 11, "usage_type": "call" }, { "api_name": "face.CNN_MODEL.Predict", ...
265298716
import sys import constants as c from config import Config from irc.session import Session from lunatic import Lunatic def main(): c.write("Lunatic started") if c.DEBUG: config = Config("lunatic.yaml.debug") else: config = Config("lunatic.yaml") config.load() irc_session = Sess...
null
lunatic/__main__.py
__main__.py
py
478
python
en
code
null
code-starcoder2
83
[ { "api_name": "constants.write", "line_number": 11, "usage_type": "call" }, { "api_name": "constants.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "config.Config", "line_number": 14, "usage_type": "call" }, { "api_name": "config.Config", ...
114608526
#!/bin/env python # -*- coding:UTF8 -*- #菜鸟教程: http://www.runoob.com/python3/python-mongodb.html import time import pymongo from datetime import datetime from datetime import timedelta from pymongo import MongoClient from pymongo.collation import Collation import re import os import sys path='./include' sys.path.ins...
null
tools/mongo_index.py
mongo_index.py
py
2,391
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.insert", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "functions.get_config", "line_number": 19, "usage_type": "call" }, { "api_name": "functions.get_conf...
107261190
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler def normalizer(x): m = x.shape[0] x = x - np.mean(x) x = (x * m) / (np.sum(x ** 2)) # x = x - np.mean(x) # x = x / np.sqrt(np.sum(x**2) / len(x) - 1) re...
null
codes/preprocessing.py
preprocessing.py
py
15,810
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.mean", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.sum", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 17, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_num...
294036281
import settings import packages.ipm_cloud_postgresql.model as model import bth.interacao_cloud as interacao_cloud from datetime import datetime def iniciar(): print(':: Iniciando migração do sistema Protocolo') global ano_inicial # ano_inicial = 2000 ano_inicial = input("Ano inicial para migração: ") ...
null
packages/ipm_cloud_postgresql/frotas/enviar.py
enviar.py
py
3,519
python
en
code
null
code-starcoder2
83
[ { "api_name": "bth.interacao_cloud.verifica_token", "line_number": 27, "usage_type": "call" }, { "api_name": "bth.interacao_cloud", "line_number": 27, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 51, "usage_type": "call" }, { "api_...
370308293
# Import Table, Column, String, Integer, Float, Boolean from sqlalchemy from sqlalchemy import create_engine, MetaData, Table, Column, String, Integer, Float, Boolean engine = create_engine('sqlite://') # in memory metadata = MetaData() # Define a new table with a name, count, amount, and valid column: data data = T...
null
datacamp/sqlalchemy/create_table.py
create_table.py
py
1,060
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.create_engine", "line_number": 4, "usage_type": "call" }, { "api_name": "sqlalchemy.MetaData", "line_number": 6, "usage_type": "call" }, { "api_name": "sqlalchemy.Table", "line_number": 8, "usage_type": "call" }, { "api_name": "sqlalchemy...
292007069
# map # filter # reduce # numbers = ["3","34","64"] # # # for i in range(len(numbers)) : # # numbers[i] = int(numbers[i]) # numbers = list(map(int,numbers)) # # numbers[2] = numbers[2] + 1 # print(numbers[2]) # 65 # numbers = list(map(int,numbers)) # def sq(...
null
38_map_filter.py
38_map_filter.py
py
1,305
python
en
code
null
code-starcoder2
83
[ { "api_name": "functools.reduce", "line_number": 46, "usage_type": "call" } ]
618335268
import psutil class Stat(object): def __init__(self): self.connections = [] self.io_stat = [] def scan_stat(process, stat): try: stat.connections.extend(process.connections()) if hasattr(process, "io_counters"): stat.io_stat.append(process.io_counters()) f...
null
monitor/psstat.py
psstat.py
py
1,659
python
en
code
null
code-starcoder2
83
[ { "api_name": "psutil.NoSuchProcess", "line_number": 17, "usage_type": "attribute" }, { "api_name": "psutil.Process", "line_number": 54, "usage_type": "call" } ]
429324191
# from bunch import Bunch import logging import numpy as np import pandas as pd import tigerml.core.dataframe as td from tigerml.core.utils import DictObject, compute_if_dask _LOGGER = logging.getLogger(__name__) class Encoder: """Encoder class.""" METHODS = DictObject({"onehot": "onehot", "ordinal": "ord...
null
src/ta_lib/_vendor/tigerml/core/preprocessing/encoder.py
encoder.py
py
14,469
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 10, "usage_type": "call" }, { "api_name": "tigerml.core.utils.DictObject", "line_number": 16, "usage_type": "call" }, { "api_name": "tigerml.core.dataframe.helpers.tigerify", "line_number": 27, "usage_type": "call" }, ...
620317379
#!/usr/bin/python2.7 import rospy from geometry_msgs.msg import PoseStamped, PoseWithCovarianceStamped from nav_msgs.msg import OccupancyGrid, Path from visualization_msgs.msg import MarkerArray, Marker import visualization_msgs import copy import planners.astar from move import Move from state import State from robot...
null
visualization/rviz_tools_py/src/rviz_tools_py/test_bug.py
test_bug.py
py
4,057
python
en
code
null
code-starcoder2
83
[ { "api_name": "move.Move", "line_number": 21, "usage_type": "call" }, { "api_name": "move.Move", "line_number": 22, "usage_type": "call" }, { "api_name": "move.Move", "line_number": 23, "usage_type": "call" }, { "api_name": "move.Move", "line_number": 24, ...
647500287
import os import csv from reportlab.pdfgen import Canvas from reportlab.lib.pagesizes import letter from reportlab.lib.units import inch from reportlab.lib import colors from reporlab.platypus import Table xmargin = 3.2 * inch ymargin = 6 * inch my_path = "/Users/staniya/Downloads/book1-exercises-master/chp09/practic...
null
ReportLab.py
ReportLab.py
py
1,245
python
en
code
null
code-starcoder2
83
[ { "api_name": "reportlab.lib.units.inch", "line_number": 9, "usage_type": "name" }, { "api_name": "reportlab.lib.units.inch", "line_number": 10, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path...
430362458
#!/usr/bin/env python import array import json import sys import re from time import sleep import traceback import usb.core import argparse import struct import sys HOST_TO_DEVICE = 0x40 DEVICE_TO_HOST = 0xC0 TIMEOUT_MS = 1000 PAGE_SIZE = 64 class Fixture(object): def __init__(self): self.eeprom_pages ...
null
generic/eeprom-util.py
eeprom-util.py
py
18,429
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "usb.core.core.find", "line_number": 46, "usage_type": "call" }, { "api_name": "usb.core.core", "line_number": 46, "usage_type": "attribute" }, { "api_name": "usb.cor...
209464419
# -*- coding: utf-8 -*- #------------------------ # v2021-10-30 1. update test #======================== from flask import Flask, request, abort, render_template, Response from flask import json, jsonify, session, redirect, url_for #from flask_cors import CORS, cross_origin # for cross domain problem from flask impo...
null
W05/W04_補充/flask-cron-03/app.py
app.py
py
4,674
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 22, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 30, "usage_type": "attribute" }, { "api_name": "flask.requ...
410073298
# -*- coding: utf-8 -*- import json """ --- Day 12: JSAbacusFramework.io --- Santa's Accounting-Elves need help balancing the books after a recent order. Unfortunately, their accounting software uses a peculiar storage format. That's where you come in. They have a JSON document which contains a variet...
null
day12.py
day12.py
py
1,386
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 48, "usage_type": "call" } ]
132469264
#!/usr/bin/python3 ''' starts a Flask web application ''' from flask import Flask, render_template from models import storage app = Flask(__name__) @app.route('/hbnb', strict_slashes=False) def states_hbnb(): ''' display “states HBNB!” ''' list_state = list(storage.all("State").values()) list_amenity = li...
null
web_flask/100-hbnb.py
100-hbnb.py
py
813
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 5, "usage_type": "call" }, { "api_name": "models.storage.all", "line_number": 11, "usage_type": "call" }, { "api_name": "models.storage", "line_number": 11, "usage_type": "name" }, { "api_name": "models.storage.all", ...
123157719
# -*- coding: utf-8 -*- """ Created on Wed Jul 18 17:37:51 2018 @author: 10257 """ import urllib.request as r import json url = [] for i in range(0,100): i+=44 url.append("https://s.taobao.com/search?q=%E8%A3%99%E5%AD%90&imgfile=&commend=all&ssid=s5-e&search_type=item&sourceId=tb.index&spm=a21bo.201...
null
case7.py
case7.py
py
976
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.urlopen", "line_number": 17, "usage_type": "call" }, { "api_name": "urllib.request", "line_number": 17, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" } ]
174146171
#Flask RestFul #Get #Post #Put #Delete from flask import Flask from flask_restful import Api,Resource from Controller.cerveja_controller import CervejaController app=Flask(__name__) api=Api(app) api.add_resource(CervejaController,'/api/cerveja') @app.route('/') def inicio(): return 'Bem vindo a API' app.run(debu...
null
Aula36/aula36.py
aula36.py
py
335
python
en
code
null
code-starcoder2
83
[ { "api_name": "flask.Flask", "line_number": 10, "usage_type": "call" }, { "api_name": "flask_restful.Api", "line_number": 11, "usage_type": "call" }, { "api_name": "Controller.cerveja_controller.CervejaController", "line_number": 12, "usage_type": "argument" } ]
618230781
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule from ..items import JobboleSpiderItem from scrapy.loader import ItemLoader class JobboleSpider(CrawlSpider): name = 'jobbole' allowed_domains = ['web.jobbole.com'] start_urls ...
null
jobbole_spider/spiders/jobbole.py
jobbole.py
py
987
python
en
code
null
code-starcoder2
83
[ { "api_name": "scrapy.spiders.CrawlSpider", "line_number": 9, "usage_type": "name" }, { "api_name": "scrapy.spiders.Rule", "line_number": 15, "usage_type": "call" }, { "api_name": "scrapy.linkextractors.LinkExtractor", "line_number": 15, "usage_type": "call" }, { ...
67376494
import mysql.connector import logging import pandas as pd import os from pathlib import Path logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) from util.json_util import * class db_connector: def __init__(self): ...
null
transport/db_transport.py
db_transport.py
py
4,188
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 6, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 6, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "pathlib.Path", ...
64076946
from django.shortcuts import render,redirect from .models import Question from django.http import HttpResponse,HttpResponseRedirect from django.core.urlresolvers import reverse import json def Home_view(request): msg='Hi' return render(request,'QDemo/Home.html',{'msg':msg}) def RootQuestion_view(request): question=Q...
null
QDemo/views.py
views.py
py
1,313
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.shortcuts.render", "line_number": 8, "usage_type": "call" }, { "api_name": "models.Question.objects.all", "line_number": 10, "usage_type": "call" }, { "api_name": "models.Question.objects", "line_number": 10, "usage_type": "attribute" }, { "a...
130556696
import voluptuous as vol import esphomeyaml.config_validation as cv from esphomeyaml import automation from esphomeyaml.const import CONF_DEVICE_CLASS, CONF_ID, CONF_INTERNAL, CONF_INVERTED, \ CONF_MAX_LENGTH, CONF_MIN_LENGTH, CONF_MQTT_ID, CONF_ON_CLICK, CONF_ON_DOUBLE_CLICK, \ CONF_ON_PRESS, CONF_ON_RELEASE,...
null
esphomeyaml/components/binary_sensor/__init__.py
__init__.py
py
7,072
python
en
code
null
code-starcoder2
83
[ { "api_name": "esphomeyaml.config_validation.PLATFORM_SCHEMA.extend", "line_number": 19, "usage_type": "call" }, { "api_name": "esphomeyaml.config_validation.PLATFORM_SCHEMA", "line_number": 19, "usage_type": "attribute" }, { "api_name": "esphomeyaml.config_validation", "line...
279953303
"""Table-of-contents magic for IPython Notebook Just do: %load_ext nbtoc %nbtoc to get a floating table of contents All the interesting code, c/o @magican and @nonamenix: https://gist.github.com/magican/5574556 """ import io import os from IPython.display import display_html, display_javascript here = os.path.a...
null
nbtoc.py
nbtoc.py
py
1,386
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.abspath", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path.isfile", "li...
381817887
import paho.mqtt.client as mqtt import time import csv import datetime import pyradamsa rad = pyradamsa.Radamsa() topic = "dev/test" m = "Sending message " def on_connect(client, userdata, flags, rc): print(f"Connected with result code {rc}") client = mqtt.Client() cases = [] with open("usernames-to-mutate....
null
Simple fuzzer/username fuzz/mqtt username fuzz.py
mqtt username fuzz.py
py
1,291
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyradamsa.Radamsa", "line_number": 7, "usage_type": "call" }, { "api_name": "paho.mqtt.client.Client", "line_number": 14, "usage_type": "call" }, { "api_name": "paho.mqtt.client", "line_number": 14, "usage_type": "name" }, { "api_name": "csv.writer"...
18329281
import os os.environ['KMP_DUPLICATE_LIB_OK']='True' import warnings warnings.filterwarnings("ignore") from PIL import Image import numpy as np from colorizers import eccv16, siggraph17 from skimage import color import torch import torch.nn.functional as F from IPython import embed import argparse import matplotlib.py...
null
image_colorization.py
image_colorization.py
py
2,727
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ", "line_number": 2, "usage_type": "attribute" }, { "api_name": "warnings.filterwarnings", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 18, "usage_type": "attribute" }, { "api_name": "sys.argv", "l...
301619966
import argparse import numpy as np import os def scale(x): x_min, x_max = np.min(x, axis=0), np.max(x, axis=0) return (x - x_min)/(x_max-x_min) def normalize(x): x_mean, x_std = np.mean(x, axis=0), np.std(x, axis=0) return (x - x_mean)/x_std def preprocess(filepath): input_data = np.loadtxt(fi...
null
Assignment_1/utils/data_preprocessing_part_b.py
data_preprocessing_part_b.py
py
1,123
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.min", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 7, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.std", "line_number": 12, "...
379473309
import optparse from django.core.management import base class Command(base.BaseCommand): """ Base class for a declarative management command API. """ option_list = () option_groups = () option_names = () actions = () def usage(self, subcommand): """ Override ...
null
grunt/management/base.py
base.py
py
2,568
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.core.management.base", "line_number": 6, "usage_type": "name" }, { "api_name": "optparse.OptionGroup", "line_number": 35, "usage_type": "call" }...
392091621
#wapp to wish the user gm/ga/ge import datetime dt = datetime.datetime.now() hour = dt.hour if( hour >=6 and hour <=12): print("gm") elif( hour >=12 and hour <=15): print("ga") else: print("ge")
null
L11/P4.py
P4.py
py
201
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 5, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 5, "usage_type": "attribute" } ]
524764222
from sklearn.naive_bayes import MultinomialNB #[possui brilho?, Possui vários metros cúbicos ?, Possui Trasnparência ?, É denso?] rocha1 = [0,1,0,0] rocha2 = [1,1,0,0] rocha3 = [0,1,0,0] mineral1 = [1,0,1,1] mineral2 = [0,0,1,1] mineral3 = [1,0,0,1] dados = [rocha1, rocha2, rocha3, mineral1, mineral2, mineral3] marca...
null
Questao02.py
Questao02.py
py
1,255
python
en
code
null
code-starcoder2
83
[ { "api_name": "sklearn.naive_bayes.MultinomialNB", "line_number": 13, "usage_type": "call" } ]
570160576
# -*- coding: utf-8 -*- """ Created on Wed Dec 5 14:01:30 2018 @author: bazzz """ import numpy as np from math import sqrt import matplotlib.pyplot as plt from scipy.misc import face import time from imageio import imread, imsave #Z = face()[100:500,400:1000,1]/255 #imgName = 'Face' Z = imread('Rain.jpg')[:,:,0]/...
null
Total Variation Denoising - Fall 2018/TVL1 Steepest.py
TVL1 Steepest.py
py
2,495
python
en
code
null
code-starcoder2
83
[ { "api_name": "imageio.imread", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random.seed", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 24, "usage_type": "attribute" }, { "api_name": "numpy.random.norma...
251476502
from __future__ import print_function from time import time import csv import sys import os from sklearn.feature_extraction.text import CountVectorizer import numpy as np import lda import logging logging.basicConfig(filename='lda_analyser.log', level=logging.DEBUG) if not os.path.exists("results"): os.makedirs...
null
src/lda_without_tf_idf.py
lda_without_tf_idf.py
py
3,013
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 13, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "...
146724018
from igraph import * import igraph import xml.etree.ElementTree as ET from skimage import io from skimage import transform import cv2 import numpy as np import argparse def parserargs(): parser = argparse.ArgumentParser() parser.add_argument('-image', action='store', dest='image') ...
null
contextual_extractor.py
contextual_extractor.py
py
3,504
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.imshow", "line_number": 33, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 34, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows"...
508767213
from loguru import logger from util import util import requests import json # Using math.js web service for expression eval API_URL = "http://api.mathjs.org/v4/?expr=" def handle(update, context): util.log_chat("calc", update) query = update.message.text query = query.split(" ") try: calc...
null
src/handlers/calc.py
calc.py
py
780
python
en
code
null
code-starcoder2
83
[ { "api_name": "util.util.log_chat", "line_number": 13, "usage_type": "call" }, { "api_name": "util.util", "line_number": 13, "usage_type": "name" }, { "api_name": "loguru.logger.info", "line_number": 24, "usage_type": "call" }, { "api_name": "loguru.logger", "...
326811944
# In[] import sys, os sys.path.append('../') import numpy as np from umap import UMAP import time import torch import matplotlib.pyplot as plt import pandas as pd import scipy.sparse as sp import scmomat.model as model import scmomat.utils as utils import scmomat.bmk as bmk import scmomat.umap_batch as umap_batch ...
null
test/test_simulated_imbalanced.py
test_simulated_imbalanced.py
py
34,257
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 18, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", ...
571621997
from django import forms from django.conf import settings from .models import Event from .exceptions import EventStartDateTimeException import datetime class EventForm(forms.ModelForm): class Meta: model = Event fields = [ 'title', 'place', 'description', ...
null
events/forms.py
forms.py
py
2,018
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Event", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.Text...
444671274
import re from django.utils import timezone from django.core.exceptions import ValidationError from django.utils.encoding import force_text from django.utils.html import strip_tags from django import forms from sidrun.models import Tag class CustomSelectMultipleTags(forms.ModelMultipleChoiceField): def label_fr...
null
sidrun/forms.py
forms.py
py
5,397
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.ModelMultipleChoiceField", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 12, "usage_type": "name" }, { "api_name": "django.forms.ModelForm", "line_number": 17, "usage_type": "attribute" }, { ...
412240504
from time import strftime from baobab.lims.config import VOLUME_UNITS from bika.lims import PMF from bika.lims import logger from bika.lims.browser.bika_listing import WorkflowAction from bika.lims.workflow import doActionFor from Products.Archetypes.exceptions import ReferenceException from Products.CMFCore.Workflow...
null
baobab/lims/browser/biospecimen/workflow.py
workflow.py
py
12,711
python
en
code
null
code-starcoder2
83
[ { "api_name": "bika.lims.browser.bika_listing.WorkflowAction", "line_number": 21, "usage_type": "name" }, { "api_name": "plone.protect.CheckAuthenticator", "line_number": 25, "usage_type": "call" }, { "api_name": "plone.protect", "line_number": 25, "usage_type": "attribut...
158398789
#!/usr/bin/env python # encoding: utf-8 from random import choice import string import logging from termcolor import colored import os, sys class ColorLogFiler(logging.StreamHandler): """ Override logging class to enable terminal colors """ def emit(self, record): try: msg = self.format...
null
src/common/utils.py
utils.py
py
2,133
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.StreamHandler", "line_number": 13, "usage_type": "attribute" }, { "api_name": "termcolor.colored", "line_number": 18, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 19, "usage_type": "call" }, { "api_name": "termco...
45273461
import sys import math import random import maya.OpenMaya as om import maya.OpenMayaMPx as omMPx import maya.mel as mel kPluginNodeTypeName = "MASH_Delay" mashDelayId = om.MTypeId(0x0011BE07) class mashDelay( omMPx.MPxNode ): inputs = om.MObject() outputArray = om.MObject() #AETemplate embedded...
null
BDmaya/plugins/win/2013/MASH_Delay.py
MASH_Delay.py
py
9,638
python
en
code
null
code-starcoder2
83
[ { "api_name": "maya.OpenMaya.MTypeId", "line_number": 10, "usage_type": "call" }, { "api_name": "maya.OpenMaya", "line_number": 10, "usage_type": "name" }, { "api_name": "maya.OpenMayaMPx.MPxNode", "line_number": 12, "usage_type": "attribute" }, { "api_name": "may...
457877611
from django.urls import path from . import views app_name = 'requirements' urlpatterns = [ path("", views.view_all_groups, name="all_groups"), path("<int:group_id>/", views.view_group, name="one_group"), path("reqs/<int:requirement_id>/", views.view_requirement, name="one_requirement"), ]
null
requirements/urls.py
urls.py
py
306
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" } ]
204269597
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from db import Base, ToDoItem engine = create_engine("sqlite:///tasks.db", echo=True) Base.metadata.create_all(engine) Session = sessionmaker(bind=engine) s = Session() for desc in ("прочитать книгу", "выучить django", "помыть посуду","пое...
null
init_db.py
init_db.py
py
414
python
en
code
null
code-starcoder2
83
[ { "api_name": "sqlalchemy.create_engine", "line_number": 6, "usage_type": "call" }, { "api_name": "db.Base.metadata.create_all", "line_number": 7, "usage_type": "call" }, { "api_name": "db.Base.metadata", "line_number": 7, "usage_type": "attribute" }, { "api_name"...
142317483
import cfnresponse import json import boto3 import time import sys responseStr = {'Status' : {}} def getRouteTableID(PrimarySubnetId,SecondarySubnetId,vpcId,AWSRegion): session = boto3.Session() ec2 = session.client('ec2', region_name=AWSRegion) response = ec2.describe_route_tables( F...
null
scripts/HAConfig/HAConfig.py
HAConfig.py
py
39,780
python
en
code
null
code-starcoder2
83
[ { "api_name": "boto3.Session", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.Session", "line_number": 35, "usage_type": "call" }, { "api_name": "boto3.Session", "line_number": 45, "usage_type": "call" }, { "api_name": "boto3.Session", "line_n...
131677521
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: csvmixin # Purpose: csv mixin for dyndmod # # Author: jojosati # # Created: 05/01/2012 # Copyright: (c) jojosati 2012 # Licence: MIT #-----------------------------------------------...
null
csvmixin.py
csvmixin.py
py
7,647
python
en
code
null
code-starcoder2
83
[ { "api_name": "dyndmod.sqla.Integer", "line_number": 27, "usage_type": "attribute" }, { "api_name": "dyndmod.sqla", "line_number": 27, "usage_type": "name" }, { "api_name": "dyndmod.sqla.Float", "line_number": 29, "usage_type": "attribute" }, { "api_name": "dyndmo...
49330128
from django import forms from django.core import validators class Empform(forms.Form): name = forms.CharField() salary = forms.IntegerField() opinion = forms.CharField(widget=forms.Textarea, validators=[validators.MaxLengthValidator(40), validators.MinLengthValidator(10)]) def clean(self): pr...
null
corevalidator2/webapp/forms.py
forms.py
py
673
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.CharField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.forms"...
342655923
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "prs_project.settings") import django django.setup() import decimal import pandas as pd from recommender.models import Similarity from analytics.models import Rating from sklearn.metrics.pairwise import cosine_similarity from scipy import sparse from datet...
null
builder/item_similarity_calculator.py
item_similarity_calculator.py
py
5,203
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.environ.setdefault", "line_number": 3, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 3, "usage_type": "attribute" }, { "api_name": "django.setup", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime.now...
52787123
#imports import numpy as np import string import re import csv from nltk.corpus import stopwords from nltk.stem import SnowballStemmer from nltk.tokenize import RegexpTokenizer from nltk.text import Text from nltk.stem import WordNetLemmatizer import copy #imports end ##train test load train = np.load("./data/data_...
null
naviebayes.py
naviebayes.py
py
6,792
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.load", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 16, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords.words", "line_number": 24, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwor...
298405180
import pandas as pd import numpy as np import argparse import os """ This script takes the individual UrbanSim input .csv files and compiles them into an (python 2) .h5 data store object, stored locally, and used for either estimation, simulation or both in bayarea_urbansim UrbanSim implementation. The last simulation...
null
scripts/make_model_data_hdf.py
make_model_data_hdf.py
py
9,053
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 43, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 77, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 81, "usage_type": "call" }, { "api_name": "pandas.read_c...
47636741
from django.urls import path from cms import views app_name = 'cms' urlpatterns = [ #カード path('card/', views.card_list, name='card_list'), #一覧 path('card/add', views.card_edit, name='card_add'), #登録 path('card/mod/<int:card_id>/', views.card_edit, name='card_mod'), #修正 path('card/del/<in...
null
mydeck/cms/urls.py
urls.py
py
396
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "cms.views.card_list", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cms.views", "line_number": 8, "usage_type": "name" }, { "api_name": "django.urls.path", ...
31562265
import requests import json from time import sleep as s def errorLogger(error): with open("log", "a") as f: f.write(f"\n\n{error}") def makeReadable(number): if type(number) != int: return number numberstring = str(number) newNumberstring = "" for x in numberstring: if len(numberstring) == 7: newNumbers...
null
Covid19/covid_backend.py
covid_backend.py
py
5,892
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 37, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 38, "usage_type": "call" } ]
129650987
from Bio import PDB from Bio.PDB import PDBParser, PDBIO from Bio.PDB.Atom import Atom from Bio.PDB.Residue import Residue from Bio.PDB.Chain import Chain from Bio.PDB.Model import Model from Bio.PDB.Structure import Structure import array #create structure cytosine cytosine = Structure('cytosine') #create model my_...
null
task2.py
task2.py
py
2,103
python
en
code
null
code-starcoder2
83
[ { "api_name": "Bio.PDB.Structure.Structure", "line_number": 11, "usage_type": "call" }, { "api_name": "Bio.PDB.Model.Model", "line_number": 14, "usage_type": "call" }, { "api_name": "Bio.PDB.Chain.Chain", "line_number": 18, "usage_type": "call" }, { "api_name": "B...
542783565
from datetime import timedelta class Settings: "A class to store all settings for alen invasion." def __init__ (self): """initialize the game's settings""" #version self.version = "1.0.1 git (2020.03.30)" #screen settings self.screen_width = 1080...
null
alien_invasion_Alpha_1.0.1/alien_invasion/settings.py
settings.py
py
1,144
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.timedelta", "line_number": 33, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 34, "usage_type": "call" }, { "api_name": "datetime.timedelta", "line_number": 35, "usage_type": "call" } ]
11342966
from hpsklearn import HyperoptEstimator, xgboost_classification from hyperopt import tpe import pandas as pd def main(): df_train = pd.read_csv('../train_dataset.csv') df_test = pd.read_csv('../test_dataset.csv') X_train, y_train = df_train.iloc[:, 2:].values, df_train.iloc[:, 0].values X_test, y_...
null
MachineLearning/supervised_training/XGBOOST/XG_hyperopt.py
XG_hyperopt.py
py
713
python
en
code
null
code-starcoder2
83
[ { "api_name": "pandas.read_csv", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_type": "call" }, { "api_name": "hpsklearn.HyperoptEstimator", "line_number": 16, "usage_type": "call" }, { "api_name": "hpsklearn...
128867638
import sys if sys.version_info < (3,6): sys.exit('Sorry, Python < 3.6 is not supported') from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name='PyBIS', version= '1.18.12', author='Swen Vermeul • ID SIS • ETH Zür...
null
pybis/src/python/setup.py
setup.py
py
1,068
python
en
code
null
code-starcoder2
83
[ { "api_name": "sys.version_info", "line_number": 3, "usage_type": "attribute" }, { "api_name": "sys.exit", "line_number": 4, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 12, "usage_type": "call" }, { "api_name": "setuptools.find_package...
479449955
#!/usr/bin/env python import argparse import pprint from time import sleep from scapy.all import sendp, sendpfast, hexdump, get_if_hwaddr from scapy.all import Ether, IP, UDP def main(): parser = argparse.ArgumentParser() parser.add_argument("ip", metavar="IP", type=str, help="IP addr of the receiver") ...
null
assignment2/send.py
send.py
py
1,163
python
en
code
null
code-starcoder2
83
[ { "api_name": "argparse.ArgumentParser", "line_number": 14, "usage_type": "call" }, { "api_name": "scapy.all.Ether", "line_number": 23, "usage_type": "call" }, { "api_name": "scapy.all.get_if_hwaddr", "line_number": 23, "usage_type": "call" }, { "api_name": "scapy...
482679700
# -*- coding: utf-8 -*- import time from functools import wraps import logging logger = logging.getLogger(__file__) def fn_timer(function): @wraps(function) def function_timer(*args, **kwargs): t0 = time.time() result = function(*args, **kwargs) t1 = time.time() logger.info("To...
null
src/Common/Tools/FNDecorator.py
FNDecorator.py
py
572
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 6, "usage_type": "call" }, { "api_name": "time.time", "line_number": 11, "usage_type": "call" }, { "api_name": "time.time", "line_number": 13, "usage_type": "call" }, { "api_name": "functools.wraps", "line_numb...
588621746
# Solar Wifi Weather Station # Very alpha at this stage # Last updated October 19, 2019 # # This is heavily based on 3KUdelta's Solar WiFi Weather Station. # There was much cutting and pasting! # See https://github.com/3KUdelta/Solar_WiFi_Weather_Station # This in turn was based on the work of Open Green Energy: # http...
null
weather_station.py
weather_station.py
py
10,654
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.loads", "line_number": 42, "usage_type": "call" }, { "api_name": "network.WLAN", "line_number": 47, "usage_type": "call" }, { "api_name": "network.STA_IF", "line_number": 47, "usage_type": "attribute" }, { "api_name": "network.WLAN", "line_...
91697717
"""No adversarial training """ #import os #os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" see issue #152 #os.environ["CUDA_VISIBLE_DEVICES"] = "" from keras.layers import Input, Conv1D, Embedding, Dropout from keras.layers import MaxPool1D, Dense, Flatten from keras.models import Model from utils_dann import flipGr...
null
baselines/DANN/DANN_keras_no.py
DANN_keras_no.py
py
11,343
python
en
code
null
code-starcoder2
83
[ { "api_name": "numpy.random.shuffle", "line_number": 82, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 82, "usage_type": "attribute" }, { "api_name": "numpy.asarray", "line_number": 94, "usage_type": "call" }, { "api_name": "numpy.asarray", ...
246247736
from EligibleAgeChecker import EligibleAgeChecker from abc import ABC, abstractmethod import re import pytest from WebDataScraper import DataScraper, WebDataScraper test_wds = WebDataScraper() url = "https://www.nhs.uk/conditions/coronavirus-covid-19/coronavirus-vaccination/coronavirus-vaccine/?gaclid=Cj0KCQjw16KFBhCg...
null
test_EligibleAgeChecker.py
test_EligibleAgeChecker.py
py
1,184
python
en
code
null
code-starcoder2
83
[ { "api_name": "WebDataScraper.WebDataScraper", "line_number": 7, "usage_type": "call" }, { "api_name": "EligibleAgeChecker.EligibleAgeChecker", "line_number": 12, "usage_type": "call" }, { "api_name": "pytest.raises", "line_number": 28, "usage_type": "call" } ]
172351546
#! /usr/bin/env python3 # coding: utf-8 import math import urllib.parse import requests from view.consoleapiview import ConsoleApiView class OpenFoodFactsInteractions: """ This class manages all the interactions with the OpenFoodFacts API """ def __init__(self): self.interface = ConsoleApiView() ...
null
app/controller/api_interaction.py
api_interaction.py
py
1,645
python
en
code
null
code-starcoder2
83
[ { "api_name": "view.consoleapiview.ConsoleApiView", "line_number": 12, "usage_type": "call" }, { "api_name": "urllib.parse.parse.urlencode", "line_number": 30, "usage_type": "call" }, { "api_name": "urllib.parse.parse", "line_number": 30, "usage_type": "attribute" }, ...
96994735
from django import forms from django.utils.translation import ugettext_lazy as _ from django_countries import data as country_data from postal.settings import POSTAL_ADDRESS_LINE1, POSTAL_ADDRESS_LINE2, POSTAL_ADDRESS_CITY, POSTAL_ADDRESS_STATE, \ POSTAL_ADDRESS_CODE, POSTAL_USE_CRISPY_FORMS if POSTAL_USE_CRISPY...
null
src/postal/forms/__init__.py
__init__.py
py
2,670
python
en
code
null
code-starcoder2
83
[ { "api_name": "postal.settings.POSTAL_USE_CRISPY_FORMS", "line_number": 9, "usage_type": "name" }, { "api_name": "django_countries.data", "line_number": 15, "usage_type": "name" }, { "api_name": "django_countries.data", "line_number": 17, "usage_type": "name" }, { ...
482851298
#-*- coding: utf-8 -*- """ FrostyX's Qtile config Don't be dumb and test it with Xephyr first https://wiki.archlinux.org/index.php/Xephyr Xephyr -br -ac -noreset -screen 1600x600 :1 & DISPLAY=:1 qtile & DISPLAY=:1 urxvt & """ import re import subprocess from datetime import date from os import uname fr...
null
.config/qtile/examples/FrostyX.py
FrostyX.py
py
15,911
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.uname", "line_number": 51, "usage_type": "call" }, { "api_name": "libqtile.config.Key", "line_number": 69, "usage_type": "call" }, { "api_name": "libqtile.command.lazy.layout.next", "line_number": 69, "usage_type": "call" }, { "api_name": "libqti...
474279302
import time import datetime import socket import asyncio import matplotlib.pyplot as plt import numpy as np import argparse import select import selectors import sys from sklearn import datasets from sklearn import metrics from sklearn.tree import DecisionTreeClassifier from sklearn.datasets import load_svmlight_file f...
null
StateMachine/parse_data.py
parse_data.py
py
26,924
python
en
code
null
code-starcoder2
83
[ { "api_name": "matplotlib.pyplot.ion", "line_number": 20, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 20, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 21, "usage_type": "attribute" }, { "api_name"...
320262697
import matplotlib.pyplot as plt import torch from IPython import display import numpy as np import random num_inputs = 2 num_examples = 1000 true_w = [2, -3.4] true_b = 4.2 features = torch.randn(num_examples, num_inputs, dtype=torch.float32) labels = true_w[0] * features[:, 0] + true_w[1] * fe...
null
Coding/Chapter03.py
Chapter03.py
py
3,258
python
en
code
null
code-starcoder2
83
[ { "api_name": "torch.randn", "line_number": 12, "usage_type": "call" }, { "api_name": "torch.float32", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.tensor", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.random.normal", ...
629404196
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. from urllib import unquote from falcon import HTTP_201, HTTPError, HTTPBadRequest from ujson import dumps as json_dumps from ...utils import load_json_body fro...
null
src/oncall/api/v0/schedules.py
schedules.py
py
9,398
python
en
code
null
code-starcoder2
83
[ { "api_name": "falcon.HTTPBadRequest", "line_number": 82, "usage_type": "call" }, { "api_name": "urllib.unquote", "line_number": 152, "usage_type": "call" }, { "api_name": "urllib.unquote", "line_number": 153, "usage_type": "call" }, { "api_name": "ujson.dumps", ...
254119100
import json import os products = [] with open("scans.json", "r") as f: data = json.load(f) for e in data: id = e['id'] name = e['name'] type = e['type'] t = str(e["timestamp"]) l = e["location"] l = [str(i) for i in l] l = ' '.join(l) found = Fals...
null
out/production/resources/pathfinder.py
pathfinder.py
py
778
python
en
code
null
code-starcoder2
83
[ { "api_name": "json.load", "line_number": 6, "usage_type": "call" }, { "api_name": "os.chdir", "line_number": 26, "usage_type": "call" } ]
329737460
import xlsxwriter def main(): workbook = xlsxwriter.Workbook('dados_gRPC.xlsx') worksheet = workbook.add_worksheet() arq = open('tempos_gRPC.txt', 'r') texto = arq.readlines() inicializaWorksheet(texto, worksheet) row = 0 col = 0 for linha in texto : if(ro...
null
escrevePlanilha.py
escrevePlanilha.py
py
771
python
en
code
null
code-starcoder2
83
[ { "api_name": "xlsxwriter.Workbook", "line_number": 5, "usage_type": "call" } ]
163006824
__author__ = 'damienpuig' from setuptools import setup setup(name='damienpuig', version='0.1', description='The funniest joke', url='http://github.com/damienpuig/library_test', author='Damien PUIG', author_email='damien.puig@gmail.com', license='MIT', packages=['damienpuig'],...
null
pypi_install_script/damienpuig-0.1.tar/setup.py
setup.py
py
399
python
en
code
null
code-starcoder2
83
[ { "api_name": "setuptools.setup", "line_number": 5, "usage_type": "call" } ]
276380495
# Copyright (C) 2008-2015 Ruben Decrop # Copyright (C) 2015-2016 Chessdevil Consulting import io import sys import urllib.request import zipfile from reddevil.models import rdr from bjk2016.models import init_db fidetitle = { '': 0, 'WCM': 1, 'WFM': 2, 'CM': 3, 'FM': 4, 'WIM': 5, 'WGM': 6, 'IM': 7, 'GM': 8 }...
null
bjk2016/scripts/fideplayer.py
fideplayer.py
py
2,043
python
en
code
null
code-starcoder2
83
[ { "api_name": "urllib.request.request.urlopen", "line_number": 25, "usage_type": "call" }, { "api_name": "urllib.request.request", "line_number": 25, "usage_type": "attribute" }, { "api_name": "urllib.request", "line_number": 25, "usage_type": "name" }, { "api_nam...
503809346
# What should be take care of here: # - Security # - Transaction control # - Audit. # - Customization # - Model intelligence # - Logging LOGAUDIT = False import medhist.models as md import medhist.session as ss from django.db import transaction as trc import datetime as dt current_audit = None class ...
null
medsoft_proj/medhist/modelapi.py
modelapi.py
py
8,081
python
en
code
null
code-starcoder2
83
[ { "api_name": "medhist.session.current_session", "line_number": 28, "usage_type": "attribute" }, { "api_name": "medhist.session", "line_number": 28, "usage_type": "name" }, { "api_name": "medhist.session.current_session", "line_number": 30, "usage_type": "attribute" }, ...
83444363
#!/usr/bin/env python3 # encoding: utf-8 import argparse import errno import os import re import requests import sys from timeit import default_timer as timer import urllib class Subreddit: """ Scrapes a subreddit and downloads the .jpg and .png images. Attributes: subreddit (str) : the subreddi...
null
src/piccit.py
piccit.py
py
8,538
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 90, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 95, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 126, "usage_type": "call" }, { "api_name": "urllib.parse.urlparse",...
409823890
# -*- encoding: utf-8 -*- # Especificamos que nuestro archivo .py está codificado en UTF-8 #!/usr/bin/python """ Plataforma de experimentacion SERGIO DE LA CRUZ GUTIERREZ ALGORITMO MARTINELLI Parametros: Succion motor (50-100) Duracion de la experimentacion (en muestras) Tiempo de ap...
null
Ficheros Carlos/tgs2600martinelli.py
tgs2600martinelli.py
py
19,579
python
en
code
null
code-starcoder2
83
[ { "api_name": "Adafruit_DHT.DHT22", "line_number": 50, "usage_type": "attribute" }, { "api_name": "Adafruit_BBIO.GPIO.setup", "line_number": 56, "usage_type": "call" }, { "api_name": "Adafruit_BBIO.GPIO", "line_number": 56, "usage_type": "name" }, { "api_name": "A...
350662447
from __future__ import absolute_import from __future__ import print_function from keras import objectives from keras.models import model_from_json from keras.optimizers import SGD, RMSprop, Adam, Adamax , Nadam from keras.callbacks import * from keras.utils.generic_utils import slice_arrays from .callbacks import * ...
null
hyperion/keras/keras_utils.py
keras_utils.py
py
14,051
python
en
code
null
code-starcoder2
83
[ { "api_name": "constraints.Clip", "line_number": 73, "usage_type": "name" }, { "api_name": "keras.models.model_from_json", "line_number": 82, "usage_type": "call" }, { "api_name": "keras.objectives.get", "line_number": 240, "usage_type": "call" }, { "api_name": "k...
329688417
import sys import pyric.pyw as pyw from colorama import Fore, Style def interface_command(interface, verbose): faces = pyw.winterfaces() if interface == "all" else [interface] for face in faces: if face not in pyw.winterfaces(): sys.exit(f"{face} is not an interface") print(f"{Fore.G...
null
boop/tools/interfaces.py
interfaces.py
py
1,422
python
en
code
null
code-starcoder2
83
[ { "api_name": "pyric.pyw.winterfaces", "line_number": 8, "usage_type": "call" }, { "api_name": "pyric.pyw", "line_number": 8, "usage_type": "name" }, { "api_name": "pyric.pyw.winterfaces", "line_number": 10, "usage_type": "call" }, { "api_name": "pyric.pyw", "...
45950816
from sklearn.model_selection import train_test_split import datetime class Timer: def __init__(self): self.start_time = datetime.datetime.now() def start(self): self.start_time = datetime.datetime.now() def stop(self): interval = datetime.datetime.now() - self.start_time ...
null
TestTools.py
TestTools.py
py
1,298
python
en
code
null
code-starcoder2
83
[ { "api_name": "datetime.datetime.now", "line_number": 7, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 10, "usage_type": "call" }, { "api_name": "date...
633101333
# applying all functions to solve integrals import numpy as np import matplotlib.pyplot as plt import time import copy from data import aero_data, grid, f100, transpose, nodes_z, nodes_x, times_z from integrator import def_integral, indef_integral from interpolator import spline_coefficient, spline_interpolato...
null
Code/Verification integration/COMBINED.py
COMBINED.py
py
4,813
python
en
code
null
code-starcoder2
83
[ { "api_name": "copy.deepcopy", "line_number": 21, "usage_type": "call" }, { "api_name": "data.grid", "line_number": 21, "usage_type": "argument" }, { "api_name": "data.times_z", "line_number": 27, "usage_type": "call" }, { "api_name": "data.aero_data", "line_n...
553081879
# code your activity here # or replace this file with your python activity file # import statements """ class exampleActivity(activity.Activity): """ # Sugar Imports from sugar3.activity.activity import Activity from sugar3.activity.widgets import StopButton from sugar3.activity.widgets import ActivityButton from PI...
null
activity.py
activity.py
py
3,237
python
en
code
null
code-starcoder2
83
[ { "api_name": "sugar3.activity.activity.Activity", "line_number": 20, "usage_type": "name" }, { "api_name": "sugar3.activity.activity.Activity.__init__", "line_number": 22, "usage_type": "call" }, { "api_name": "sugar3.activity.activity.Activity", "line_number": 22, "usag...
14500492
# URL Handler for the website from django.conf.urls import url,include from django.contrib import admin from . import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', include('Personal.urls')), url(r'^home/', include('Personal.urls')), url(r'^learn/', include('Learn.urls')), u...
null
codesquest/urls.py
urls.py
py
524
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 8, "usage_type": "name" }, { "api_name": ...
558537848
from django.test import TestCase from django.core.urlresolvers import reverse from .models import Category # Create your tests here. class CategoryMethodTests(TestCase): def test_ensure_views_are_positive(self): cat = Category(name='test', views=-1, likes=0) cat.save() self.assertEqual((ca...
null
project_rango/apps/rango/tests.py
tests.py
py
1,223
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.test.TestCase", "line_number": 7, "usage_type": "name" }, { "api_name": "models.Category", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Category", "line_number": 14, "usage_type": "call" }, { "api_name": "django.test.TestCa...
547973984
# Authors: Hagen Blix # Script for generating sentences with collective predicates # import pattern.en # from pattern.en import conjugate as pconj from utils.conjugate2 import * from utils.string_utils import remove_extra_whitespace from random import choice import numpy as np import os # initialize output file rel_...
null
generation_projects/plurality/collective_predicates.py
collective_predicates.py
py
8,130
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path.abspath", "line...
490386672
from django.http import HttpResponse from django.shortcuts import render, redirect from .forms import UserForm from error_pages.http import Http400 def home(request, name, number_games): if number_games > 10 or number_games < 1: raise Http400 number_games = number_games - 1 variables = { ...
null
testunitaire/shifumi/views.py
views.py
py
891
python
en
code
null
code-starcoder2
83
[ { "api_name": "error_pages.http.Http400", "line_number": 10, "usage_type": "name" }, { "api_name": "django.shortcuts.render", "line_number": 18, "usage_type": "call" }, { "api_name": "forms.UserForm", "line_number": 22, "usage_type": "call" }, { "api_name": "djang...
397437664
''' start a thread capture frames save frames to redis server ''' import sys import traceback from queue import Queue from threading import Thread import threading import cv2 as cv import logging import datetime import time # sys.path.append('../') from utils_ken.log.getlog import get_logger log_cam = get_logger...
null
utils_ken/video/video_stream.py
video_stream.py
py
4,226
python
en
code
null
code-starcoder2
83
[ { "api_name": "utils_ken.log.getlog.get_logger", "line_number": 17, "usage_type": "call" }, { "api_name": "queue.Queue", "line_number": 37, "usage_type": "call" }, { "api_name": "threading.Lock", "line_number": 39, "usage_type": "call" }, { "api_name": "threading....
247946889
import matplotlib import gzip import pandas as pd # import seaborn as sns from mnist import MNIST from sklearn.decomposition import PCA from sklearn.cluster import KMeans filenames = 'train-images-idx3-ubyte t10k-images-idx3-ubyte train-labels-idx1-ubyte t10k-labels-idx1-ubyte'.split() # noqa for i, filename in enu...
null
mnist_solver.py
mnist_solver.py
py
1,252
python
en
code
null
code-starcoder2
83
[ { "api_name": "gzip.open", "line_number": 15, "usage_type": "call" }, { "api_name": "mnist.MNIST", "line_number": 22, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 27, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_n...
458135955
""" dariah.topics.modeling ~~~~~~~~~~~~~~~~~~~~~~ This module implements low-level LDA modeling functions. """ from pathlib import Path import tempfile import os import logging import multiprocessing import shutil from typing import Optional, Union import cophi import lda import numpy as np import pandas as pd from...
null
dariah/core/modeling.py
modeling.py
py
8,684
python
en
code
null
code-starcoder2
83
[ { "api_name": "logging.getLogger", "line_number": 25, "usage_type": "call" }, { "api_name": "logging.WARNING", "line_number": 25, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 47, "usage_type": "name" }, { "api_name": "typing.Union",...
624178742
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Sorry, but the key map assignments please do manually. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #ユーザー設定のアドオンリストに表示される色々 bl_info = {'name':'Silent Key Del', 'author':'bookyakuno', 'version':(0,1), ...
null
SilentKeyDel.py
SilentKeyDel.py
py
3,740
python
en
code
null
code-starcoder2
83
[ { "api_name": "bpy.types", "line_number": 23, "usage_type": "attribute" }, { "api_name": "bpy.ops.anim.keyframe_delete_v3d", "line_number": 35, "usage_type": "call" }, { "api_name": "bpy.ops", "line_number": 35, "usage_type": "attribute" }, { "api_name": "bpy.type...
587699170
#!/usr/bin/python # -*- coding:utf-8 -*- # This Python file uses the following encoding: utf-8 from setuptools import setup, find_packages import sys from easy_contact_setup import version import os # Read the version from a project file VERSION = version.VERSION_str # Get description from README file long_descripti...
null
pypi_install_script/django-easy-contact-setup-0.3.9.tar/setup.py
setup.py
py
2,062
python
en
code
null
code-starcoder2
83
[ { "api_name": "easy_contact_setup.version.VERSION_str", "line_number": 11, "usage_type": "attribute" }, { "api_name": "easy_contact_setup.version", "line_number": 11, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 15, "usage_type": "call" }, { ...
456710609
import os import json import requests import yaml def connected_to_internet(url='http://www.google.com/', timeout=5): """ Check that there is an internet connection :param url: url to use for testing (Default value = 'http://www.google.com/') :param timeout: timeout to wait for [in seconds] (Default value = 5...
null
brainrender/Utils/data_io.py
data_io.py
py
3,521
python
en
code
null
code-starcoder2
83
[ { "api_name": "requests.get", "line_number": 15, "usage_type": "call" }, { "api_name": "requests.ConnectionError", "line_number": 17, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.isdir...
167764124
# 라이브러리 불러오기 from config import TELEGRAM_TOKEN, CHAT_ID from noti import news import requests from bs4 import BeautifulSoup import telegram bot = telegram.Bot(token=TELEGRAM_TOKEN) # 서치 키워드 search_word = '코로나' # 기존에 보냈던 링크를 담아둘 리스트 naver_old_links = [] naver_old_titles = [] daum_old_links = [] daum_old_title = [] # ...
null
news.py
news.py
py
4,230
python
en
code
null
code-starcoder2
83
[ { "api_name": "telegram.Bot", "line_number": 8, "usage_type": "call" }, { "api_name": "config.TELEGRAM_TOKEN", "line_number": 8, "usage_type": "name" }, { "api_name": "requests.get", "line_number": 21, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", ...
46832701
import json import os from django.core.management import BaseCommand from authapp.models import ShopUser from mainapp.models import ClassForMainGallery, MainGallery, MainSlider, AboutUs from servicesapp.models import ServicesCategories, Services JSON_PATH = 'mainapp/jsons' def load_from_json(file_name): with o...
null
mainapp/management/commands/fill_db.py
fill_db.py
py
2,198
python
en
code
null
code-starcoder2
83
[ { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, "usage_type": "attribute" }, { "api_name": "json.load", "line_number": 15, "usage_type": "call" }, { "api_name": "django.core.management.BaseComman...
2606318
from django.conf.urls import include, url from django.conf import settings from django.contrib import admin from django.views.generic import RedirectView from django.conf.urls.static import static from accounts.views import CustomLoginView, DisclaimerCreateView, \ data_protection, subscribe_view urlpatterns = [ ...
null
pipsevents/urls.py
urls.py
py
1,564
python
en
code
null
code-starcoder2
83
[ { "api_name": "django.conf.urls.url", "line_number": 11, "usage_type": "call" }, { "api_name": "django.conf.urls.include", "line_number": 11, "usage_type": "call" }, { "api_name": "django.contrib.admin.site", "line_number": 11, "usage_type": "attribute" }, { "api_...