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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19970832 | # Import requests (to download the page)
import requests
# Import Time (to add a delay between the times the scape runs)
import time
from selenium.webdriver import Chrome
from pygame import mixer
webdriver = "/Applications/chromedriver"
driver = Chrome(webdriver)
while True:
driver.get("https://ssb.vcccd.edu/prod... | null | waitlistmonitor.py | waitlistmonitor.py | py | 1,627 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.mixer.init",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pygame.mixer",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pygame.mixer... |
10039282 | import networkx as nx
import scipy.sparse as sp
import numpy as np
import scipy
import pickle
def load_IMDB_data(prefix='data/preprocessed/IMDB_processed'):
G00 = nx.read_adjlist(prefix + '/0/0-1-0.adjlist', create_using=nx.MultiDiGraph)
G01 = nx.read_adjlist(prefix + '/0/0-2-0.adjlist', create_using=nx.MultiD... | null | LP/benchmark/methods/MAGNN/utils/data.py | data.py | py | 20,572 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "networkx.read_adjlist",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "networkx.MultiDiGraph",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "networkx.read_adjlist",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "n... |
537570825 | # Copyright (c) 2019 Iotic Labs Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://github.com/Iotic-Labs/py-IoticAgent/blob/master/LICENSE
#
# Unless re... | null | src/IoticAgent/ThingRunner.py | ThingRunner.py | py | 8,996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "enum.Enum",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "enum.unique",
"lin... |
53645724 | #!/usr/bin/env python
# sudo pip install pyserial
# 0 - anemometer - reset counter
# 1 - anemometer
# 2 - light sensor
# 4 - wind vane
# 5 - DHT temp and humidity sensor
# 6 - BMP180 barometric pressure sensor (+ amb. temp)
import serial
import time
import re
from math import *
import lib.utils as utils
import subpro... | null | rpi_client/serial_comms.py | serial_comms.py | py | 1,937 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tendo.singleton.SingleInstance",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tendo.singleton",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 23,
"usage_type": "call"
},
{
"api_name":... |
70836073 | # Listing_19-5.py
# Copyright Warren & Csrter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# PyPong z dźwiękami i muzyką
import sys, pygame
class KlasaMojaPilka(pygame.sprite.Sprite):
def __init__(self, plik_obrazka... | null | przyklady/przyklady/Listing_19-5.py | Listing_19-5.py | py | 5,674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.sprite",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.sprite.Sprite.__init__",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.sprite",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "p... |
356744038 | from django.db import models
from django.contrib.auth.models import User
from django.db.models import Q
from django.db.models import Sum
# Create your models here.
class Transaction(models.Model):
amount = models.FloatField()
description = models.TextField()
# optionally displayed fields
txnTime... | null | penny/models.py | models.py | py | 3,683 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.FloatField",
"line_number": 10,
"usage_type": "call"
},
{
"api_name":... |
153880469 | ############################################################################
# Project: Electrical Pre-Conditioning of Convective Clouds,
# Title: EPCC Central Command
# Author: James Gilmore,
# Email: james.gilmore@pgr.reading.ac.uk.
# Version: 0.1
# Date: 20/03/17
# Status: Stable
# Change: Now is cable of I/O operat... | null | Extras/PhD_Config.py | PhD_Config.py | py | 4,751 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.genfromtxt",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.genfromtxt",... |
80511140 | """The Cluv"""
from jinja2 import StrictUndefined
from functools import wraps
from flask import (Flask, render_template, redirect, request, flash,
session)
from flask_debugtoolbar import DebugToolbarExtension
from model import User, Article, Image, ArticleType, connect_to_db, db
import boto3, botocore
impor... | null | server.py | server.py | py | 10,868 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.session.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "flask.redirect",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "functools.wraps",
... |
420283249 | from flask import Flask, request, redirect, render_template, url_for, jsonify
from flask_pymongo import PyMongo
from urllib import quote_plus
from urllib2 import urlopen
from multiprocessing.dummy import Pool as ThreadPool
from functools import partial
from keys import google_api_key, app_secret_key
from population imp... | null | flaskapp.py | flaskapp.py | py | 7,638 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "keys.app_secret_key",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "flask_pymongo.PyMongo",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "googlemaps.Clie... |
613882719 | from socket import *
import datetime
from random import randint
from math import factorial
serverPort=9000
serverSocket=socket(AF_INET, SOCK_STREAM)
serverSocket.bind(('', serverPort))
serverSocket.listen(1)
def ip(addr):
return 'IP adresa e klientit eshte ' + addr[0]
def port(addr):
return 'Klienti eshte du... | null | Fiek-TCPServeri/Fiek-TCPServeri/Fiek_TCPServeri.py | Fiek_TCPServeri.py | py | 2,487 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "math.factorial",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "random.ra... |
162270576 | # Import WebSocket client library
from websocket import create_connection
# Connect to WebSocket API and subscribe to trade feed for XBT/USD and XRP/USD
ws = create_connection("wss://ws.kraken.com/")
ws.send('{"event":"subscribe", "subscription":{"name":"trade"}, "pair":["XBT/USD","XRP/USD"]}')
# Infinite loop waitin... | null | websocket-client/synchro-websocket.py | synchro-websocket.py | py | 378 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "websocket.create_connection",
"line_number": 5,
"usage_type": "call"
}
] |
12442406 | from django.urls import path
from Eapp import views
from django.contrib.auth import views as ad
urlpatterns = [
path('',views.home,name="hm"),
path('abt/',views.about,name="ab"),
path('cnt/',views.contact,name="ct"),
path('reg/',views.register,name="rg"),
path('ccty/',views.coursecty,name="cty"),
path('crupd/<in... | null | Day-12[16-10-2021]/ELearn/Eapp/urls.py | urls.py | py | 996 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "Eapp.views.home",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "Eapp.views",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.urls.path",
... |
653904483 | from typing import List
from .tile import Tile
class TargetTracker(list):
"""
Track the targets that might be good to attack/explore
"""
def __init__(self, *args, **kwargs):
list.__init__(self, *args, **kwargs)
self.turn_last_updated: int = 0
def update_list(self, target_list: Li... | null | base/client/TargetTracker.py | TargetTracker.py | py | 962 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "tile.Tile",
"line_number": 14,
"usage_type": "name"
}
] |
422401268 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 08 09:26:27 2016
@author: Dominic O'Kane
"""
import datetime as dt
import sys
from financepy.finutils.FinTestCases import FinTestCases, globalTestCaseMode
from financepy.finutils.FinFrequency import FinFrequencyTypes
from financepy.finutils.FinDayCount import FinDayCo... | null | financepy/tests/TestFinBondYieldCurve.py | TestFinBondYieldCurve.py | py | 3,791 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "financepy.finutils.FinTestCases.FinTestCases",
"line_number": 22,
"usage_type": "call"
},
{
"api_na... |
295134139 | """Stylish formatter."""
import json
def format_dict(element, tabulation):
"""Json format dictionary element."""
if isinstance(element, dict):
form_dict = json.dumps(element, indent=4)
form_dict = form_dict.replace('\n', '\n' + tabulation)
return form_dict.replace('\"', '')
if isin... | null | gendiff/formatter/stylish.py | stylish.py | py | 1,734 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "json.dumps",
"line_number": 8,
"usage_type": "call"
}
] |
175623267 | import requests
from bs4 import BeautifulSoup
import pandas as pd
# EUROPE
# LON weather
page_lon = requests.get('https://weather.com/en-IL/weather/today/l/7517a52d4d1815e639ae1001edb8c5fda2264ea579095b0f28f55c059599e074')
soup_lon = BeautifulSoup(page_lon.content, 'html.parser')
today_lon = soup_lon.find(class_="toda... | null | main.py | main.py | py | 5,083 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"li... |
426005668 | # SciPy tutorial
# https://www.w3schools.com/python/scipy_intro.asp
import scipy
from scipy import constants
print(scipy.__version__)
# constants
print(constants.liter)
print(constants.pi)
# optimizers
# procedures that find minimum value of a function, or root of an equation
# algorithms in machine learning are equ... | null | 2021-04-03.py | 2021-04-03.py | py | 1,501 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "scipy.__version__",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants.liter",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "scipy.constants",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "scipy.... |
503073288 | #!/usr/bin/env python3
import ptan
import argparse
import torch
import torch.optim as optim
import torch.multiprocessing as mp
from tensorboardX import SummaryWriter
from lib import dqn_model, common, atari_wrappers
import json
import os
import pickle
import numpy as np
import datetime
from gym import wrappers
imp... | null | samples/dqn_speedup/05_new_wrappers.py | 05_new_wrappers.py | py | 13,054 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "lib.atari_wrappers.make_atari",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "lib.atari_wrappers",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "lib.atari_wrappers.wrap_deepmind",
"line_number": 27,
"usage_type": "call"
},
{
... |
221756433 | from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, Concatenate
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import UpSampling2D, Conv2D
from keras.models import Sequentia... | null | HW3_2/cgan.py | cgan.py | py | 7,735 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "keras.optimizers.Adam",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "keras.layers.Input",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "keras.lay... |
544331698 | import PyPDF2
import re
import csv
import os
dates = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August',
'September', 'October', 'November', 'December']
find_date = '|'.join(dates)
file = r"C:\Users\mtp10\PycharmProjects\Golf\Data\World_Rankings\Rankings_v5.csv"
directory = r'C:\... | null | old/world_rankings.py | world_rankings.py | py | 1,601 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "PyPDF2.PdfFileReader",
"line... |
133165332 | from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from pages.home.login_page import LoginPage
import unittest #ovo se importuje da bi se napravili testcasevi
import pytest # za orderovanje koji ce test prvi da se izvrsi
from utilities.teststatus import TestStatus # za... | null | tests/home/login_tests.py | login_tests.py | py | 3,203 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "unittest.TestCase",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "u... |
123357243 | #%% [markdown]
# Lambda School Data Science, Unit 2: Predictive Modeling
#
# # Kaggle Challenge, Module 2
#
# ## Assignment
# - [ ] Read [“Adopting a Hypothesis-Driven Workflow”](https://outline.com/5S5tsB), a blog post by a Lambda DS student about the Tanzania Waterpumps challenge.
# - [ ] Continue to participate in... | null | module2/assignment_kaggle_challenge_2.py | assignment_kaggle_challenge_2.py | py | 10,721 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.merge",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
312140813 | from django.db import models
from django.utils import timezone
class Crud_django(models.Model):
name = models.CharField(max_length=20, blank=True, null=True)
description = models.TextField(blank=True, null=True)
image = models.ImageField(upload_to='crud_django')
is_active = models.IntegerField(default=... | null | crud_django/models.py | models.py | py | 959 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "... |
99460187 | from django.shortcuts import render_to_response, get_object_or_404
from django import forms
from django.views.decorators.csrf import csrf_exempt
from models import Quote
@csrf_exempt
def quote_form(request, pID='0'):
class QuoteForm(forms.ModelForm):
class Meta:
model = Quote
fields... | null | Quotes/views.py | views.py | py | 1,874 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.Quote",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.shortcuts.... |
156011424 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from functools import reduce
import itertools
from dipy.tracking.streamline import transform_streamlines
import numpy as np
from scipy import ndimage
MIN_NB_POINTS = 10
KEY_INDEX = np.concatenate((range(5), range(-1, -6, -1)))
def get_streamline_key(streamline, precis... | null | scilpy/utils/streamlines.py | streamlines.py | py | 6,792 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.concatenate",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.round",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.cumsum",
"line_number": 114,
"usage_type": "call"
},
{
"api_name": "functools.reduce",
"l... |
192855711 | from datetime import datetime
from gdrive import TourneyData
import aiomysql
import asyncio
import configparser
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from . import functions as _func
from . import databaseFuncs as _dbFunc
from . import settings as _set
from .... | null | utils/database.py | database.py | py | 21,618 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
435230324 | # coding: utf-8
# Created By: Virgil Dupras
# Created On: 2009-06-05
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcode... | null | hsaudiotag/tests/squeeze.py | squeeze.py | py | 4,106 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "io.BytesIO",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 62,
... |
328742616 | import csv
import re
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
DIR_OUT = 'films_data'
CATEGORIES = [
'fantastika',
'uzhasy',
'detektivy',
'trillery',
]
BASE_URL = "http://kinogo.co/"
def save(films, path):
with open(path, 'w') as csvfile:
writer = csv.write... | null | run.py | run.py | py | 2,574 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "csv.writer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "urllib.request.Request",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "urllib.request.ur... |
563383302 | """modelform URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | null | modelform/urls.py | urls.py | py | 1,255 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.urls.path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "django.contrib.admin.site",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "... |
598987509 | from django.db import models
from django.contrib.auth.models import User
class ActivityLog(models.Model):
type = models.CharField(max_length=64)
logged_user = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL)
fromuser = models.ForeignKey(User, null=True, blank=True, related_name="a... | null | core/models.py | models.py | py | 1,568 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "... |
137144185 | import numpy as np
#import panda as pd
import sklearn as sk
#import gensim
from sklearn.pipeline import Pipeline
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.svm import SVC
from sklearn.naive_bayes import MultinomialNB, BernoulliNB
from sklearn.metrics import accuracy_score
from sklearn.cross_validati... | null | classification.py | classification.py | py | 4,288 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.full",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 3... |
447044412 | # import os
import datetime
import ipaddress
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.x509 import DirectoryName
from cryptography.x509.extensions import _key_identifier_from_public_key
fro... | null | bounca/certificate_engine/ssl/certificate.py | certificate.py | py | 14,539 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "bounca.x509_pki.models.DistinguishedName",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "cryptography.x509.Name",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "cryptography.x509",
"line_number": 35,
"usage_type": "name"
},
{
... |
188092282 | """
intercept HTTP connections that use requests
"""
from . import WSGI_HTTPConnection, WSGI_HTTPSConnection, wsgi_fake_socket
try:
from requests.packages.urllib3 import connectionpool
except ImportError:
from urllib3 import connectionpool
HTTPConnection = connectionpool.HTTPConnection
HTTPSConnection = conne... | null | wsgi_intercept/requests_intercept.py | requests_intercept.py | py | 732 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "urllib3.connectionpool.HTTPConnection",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "urllib3.connectionpool",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "urllib3.connectionpool.HTTPSConnection",
"line_number": 12,
"usage_type... |
216736170 | from flask import Flask
from flask import Flask, request, render_template
from db.schema import PidBad,PidSummary,Data
# from sqlalchemy.orm import sessionmaker
# from sqlalchemy import create_engine
from flask_sqlalchemy import SQLAlchemy
from utils import *
import pickle
from dateutil.parser import parse
import platf... | null | web.py | web.py | py | 3,729 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "db.schema.session.query",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "db.schema.Data",
"line_number": 55,
"usage_type": "argument"
},
{
"api_name": "db.schema.session",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "db.... |
507546634 | import requests, json
import import_file as f
url = 'https://api.openweathermap.org/data/2.5/weather?q=thrissur&appid=753b203a4081430106aa585083e7523f'#Open api link here
values={
"SNO":1
}
def get_weather_info():
res = requests.get(url)
data = res.json()
weather = data['weather'] [0] ['mai... | null | weather.py | weather.py | py | 1,325 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "import_file.out.txt_out",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "import_file.out",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "import_file.... |
44613641 | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import gensim
import codecs
from copy import deepcopy
import random
import pickle
import gensim
from gensim.models.word2vec import Word2Vec
import numpy as np
class TrainLoader... | null | data_utils.py | data_utils.py | py | 6,717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gensim.models.word2vec.Word2Vec.load",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "gensim.models.word2vec.Word2Vec",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.isfile",
"line_number": 25,
"usage_type": "call"
},
{
... |
94524218 | from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ =... | null | setup.py | setup.py | py | 1,615 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.command.build_ext.build_ext",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "setuptools.command.build_ext.build_ext.finalize_options",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.command.build_ext.build_ext",
"line_n... |
650710767 | #!/usr/bin/python3
# Trevor Nogues, Mania Abdi
# Graph abstraction
from collections import defaultdict
import random
import sched, threading, time
import utils.randoms
import uuid
import utils.plan as plan
import ast
import utils.job as jb
import numpy as np
import enum
import copy
import graph_tool.all as gt
import... | null | code/utils/graph.py | graph.py | py | 8,506 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "enum.IntEnum",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "utils.job.Job",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "utils.job",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_num... |
329862469 | #!/usr/bin/env python3
from setuptools import Command
from setuptools import setup
import os
import re
import subprocess
import sys
class VersionCheckCommand(Command):
"""Make sure git tag and version match before uploading"""
user_options = []
def initialize_options(self):
"""Abstract method th... | null | pypi_install_script/fdroidserver-1.1.6.tar/setup.py | setup.py | py | 3,459 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "setuptools.Command",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "subprocess.check_output",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.access",
"... |
567600805 | class MapInterpolation:
"""
Create a MapInterpolation class where the data for drawing an interpolation
map can be downloaded, modified, manually provided.
Keyword arguments:
country -- a country or a list of countries for which the shapefile will
be drawn. Alternatively, if you pass the 'E... | null | cloupy/maps/interpolation_map.py | interpolation_map.py | py | 45,896 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "{'get_shapes_for_plotting': 'cloupy.maps.draw_shapes.get_shapes_for_plotting', 'draw_additional_shapes': 'cloupy.maps.draw_shapes.draw_additional_shapes', 'plt': 'matplotlib.pyplot', 'Image': 'PIL.Image'}.check_if_valid_args_and_update_class_attrs",
"line_number": 228,
"usage_type": "call... |
330881290 | # Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import string
# Code generation engine for overnet stats.
#
# Overnet tracks a large number of internal statistics, many on the cri... | null | src/connectivity/overnet/deprecated/lib/stats/statsc.py | statsc.py | py | 3,354 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "string.Template",
"line_number": 81,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 90,
"usage_type": "call"
}
] |
232670319 | #!/usr/bin/env python3
import os
import sys
import argparse
import logging
from logging import debug, info, warning, error, critical
import json
def parse_arguments():
"""Read arguments from a command line."""
parser = argparse.ArgumentParser(description='Arguments get parsed via --commands')
parser.add_... | null | Python tips/base.py | base.py | py | 2,311 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.CRITICAL",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logging.ERROR",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "logg... |
409857373 | from django.contrib.auth.models import AnonymousUser
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase, RequestFactory
from django.utils.text import slugify
from posts.models import Post
from posts.views import post_update, post_create
# Create... | null | src/posts/tests/test_views_advanced_user.py | test_views_advanced_user.py | py | 2,164 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "django.test.TestCase",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.test.RequestFactory",
"line_number": 15,
"usage_type": "call"
},
{
... |
298210442 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable... | null | python/paddle/v2/fluid/profiler.py | profiler.py | py | 2,529 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "paddle.v2.fluid.core.nvprof_init",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "paddle.v2.fluid.core",
"line_number": 58,
"usage_type": "name"
},
{
"api_name": "paddle.v2.fluid.core.nvprof_start",
"line_number": 60,
"usage_type": "call"
},
... |
81487130 | import re
import os
import pandas
from modules.data_module.stimulus import Stimulus
class DataHandler:
"""
Object. contains a combined data structure for 2 object types:
Eye-Tracker parsed data objects, and behavioral parsed data
Responsible for data loading, filtering and storing.
"""
... | null | EyePredict/modules/data_module/data_handler.py | data_handler.py | py | 9,336 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pandas.DataFrame",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.fsencode",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_... |
124129036 | #!/usr/bin/python3
"""Test Storage- Comproving expectect outputs and documentation"""
import models
import inspect
import json
import os
import unittest
from datetime import datetime
from models.engine import file_storage
from models.amenity import Amenity
from models.base_model import BaseModel
from model... | null | tests/test_models/test_engine/test_file_storage.py | test_file_storage.py | py | 3,765 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "models.engine.file_storage.FileStorage",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "models.engine.file_storage",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "models.base_model.BaseModel",
"line_number": 21,
"usage_type": "na... |
366204705 | # 데이터
import imp
import numpy as np
from sklearn.model_selection import train_test_split
x1 = np.array([range(100), range(301, 401), range(1, 101)])
x2 = np.array([range(101, 201), range(411, 511), range(100, 200)])
x1 = np.transpose(x1)
x2 = np.transpose(x2)
# y = np.array([range(1001, 1101)])
# y = np.transpose(y1)
... | null | keras/keras47_ModelCheckPoint3.py | keras47_ModelCheckPoint3.py | py | 4,684 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.array",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.transpose",
"line_numb... |
559975597 | #!/usr/bin/env python
import os
import sys
import csv
import collections as c
import itertools
import re
import json
import datetime
from dateutil.parser import parse
from transform import filename_utils as f
METASCHEMA = ["type", "header_row_num", "time_index", \
"delimiter", "output_name", "timestamp", "time_a... | null | mScopeParsers/mScopeTransform/transform/multifile_parser.py | multifile_parser.py | py | 10,316 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "transform.filename_utils.FilenameError",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "transform.filename_utils",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "transform.filename_utils.FilenameError",
"line_number": 35,
"usage_t... |
263120018 | import cv2
import os
import random
from utils.util import clear, copy
class Split(object):
"""
Split NORMAL and LESION dataset into train and val part.
In the mean time, resizing images will also be done
"""
def __init__(self, source, train_path, val_path, percentage=0.8):
self.source = ... | null | utils/split_ds.py | split_ds.py | py | 2,119 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 2... |
277249852 | import numpy as np
import matplotlib.pyplot as plt
import scipy.linalg as linalg
import kf_book.book_plots as book_plots
from kf_book.book_plots import plot_errorbars
import kf_book.gh_internal as gh
from numpy.random import randn
np.random.seed(100)
def gen_data(x0, dx, count, noise_factor, accel=0.):
zs = []
... | null | ch01_10_Varying_g.py | ch01_10_Varying_g.py | py | 1,815 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.random.seed",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.randn",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
428452622 | import re
from Models import warehouse
import json
# encoding: utf-8
'''
Input: string in format defined in README.md
Returns: tuple of json string of items requested, json string of array of warehouse and quantity of items
'''
def convert_to_json_string(input_string):
json_string = re.sub(r'([{,])(\s)([\w\d])', ... | null | inventory-allocator/src/inventory_allocator.py | inventory_allocator.py | py | 3,562 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "re.sub",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "re.sub",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 13,
... |
337678642 | #-*- coding: utf-8 -*-
from django.shortcuts import render
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.mail import EmailMultiAlternatives
from django.contrib import messages
from .models import *
from .forms imp... | null | solicitud/solicitud/apps/formulario/views.py | views.py | py | 5,243 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "datetime.datetime.now",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "django.core.mail.EmailMultiAlternatives",
"line_number": 100,
"usage_type": "call"
},
{
"... |
543512632 | #!/usr/local/bin/python3
# Test Modules
import sys
import pytest
from os import path, makedirs
import torch
import numpy as np
from PIL import Image
from pathlib import Path
from torchvision import transforms
import os
# Import module under test
# sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
fr... | null | tests/test_mcds.py | test_mcds.py | py | 4,476 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pathlib.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.expanduser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_numb... |
352459669 | #! /usr/bin/python3
# -----------------------------------------------------------
import serial as pyserial
import struct
from json import dumps
from os import system
from time import sleep
from WiiProxy import MultiWii
import matplotlib.pyplot as plt
import time
import numpy as np
# -----------... | null | code/get_pid.py | get_pid.py | py | 1,316 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "serial.Serial",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "serial.port",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "serial.baudrate",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "serial.bytesize",... |
328399209 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import datetime
import model_2dcnn
import plotly
plotly.__version__
plotly.tools.set_credentials_file(
username='ChenChiehYu', api_key='xh9rs... | null | taipei/2dcnn_multi_gpu/test_2dcnn.py | test_2dcnn.py | py | 8,253 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "plotly.__version__",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "plotly.tools.set_credentials_file",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "plotly.tools",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_n... |
394418106 | import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
plt.rcParams['mathtext.fontset'] = 'dejavuserif'
csfont = {'fontname':'DejaVu Serif'}
import numpy as np
import sys, os
sys.path.append(os.environ['raco'])
sys.path.append(os.environ['rapp'])
from common import *
from plotcommon import axis_range... | null | zz_legacy/plot/sslice/ortho_movie.py | ortho_movie.py | py | 5,333 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.use",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "sys.pat... |
310786620 | from django import forms
from django.forms import widgets
from inscrieri.models import Patrula, Individual
from inscrieri.constants import IndividualReason, PaymentGroup
from inscrieri import utils
from member import api_calls
from member.models import Member
from inscrieri.utils import getPaymentOptionsForMembers
c... | null | web/inscrieri/forms.py | forms.py | py | 5,356 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "inscrieri.models.Patrula",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "dja... |
83804379 | # coding=utf-8
"""
Output the collected values to AWS CloudWatch
Automatically adds the InstanceId Dimension
#### Dependencies
* [boto](http://boto.readthedocs.org/en/latest/index.html)
#### Configuration
Enable this handler
* handers = diamond.handler.cloudwatch.cloudwatchHandler
Example Config:
[[cloudwatch... | null | src/diamond/handler/cloudwatch.py | cloudwatch.py | py | 9,278 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "diamond.handler.Handler.Handler",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "diamond.handler.Handler.Handler.__init__",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "diamond.handler.Handler.Handler",
"line_number": 78,
"usage_type... |
371244073 | import arcade
class Room:
"""
This class holds all the information about the
different rooms.
"""
def __init__(self, width, height, size, scaling):
# You may want many lists. Lists for coins, monsters, etc.
self.wall_list = None
self.screen_width = width
self.screen... | null | planning/libs/room.py | room.py | py | 3,350 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "arcade.SpriteList",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "arcade.Sprite",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "arcade.Sprite",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "arcade.load_texture",
... |
313911962 | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | null | dxm/lib/DxEngine/DxMaskingEngine.py | DxMaskingEngine.py | py | 9,821 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "logging.getLogger",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "masking_apis.configuration.Configuration",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "urllib3.disable_warnings",
"line_number": 87,
"usage_type": "call"
},
{
... |
405674809 | import asyncio
import os
import pickle
import requests
import urllib.request
from bs4 import BeautifulSoup
from google.cloud import storage
# Get list of URLs to scrape
def get_urls():
# URLs from SoundBible follow the format:
# soundbible.com/free-sound-effects-${n}.html
FIRST_URL = 'http://soundbible.com/free... | null | web-scraping/webscrape.py | webscrape.py | py | 2,888 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "asyncio.gather",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "bs4.Beautiful... |
514285856 | import tensorflow as tf
import logging
class RandomWalkModel(object):
def __init__(self, num_nodes_query, num_nodes_corpus, dim_node_features, dim_edge_features, node_layer1,
node_layer2, edge_layer1, edge_layer2, layer1, layer2, name, delta, dropout, sparse_walk,
walk_shape=Non... | null | model.py | model.py | py | 7,028 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "tensorflow.placeholder",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "tensorflow.float32",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": ... |
310227525 | # -*- coding:utf-8 -*-
'''
@Author : xiaoyin_ing
@Email : 2455899418@qq.com
@Software: PyCharm
@File : test_recharge.py
@Time : 2020/7/22 14:54
@Desc :
'''
# -*- coding:utf-8 -*-
'''
@Author : xiaoyin_ing
@Email : 2455899418@qq.com
@Software: PyCharm
@File : test_recharge.... | null | TestCases/test_recharge.py | test_recharge.py | py | 4,893 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Common.handle_mysql.HandleDB",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "unittest.TestCase",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "Common.handle_case_relpace_data.clear_EnvData_attrs",
"line_number": 58,
"usage_type"... |
403534191 | from selenium import webdriver
from selenium.webdriver.chrome.options import Options
class CursoAutomacao:
def __init__(self):
chrome_options = Options()
chrome_options.add_argument('--lang=pt-BR')
self.driver = webdriver.Chrome(
executable_path=r'./chromedriver.exe',
... | null | mestre_web/find_element_by_class.py | find_element_by_class.py | py | 754 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 8,
"usage_type": "name"
}
] |
352023037 | from src.modules.reporting import *
from src.modules.constants import *
from matplotlib import pyplot as plt
from src.modules.classes import SqliteFetcher
from src.modules.thesis_plotting import *
import os
setup_pgf_plotting()
# ============================================================================
# IMPORT/MA... | null | reports/thesis_plots/AdditionalFeaturesComp/script.py | script.py | py | 4,822 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 93,
"usage_type": "name"
},
{
"api_name": "os.path.realpath",
"line_number": 169,
"usage_type": "call"
},
{
"api_name": "os.pat... |
584600949 | import matplotlib.pyplot as plt
import string
import os
# 图片保存路径
images_path = os.path.join('RD', 'static', 'media')
# -------数据预处理---------
def preprocess(data):
# 求最大值
def find_max(q):
m = []
for z in range(len(q)):
if len(q[z]) == 3:
m.append(q[z][2])
re... | null | RD_Website/RD/Utils/chuanbo_guocheng.py | chuanbo_guocheng.py | py | 4,442 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.join",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 82,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
335991349 | from Android_malware.Scripts.utils import *
import numpy as np
import pickle as pickle
import datetime
import queue
import keras.backend as K
VECSIZE = [0]
FEANUM = FEANUMDIC[NowYear]
def saveRuleTxt(fname, rule):
f = open("../RuleSet/" + fname, "a")
for val in list(rule):
f.write(str(val))
... | null | submissions/functional/denas/Android_malware/Scripts/ExplainModel.py | ExplainModel.py | py | 5,108 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.max",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.argmax",
"line_number": 62... |
591021541 | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 17 08:28:32 2016
@author: jayjin
"""
import sys
import numpy as np
import pandas as pd
sys.path.insert(1, '..\\MySql')
import MySqlUtils
from datetime import date
# https://docs.python.org/2/library/datetime.html#datetime-objects
#datetime1 = datetime
#datetime2 = dat... | null | Stock/DateTimeUtils.py | DateTimeUtils.py | py | 1,759 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.path.insert",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_num... |
272064290 | import bz2
from collections import deque
import gzip
from io import BytesIO
import os
import re
import string
import warnings
from onecodex.exceptions import ValidationError, ValidationWarning
GZIP_COMPRESSION_LEVEL = 5
# buffer code from
# http://stackoverflow.com/questions/2192529/python-creating-a-streaming-gzip... | null | onecodex/lib/inline_validator.py | inline_validator.py | py | 18,971 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "collections.deque",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "gzip.GzipFile",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 83,
"usage_type": "call"
},
{
"api_name": "string.maketrans",
"li... |
185798877 | import os, sys
import json
import sqlite3
import traceback
import argparse
import re
from process_sql import get_sql
script_path = os.path.dirname(os.path.abspath(__file__))
spider_root = os.path.abspath(os.path.join(script_path, "..", "data"))
sql_path = os.path.join(spider_root, "spider", "dev.json")
db_dir = os.p... | null | qdmr2sparql/parse_raw_json.py | parse_raw_json.py | py | 4,619 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.path.dirname",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"l... |
196452776 | import os
import imageio
filenames = []
for file in os.listdir():
print(file)
if file.split(".")[-1] == "jpg":
filenames.append(file)
with imageio.get_writer("./movie.gif", mode="I") as writer:
for filename in filenames:
image = imageio.imread(filename)
writer.append_data(image)
| null | jpg_to_animated_gif.py | jpg_to_animated_gif.py | py | 318 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "os.listdir",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "imageio.get_writer",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "imageio.imread",
"line_number": 12,
"usage_type": "call"
}
] |
226758372 | from google.cloud import datastore
import hashlib
class RssDataStore:
def __init__(self):
self.client = datastore.Client()
"""
RSSエンティティのモデル
- 辞書型
-- title
-- link
-- published_at (unix time)
"""
def insert_rss_docs(self, rss_docs):
entities = []
for doc i... | null | src/datastore/rss_datastore.py | rss_datastore.py | py | 767 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "google.cloud.datastore.Client",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "google.cloud.datastore",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "hashlib.sha256",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "goo... |
214671969 | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'time_map.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... | null | devel/python/python/ert/enkf/util/time_map.py | time_map.py | py | 2,671 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "ert.cwrap.BaseCClass",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "ert.cwrap.CWrapper",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "ert.enkf.ENKF_LIB",
"line_number": 64,
"usage_type": "argument"
}
] |
381636773 | import json
import copy
from MultiUserAPI import MultiUserAPI
#MultiUserAPI test
mua = MultiUserAPI()
json_object = json.load(open("politicians.json"))
followers_retweets = dict();
#json object
data = {"parteien" : {}}
try:
#Iterate over the politicians
for politician in json_object["politicians"]:
... | null | test.py | test.py | py | 1,994 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "MultiUserAPI.MultiUserAPI",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line... |
182114861 | from IPython import embed
import pytrec_eval
import numpy as np
from sklearn.metrics import precision_recall_fscore_support
METRICS = {'map',
'recip_rank',
'ndcg_cut',
'recall'}
RECALL_AT_W_CAND = {
'R_10@1',
'R_10@2',
'R_1... | null | transformer_rankers/eval/evaluation.py | evaluation.py | py | 5,596 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.sum",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 52,
... |
215846353 | from __future__ import annotations
import unittest
from dataclasses import dataclass
from hypothesis import given, assume
import hypothesis.strategies as st
from typing import List, Optional, Union
from pprint import pprint
import string
import subprocess
import re
import os
import sys
EXECUTABLE_NAME = "manageStude... | null | random_tester.py | random_tester.py | py | 11,717 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sys.platform",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "sys.stderr",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number... |
624595334 | import numpy as np
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
import json
from itertools import islice
import pprint
import os
import pickle
import math
import shelve
import logging
import heapq
def calc_TF_IDF(tfval,dfval,number):
return (1+math.log(tfval))*(math.log(number... | null | GUI/app/tempcode.py | tempcode.py | py | 5,986 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "math.log",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_numb... |
505607148 | #! /usr/bin/env python
# _*_ coding:utf-8 _*_
import pygame
from pygame.sprite import Sprite
class Alien(Sprite):
def __init__(self,ai_settings,screen):
super().__init__()
self.screen=screen
self.ai_setings=ai_settings
#加载图像
self.image = pygame.image.load('images/alien.bmp... | null | alien.py | alien.py | py | 947 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pygame.sprite.Sprite",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 14,
"usage_type": "attribute"
}
] |
144167979 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
__author__ = 'RemiZOffAlex'
__copyright__ = '(c) RemiZOffAlex'
__license__ = 'MIT'
__email__ = 'remizoffalex@mail.ru'
__url__ = 'http://remizoffalex.ru'
from wtforms import validators, Form, BooleanField, TextField, SelectField, FieldList, FormField
# from wtforms.valida... | null | webpxe/webpxe/forms/centos.py | centos.py | py | 1,173 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "webpxe.forms.Network",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "wtforms.SelectField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "wtforms.BooleanField",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "wtforms... |
146137357 |
from django.core.exceptions import ValidationError
from django.db.models import fields
from django import forms
from crispy_forms.helper import FormHelper
from collection.models.collection_six import CollectionSixFormCollection
from master_data.models.government import GovernmentBody, GovernmentBodyType
from master_... | null | collection/forms/collection_six.py | collection_six.py | py | 1,714 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "collection.models.collection_six.CollectionSixFormCollection",
"line_number": 16,
"usage_type": ... |
220365571 | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | null | poppy/transport/pecan/controllers/v1/ssl_certificates.py | ssl_certificates.py | py | 2,433 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "poppy.transport.pecan.controllers.base.Controller",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "poppy.transport.pecan.controllers.base",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "pecan.hooks.HookController",
"line_number": 32,... |
273696705 | """Models for the markup app."""
from difflib import ndiff
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from account.models import User
from modularhistory.models import Model
class GenericContentInteraction... | null | markup/models.py | models.py | py | 2,208 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "modularhistory.models.Model",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "django.db.models.DateTimeField",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_n... |
318044301 | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | null | gan/transGAN/main_multi_gpu.py | main_multi_gpu.py | py | 18,210 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "sys.stdout",
"line_number": 57,
"usage_type": "attribute"
},
{
"api_name": "logging.I... |
29121087 | import click
import seaborn as sns
from path import Path
import pandas as pd
import matplotlib.pyplot as plt
NAMES = [
("results/filtered-data/nn-4/level1", "NN-4"),
("results/splits-500-10relu-location-size3/level1", "Split-NN (3)"),
("results/splits-500-10relu-location-size9/level1", "Split-NN (9)"),
... | null | MetaSenseTransfer/scripts/plot_split_comparison.py | plot_split_comparison.py | py | 1,546 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "path.Path",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "path.Path",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_numb... |
264809162 | from django import template
from groups.models import Attribute
register = template.Library()
@register.filter
def mysplit(value, sep = "."):
parts = value.split(sep)
# print parts[1:][0]
return (parts[0][0], parts[1:][0])
@register.filter
def count(list, sep = "."):
mzxml = 0
csv = 0
for fil... | null | django_projects/pimp/projects/templatetags/project_tags.py | project_tags.py | py | 1,158 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
}
] |
508489281 | import sys
from flask import Flask, render_template
from flask_flatpages import FlatPages
from flask_frozen import Freezer
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = ['.html', '.md']
FLATPAGES_ROOT = 'content'
POST_DIR = 'posts'
PROJECTS_DIR = 'projects'
FREEZER_DESTINATION = "{{cookiecutter.web... | null | {{cookiecutter.directory_name}}/app.py | app.py | py | 1,724 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "flask_flatpages.FlatPages",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "flask_frozen.Freezer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "flask.rend... |
29804405 | from django.db import models
from django.conf import settings
from django.db.models.signals import post_save, pre_save
from django.core.exceptions import ValidationError
from django.urls import reverse
from django.utils.text import slugify
from .misc import get_upload_path, get_upload_avatar
from .const import REGION
f... | null | core/models.py | models.py | py | 4,915 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "django.db.models.Model",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "django.db.models.OneToOneField",
"line_number": 15,
"usage_type": "call"
},
{
"api_n... |
382946436 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | null | taskflow/examples/optional_arguments.py | optional_arguments.py | py | 2,930 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "taskflow.task.Task",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "taskflow.task",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "taskflow.patterns.linear_flow.Flow",
"line_number": 28,
"usage_type": "call"
},
{
"api_name... |
96853 |
import pyro
import torch
from py4j.java_gateway import JavaGateway, CallbackServerParameters
import matplotlib.pyplot as plt
import matplotlib
from pyro.infer import SVI, Trace_ELBO
from pyro.optim import Adam
import pyro.distributions as dist
import torch.distributions.constraints as constraints
from pyro.distributio... | null | Models/SystemModels/hu.bme.mit.gamma.casestudy.camea/simulator-gen/simulator_mereshez2.py | simulator_mereshez2.py | py | 10,984 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "py4j.java_gateway.JavaGateway",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "py4j.java_gateway.CallbackServerParameters",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "influxdb.InfluxDBClient",
"line_number": 40,
"usage_type": "call... |
165722355 | from Utils import Utils
import json
import os
class DDns:
@staticmethod
def save_records(accessKeyId,accessSecret,domain):
response = str(Utils.get_records(accessKeyId,accessSecret,domain))[2:-1]
jsonfile = json.loads(response)
# print(jsonfile)
with open('records.json','w') as ... | null | DDns.py | DDns.py | py | 1,151 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "Utils.Utils.get_records",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Utils.Utils",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_num... |
577883483 | import torch
import torch.nn as nn
from torch.nn.functional import one_hot, log_softmax, softmax, normalize
class Agent(nn.Module):
'''
This class defines a neural network as an agent.
The agent takes in observation and returns an action.
'''
def __init__(self, observation_space_size: int, actio... | null | needs_improvement/ppo_replay_buffer_single_thread/network.py | network.py | py | 1,006 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "torch.nn.Module",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "torch.manual_seed",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn.Sequential",
... |
192659989 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 24 18:24:50 2018
@author: EduardoArnoldo
"""
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
# Standard Black Scholes
def BSprice(style,S0, K, r, sigma, T,div):
d1=(np.log(S0/K) + (r -div+ sigma**2 / 2) * T)/(sigma * np.sqrt(T))
d2=(... | null | 2 Down Analityc.py | 2 Down Analityc.py | py | 2,009 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "numpy.log",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.log",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.sqrt",
"line_number": 16,
... |
205164852 | #
# @lc app=leetcode.cn id=162 lang=python3
#
# [162] 寻找峰值
#
#二分查找,寻找峰值,分为序列是短递增,短递减的情况
from typing import List
class Solution:
def findPeakElement(self, nums: List[int]) -> int:
#判断特殊情况
if not nums:
return
if len(nums)==1:
return 0
#二分查找
l,r=0,len(nu... | null | 162.寻找峰值.py | 162.寻找峰值.py | py | 718 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
}
] |
182995696 | import numpy as np
import matplotlib.pyplot as plt
import scipy.ndimage.filters as filters
import tensorflow as tf
import math
from tensorflow.contrib.stateless import stateless_random_uniform
from worldload import Generator
from create_venice_network import create_value
from create_stride_network import create_network... | null | procgen_sub.py | procgen_sub.py | py | 3,520 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "create_stride_network.create_network",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "create_venice_network.create_value",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "tensorflow.placeholder",
"line_number": 23,
"usage_type": "call"
... |
336582067 | import numpy as np
import copy
import time
from scipy.sparse.linalg import LinearOperator
from functools import partial
from mykrypy.linsys import LinearSystem, Gmres # mykrypy is krypy with modified linsys.py
from mykrypy.utils import ConvergenceError # mykrypy is krypy with modified linsys.py
from fiberCollection... | null | Python/TemporalIntegrator.py | TemporalIntegrator.py | py | 10,578 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "copy.deepcopy",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 109,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 113,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number"... |
335589241 | import json
import tempfile
from datetime import datetime, timedelta
from enum import Enum
from itertools import zip_longest
from threading import Timer
from typing import Any, List, Optional, Dict, Iterable, Tuple
from telegram import ParseMode, TelegramError, Update, Message, ChatPermissions
from telegram.error impo... | null | telegram_bot/bot.py | bot.py | py | 14,405 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "itertools.zip_longest",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "typing.Iterable",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"... |
125492450 | import pyglet
import Objects
import Resources
import random
'''
def aliens_on_screen(num_aliens,batch=None):
new_aliens = []
alien_y = 450
spacing = 800 // (num_aliens + 1)
for _i in range(num_aliens):
alien_x = (spacing * (_i + 1))
alien = Objects.Alien(x=alien_x,y=... | null | Functions.py | Functions.py | py | 2,325 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "pyglet.sprite.Sprite",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "pyglet.sprite",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "Resources.player_image",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "r... |
299228777 | # Some code taken from: https://github.com/wsjeon/maddpg-rllib/
import imp
import os
import gym
from gym import wrappers
from ray import rllib
from multiagent.environment import MultiAgentEnv
import multiagent.scenarios as scenarios
CUSTOM_SCENARIOS = ['simple_switch']
class ParticleEnvRenderWrapper(gym.Wrapper)... | null | how-to-use-azureml/reinforcement-learning/multiagent-particle-envs/files/rllib_multiagent_particle_env.py | rllib_multiagent_particle_env.py | py | 3,674 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "gym.Wrapper",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "ray.rllib.MultiAgentEnv",
"line_number": 45,
"usage_type": "attribute"
},
{
"api_name": "ray.rllib",
"line_number": 45,
"usage_type": "name"
},
{
"api_name": "os.path.join"... |
512276221 | #-*-coding:utf-8-*-
#2017-2-13
#本脚本用来读取股票分类信息
#并将分类信息存入本地数据库中
#以便将服务器数据库导入本地数据库后,利用分类信息进行分析
'''#######################################################'''
#导入pandas、MySQLdb以及slqalchemy、os、shutil库
import pandas as pd
import pymysql
from sqlalchemy import create_engine
import tushare as ts
#import pdb
#设置全局变量
#DB_ENGINE为创... | null | python/read_classify.py | read_classify.py | py | 1,640 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "tushare.get_industry_classified",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tushare.get_concept_classified",
"line_number": 23,
"usage_type": "call"
}
] |
364227885 | import multiprocessing
import time
import requests
import csv
headers={
'Cookie': 'll="118247"; bid=ZmLBefMrdSY; _vwo_uuid_v2=D8328065DA6EFABE891498524AEA116C9|bc93ce315aae7ce5670d8387a48374dc; douban-fav-remind=1; __gads=ID=d42cc7ac0b20cba0:T=1565224898:S=ALNI_MbG0a_E-eLkeIvBumqrNM52T55r3A; viewed="5336893"; gr_user_i... | null | os/os4_processing.py | os4_processing.py | py | 3,667 | python | en | code | null | code-starcoder2 | 76 | [
{
"api_name": "requests.get",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.