id stringlengths 2 8 | text stringlengths 16 264k | dataset_id stringclasses 1
value |
|---|---|---|
288595 | <reponame>deviant-syndrome/spear2sc
# -*- coding: utf-8 -*-
"""spear2sc.spear_utils: Utitlity methods to read SPEAR files"""
def process_line(line):
""" (list of str) -> list of list of float
Parses line, a line of time, frequency and amplitude data output by
SPEAR in the 'text - partials' format.
R... | StarcoderdataPython |
1731593 | <gh_stars>1-10
from importlib import import_module
def import_spec_object(obj_str):
path, obj = obj_str.rsplit('.', maxsplit=1)
module = import_module(path)
return getattr(module, obj)
| StarcoderdataPython |
1668830 | <reponame>webhacking/finance
from math import nan
class BaseProfile:
def __init__(self, symbol: str):
self.symbol = symbol
self.name = None
self.current_price = nan
self.outstanding_shares = nan
self.eps = nan
self.bps = nan
def parse(self, raw: str):
r... | StarcoderdataPython |
1924915 | '''
/*
* @Author: <NAME>
* @Date: 2021-01-22 22:54:13
* @Last Modified by: <NAME>
* @Last Modified time: 2021-01-23 01:10:54
*/
'''
import tkinter as tk
from PIL import Image,ImageDraw,ImageTk
import numpy as np
import cv2
import os
import joblib
model = joblib.load('English_Char_SVC.sav')
win = tk.Tk()
count... | StarcoderdataPython |
11282584 | <reponame>frank-gear/tiny_python_projects
#!/usr/bin/env python3
"""tests for sampler.py"""
import os
import random
import re
import string
from subprocess import getstatusoutput
from Bio import SeqIO
from Bio.SeqUtils import GC
from numpy import mean
from itertools import chain
from shutil import rmtree
... | StarcoderdataPython |
6503485 | import re
import os
import sys
import time
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from GAE import *
from utils import npytar, save_volume
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
return [atoi(c) for c in re.split(r'(\d+)', text)... | StarcoderdataPython |
3464395 | <filename>daedalus/lexer.py
#! cd .. && python3 -m daedalus.lexer
# TODO: better support for regex
import logging
import sys
import io
from .token import Token, TokenError
class LexError(TokenError):
pass
# special characters that never combine with other characters
chset_special1 = "{}[](),~;:#"
... | StarcoderdataPython |
11349465 | #!/usr/bin/env python3
#
# Tolka loggfil med transaktioner från Nexo.
#
# Nexo tolkas som en låneplattform. Dvs, all insättning och uttag är realisering.
# Interna transkationer (låsning) ger ingen realisering.
# Räntor och utdelningar blir ränta.
#
# Exempel: nexo_transactions.csv
#
# Transaction,Type,Currency,Amount,... | StarcoderdataPython |
127099 | <reponame>NOBLEGG/RPS<gh_stars>0
def active_message(domain, uidb64, token):
return f"아래 링크를 클릭하시면 인증이 완료되며, 바로 로그인하실 수 있습니다.\n\n링크 : https://{domain}/activate/{uidb64}/{token}\n\n감사합니다."
def reset_message(domain, uidb64, token):
return f"아래 링크를 클릭하시면 비밀번호 변경을 진행하실 수 있습니다.\n\n링크 : https://{domain}/reset/{uidb64... | StarcoderdataPython |
9608101 | '''
***
Modified generic daemon class
***
Author: http://www.jejik.com/articles/2007/02/
a_simple_unix_linux_daemon_in_python/www.boxedice.com
License: http://creativecommons.org/licenses/by-sa/3.0/
Changes: 23rd Jan 2009 (<NAME> <<EMAIL>>)
- Replaced har... | StarcoderdataPython |
3458205 | <filename>goethe/utils/context/methods.py<gh_stars>1-10
import itertools as it
from collections import deque
import random
import spacy
class ContextMethod:
def __init__(self, window=None, **kwargs):
self.window = window
def tokenwise_context(self, doc):
"""Go over each word in `context` and... | StarcoderdataPython |
11270227 | <reponame>meissnert/StarCluster-Plugins
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class OmicsPipeInstaller(ClusterSetup):
def run(self, nodes, master, user, user_shell, volumes):
for node in nodes:
log.info("Installing Docker on %s " % (node.alias))
#node.ssh.execute... | StarcoderdataPython |
94963 | <reponame>alonbg/acos-client
# Copyright 2014, <NAME>, A10 Networks.
#
# 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
#
# U... | StarcoderdataPython |
3518152 | <filename>ros2bag/test/test_record.py
# Copyright 2020 Open Source Robotics Foundation, 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... | StarcoderdataPython |
70613 | # LER O PESO DE 5 PESSOAS E MOSTRE O MAIOR E O MENOR
maior = 0
menor = 0
for pessoa in range(1, 6):
peso = float(input(f'Digite o {pessoa}° peso: '))
# SEMPRE NO 1° LAÇO O VALOR SERA O MAIOR E O MENOR POIS NAO HA REFERENCIA
if pessoa == 1:
maior = peso
menor = peso
# A PARTIR DO 2° LAÇO ... | StarcoderdataPython |
309406 | from queue import Queue
import jsonpickle
from handlers.JobEventHandler import JobEventHandler
from infrastructor.multi_processing.ProcessManager import ProcessManager
from scheduler.JobSchedulerService import JobSchedulerService
class JobSchedulerEvent:
job_scheduler_type = None
job_event_queue: Queue = No... | StarcoderdataPython |
4972367 | # This sample tests a variety of unicode characters including those that
# require two-code (surrogate) forms.
# Old Italic
𐌎𐌘𐌟𐌁 = 42
# Egyptian hieroglyphs
𓃘𓐭𓇀𓅨𓆙 = 2
# Linear B Ideograms
𐂂𐃪𐃯 = ""
# Cuneiform
𒀟𒀕𒀰𒁜𒂐𒄊 = ""
# Old Persian
𐎠𐏊𐏏 = 3
# Lydian
𐤢𐤷𐤬𐤮 = 4
# Phoenician
𐤔𐤑𐤇 = 4
# ... | StarcoderdataPython |
5125250 | <reponame>GBHULLAR-POST/field_runner
from pygame.locals import*
import pygame
import sys
import random
import math
import effects
import levels
pygame.init()
SCREEN_SIZE = (1200, 700)
SCREEN = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption('FIELD RUNNER')
clock = pygame.time.Clock()
... | StarcoderdataPython |
11273469 | <gh_stars>100-1000
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, over... | StarcoderdataPython |
227162 | import unittest
import numpy as np
import numdifftools.core as nd
import numdifftools.nd_algopy as nda
import numdifftools.nd_statsmodels as nds
from numpy.testing import assert_array_almost_equal
from numdifftools.example_functions import function_names, get_function
class TestExampleFunctions(unittest.TestCase):
... | StarcoderdataPython |
6650570 | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import pywt
from scipy import signal
plt.figure(figsize=(1, 1))
fig = plt.gcf()
csv = pd.read_csv(r'C:\Users\<NAME>\Documents\data\PPG.csv', low_memory=False)
data = csv.iloc()[:]
_PPG = list(data['PPG'])
ABP = data['ABP']
def smooth(a, WSZ):
... | StarcoderdataPython |
144154 | # Made for TeleBot
# Re-written by @
# Kangers kwwp the credits
#Made by @
#From Nekos API
import datetime
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.account import UpdateNotifySettingsRequest
from uniborg.util import admin_cmd
@b... | StarcoderdataPython |
3426279 | import os
from tempfile import mkdtemp
from unittest import TestCase
from warnings import catch_warnings
from testfixtures.mock import Mock
from testfixtures import (
TempDirectory, Replacer, ShouldRaise, compare, OutputCapture
)
from ..compat import Unicode, PY3
from ..rmtree import rmtree
if PY3:
some_byte... | StarcoderdataPython |
3541707 | <reponame>terasakisatoshi/pythonCodes
"""
reference
http://qiita.com/_329_/items/bcc306194d52f7b81b5a
"""
from sklearn.datasets import fetch_mldata
from sklearn.cross_validation import train_test_split
import numpy as np
import chainer
from chainer import functions as F
from chainer import links as L
from chainer imp... | StarcoderdataPython |
3260907 | import numpy as np
import cv2
import matplotlib.pyplot as plt
from helper_functions import *
# Define a class to receive the characteristics of each line detection
class Line():
def __init__(self, image_shape, debug = False):
# HYPERPARAMETERS
# Number of sliding windows
self.nwind... | StarcoderdataPython |
275998 | #!/usr/bin/env python
# Reads the PAUSE button using interupts and sets the LED
# Pin table at https://github.com/beagleboard/beaglebone-blue/blob/master/BeagleBone_Blue_Pin_Table.csv
# Import PyBBIO library:
import Adafruit_BBIO.GPIO as GPIO
import time
button="P8_9" # PAUSE=P8_9, MODE=P8_10
LED ="USR3"
# Set th... | StarcoderdataPython |
3343262 | <filename>atlas/foundations_contrib/src/foundations_contrib/option.py
def Option(value):
from foundations_contrib.something import Something
from foundations_contrib.nothing import Nothing
if isinstance(value, Nothing) or isinstance(value, Something):
return value
return Nothing() if value i... | StarcoderdataPython |
8193833 | <gh_stars>1-10
import os
import shutil
from PyQt5 import QtCore, QtGui, QtWidgets
# import time
from SeaBASSHeader import SeaBASSHeader
from ConfigFile import ConfigFile
from MainConfig import MainConfig
class SeaBASSHeaderWindow(QtWidgets.QDialog):
def __init__(self, name, inputDir, parent=None):
super... | StarcoderdataPython |
9742250 | import os
from dotenv import load_dotenv
from abelardoBot import AbelardoBot
import discord
import random
from discord.ext import commands
load_dotenv()
TOKEN = os.getenv('DISCORD_BOT_TOKEN')
VERBOSE_LEVEL = os.getenv('VERBOSE_LEVEL')
bot = AbelardoBot(command_prefix='!',
verbose_level=0 if VERBOS... | StarcoderdataPython |
6494121 | # proxy module
from __future__ import absolute_import
from blockcanvas.function_tools.rest_html import *
| StarcoderdataPython |
11320827 | <gh_stars>0
import argparse
import sys
from logging import DEBUG as logging_DEBUG
from logging import INFO as logging_INFO
from logging import FileHandler, Formatter, StreamHandler, getLogger
# stdout Handler
stdout_handler = StreamHandler(stream=sys.stdout)
stdout_handler.setLevel(logging_DEBUG) # DEBUGまで出すが上の階層次第で出... | StarcoderdataPython |
6646596 | <gh_stars>0
import os
import unittest
from PIL import Image
from directdemod import constants
from directdemod.georeferencer import tif_to_png
class TestConvert(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.tif = constants.MODULE_PATH + '/tests/data/tif_to_png/sample.tif'
cls.png... | StarcoderdataPython |
11242813 | # Day 21: Splitting Code Into Multiple Files
# Exercises
# For today's (only) exercise, we're giving you a bunch of code that is all in one file.
# Your task is to split that code into multiple files. You can choose how many and which files you want to split the code into, but think about why you're putting each piece... | StarcoderdataPython |
6425540 | from flask import Flask, jsonify
import numpy as np
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
# reflect an existing database into a new model
Base = automap_base()
# reflect ... | StarcoderdataPython |
131031 | <reponame>salesforce/coco-dst<filename>coco-dst/run_demo.py
"""
Copyright (c) 2020, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import argparse
import logging
import ... | StarcoderdataPython |
5062974 | # Copyright (c) 2013, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
data = get_data(filters)
columns = get_columns(filters)
return columns, data
d... | StarcoderdataPython |
228104 | <reponame>wharton/django-cybersource-hosted-checkout<filename>cybersource_hosted_checkout/tests/test_utils.py
from django.conf import settings
from django.test import TestCase
from cybersource_hosted_checkout.utils import create_sha256_signature, sign_fields_to_context
class UtilTests(TestCase):
def setUp... | StarcoderdataPython |
6700776 | <filename>tests/test_model_bundle.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `model_bundle` package."""
import unittest
from model_bundle.model_bundle import ModelBundle
class TestModelBundle(unittest.TestCase):
"""Tests for `model_bundle` package."""
def setUp(self):
"""Set up... | StarcoderdataPython |
11310143 | <filename>webverify/webverify.py
import logging
import time
import base64
from binascii import Error as BinAsciiError
import hmac
import hashlib
import uuid
from flask import Flask
from flask import request, g, current_app
from flask import render_template, redirect, url_for
import requests
from requests.exceptions ... | StarcoderdataPython |
6695829 | <filename>rdr_service/alembic/versions/fdc0fb9ca67a_rename_participant_view.py
"""rename participant_view
Revision ID: fdc0fb9ca67a
Revises: <KEY>
Create Date: 2019-06-06 10:40:31.617393
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "fdc0fb9ca67a"
down_revision = "<KEY>"
branch_label... | StarcoderdataPython |
8030492 | #Write a Python program to convert true to 1 and false to 0.
word = "true"
word = int(word=="true")
print(word)
word1 = "false"
word1 = int(word1=="true")
print(word1) | StarcoderdataPython |
8132647 | # ***************************************************************
# Copyright (c) 2020 Jittor. Authors: <NAME> <<EMAIL>>. All Rights Reserved.
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ************************************************... | StarcoderdataPython |
12838703 | <reponame>ibnmasud/AI-102-AIEngineer
import os
from dotenv import load_dotenv
from azure.core.exceptions import ResourceNotFoundError
from azure.ai.formrecognizer import FormRecognizerClient
from azure.ai.formrecognizer import FormTrainingClient
from azure.core.credentials import AzureKeyCredential
def main():
... | StarcoderdataPython |
174523 | import pickle
import xlsxwriter
import numpy as np
import os
def load(filename):
loaded_dict = pickle.load(open(filename, 'rb'))
return dict
def np_2darray_converter(matrix):
if(type(matrix) == type({})): # making dictionary suitable for excel
keys = list(matrix.keys())
value... | StarcoderdataPython |
9604742 | """ Entity Extraction from OCR text Analysis """
import extract as extract
import ocr as ocr
import pandas as pd
import numpy as np
from fuzzywuzzy import fuzz
# Read the csv file to be evaluated
df = pd.read_csv("data/ocrdata.csv")
# Process Text
df["Processed Text"] = df["OCR Text"].str.split()
ocrmodel = ocr.hand... | StarcoderdataPython |
286627 | <reponame>davidsoergel/tensorboard
# Copyright 2017 The TensorFlow 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... | StarcoderdataPython |
6497116 | <filename>tests/writer/test_xml_writer.py
"""
Test objconfig.writer.Xml
"""
from objconfig.writer import Xml as XmlWriter
from objconfig.reader import Xml as XmlReader
from objconfig.writer import AbstractWriter
from objconfig.writer import WriterInterface
import os
def test_emptyinstantiation_xml():
writer = Xm... | StarcoderdataPython |
3477148 | #!/usr/bin/env python3
#A shell is a command line interface used to interact with your operating system"
#EX: Zsh Fish Bash(<-for Linux shell)
#environment variables
#The commands:
#Echo: print text in Linux shell terminal $Variable
import os
#Python
#os.environ dictionary to access environment variables in Pytho... | StarcoderdataPython |
11372546 | <filename>spinup/utils/constants.py
class PlottingConstants:
EPISODE_TIME_STEPS = 'episode_time_steps'
EPISODE_REWARD = 'episode_reward'
MINIMAL_DISTANCE_PER_EPISODE = 'minimal_distance_per_episode'
AVERAGE_DISTANCE_PER_EPISODE = 'average_distance_per_episode'
NUMBER_OF_FAILURES = 'number_of_failure... | StarcoderdataPython |
201160 | #////////////////////////////////////////
#////////////////////////////////////////
#////////<NAME> -- @SP1D5R//////////
#////////////////////////////////////////
#////////////////////////////////////////
from qiskit import QuantumProgram
QP = QuantumProgram() #Definine QuantumProgram as pq
QR = QP.create_quantum... | StarcoderdataPython |
6537242 | <reponame>EllenRoberts/MA
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 15 09:44:32 2019
@author: efr587
"""
import pandas
import pandas as pd
import numpy as np
#read csv into pandas with tab deliniation------
genre_data = pandas.read_csv('U:/Git/MA_Data_Processing/Milton_texts_classifier.csv', sep=','... | StarcoderdataPython |
5089845 | <filename>final/170401024/istemci.py
#E<NAME>AN 170401024
import socket
import os
from time import gmtime,strftime
from datetime import datetime
import time
import datetime
host = input("Sunucu ip adresini girin: ")
#host = '192.168.1.36'
port = 142
msg = "gecikme hesabi"
kmt = 'sudo date --set='
... | StarcoderdataPython |
5058077 | #!/usr/bin/env python
import time, os, sys, argparse, pwd, grp
from scapy.all import *
# Many systems require root access for packet sniffing, but we probably
# don't want to be running any commands as root. Drop to whatever user
# has been requested before we run anything.
def dropPrivileges(username):
if( os.getui... | StarcoderdataPython |
247374 | <reponame>mammothb/syndata-generation
import argparse
import random
import signal
from collections import namedtuple
from functools import partial
from multiprocessing import Pool
from pathlib import Path
import yaml
from PIL import Image
from defaults import CONFIG_FILE
from util_bbox import overlap
from util_image ... | StarcoderdataPython |
196575 | import re
from datetime import datetime
from moto.core import get_account_id, BaseBackend
from moto.core.utils import iso_8601_datetime_without_milliseconds, BackendDict
from .exceptions import (
InvalidInputException,
ResourceAlreadyExistsException,
ResourceNotFoundException,
ValidationException,
)
... | StarcoderdataPython |
9736570 | <gh_stars>0
# !/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Created on OCT 29, 2020
@author: <EMAIL>
"""
import time
import cProfile
import pstats
import os
def do_cprofile(filename):
"""
Decorator for function profiling.
"""
def wrapper(func):
def profiled_func(*args, **kwargs):
#... | StarcoderdataPython |
3223793 | import json
import prox
from flask import Flask
app = Flask(__name__)
@app.route("/check/<ip>/<int:port>")
def check(ip, port):
return json.dumps(prox.check_proxy(ip, port))
if __name__ == '__main__':
app.run(host="0.0.0.0", debug=True)
| StarcoderdataPython |
9791147 | #!flask/bin/python
from app import app
app.run(debug=True)
| StarcoderdataPython |
8056624 | <filename>tests/test_wrapped_vc_validators.py
# -*- coding: utf-8 -*-
import datetime
import uuid
from immutable_data_validation import validate_datetime
from immutable_data_validation import validate_float
from immutable_data_validation import validate_int
from immutable_data_validation import validate_str
from immut... | StarcoderdataPython |
4811811 | #########################################
nrb = geo[0]
from caid.cad_geometry import cad_nurbs
C = np.zeros_like(nrb.points)
_C = np.genfromtxt("u.txt")
shape = list(nrb.shape)
C = np.zeros(shape+[3])
C[...,0] = _C
srf = cad_nurbs(nrb.knots, C, weights= nrb.weights)
#print srf.points
ntx = 80
nty = 80
#nty = 40
#nt... | StarcoderdataPython |
11223691 | <filename>solutions/0187.Repeated_DNA_Sequences/python_solution.py
class Solution:
def findRepeatedDnaSequences(self, s):
Count = Counter(s[i-10:i] for i in range(10, len(s) + 1))
return [key for key in Count if Count[key] > 1] | StarcoderdataPython |
11316982 | import mbuild as mb
import numpy as np
class UCer2(mb.Compound):
def __init__(self):
"""Returns a CER NS C24 with the head-to-tail vector pointing in +z.
"""
super(UCer2, self).__init__(name='ucer2')
mb.load('ucer2.pdb', compound=self, relative_to_module=self.__module__)
mb.... | StarcoderdataPython |
11311564 | <filename>research/minimax/domino_ux.py
from minimax import Minimax
from minimax_domino import Game
from random import Random
def generate_game(seed=None):
rnd = Random(seed)
tokens = [(j, i) for i in range(7) for j in range(i + 1)]
assert len(tokens) == 28
tokens = rnd.sample(tokens, 28)
assigne... | StarcoderdataPython |
9631464 | <filename>tests/utils.py
# -*- coding: utf-8 -*-
from django.core.urlresolvers import get_script_prefix, set_script_prefix
class script_prefix(object):
def __init__(self, newpath):
self.newpath = newpath
self.oldprefix = get_script_prefix()
def __enter__(self):
set_script_prefix(self.... | StarcoderdataPython |
3584655 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.applications.resnet50 import preprocess_input
import json
import os
import glob
import sys
import pandas as p... | StarcoderdataPython |
1954056 | <reponame>rcbops/glance-buildpackage
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
# 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 ... | StarcoderdataPython |
8087730 | <filename>examples/python/gift_giver/models/attendee.py
from orator import Model
class Attendee(Model):
__table__ = 'attendees'
__fillable__ = ['name', 'vendor_user_id', 'rsvp_answer', 'awarded']
pass
| StarcoderdataPython |
11220706 | <reponame>ismailqau/libxayagame
# Copyright (C) 2020 The Xaya developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from xayagametest.testcase import XayaGameTest
import os
import os.path
class NonFungibleTest (XayaGameTes... | StarcoderdataPython |
1855633 | ## ##
## GEOG 485 Final Project ##
## ##
## This script downloads earthquake data from USGS feeds in KML and in ##
## GeoJSON form... | StarcoderdataPython |
3255455 | from glyphNanny import toggleObserverVisibility
toggleObserverVisibility() | StarcoderdataPython |
11327308 | <reponame>pavel-paulau/moveit
from setuptools import setup
setup(
name='moveit',
version='0.7.5',
description='ns_server master events analyzer',
author='<NAME>',
author_email='<EMAIL>',
packages=[
'moveit',
],
entry_points={
'console_scripts': [
'flow = movei... | StarcoderdataPython |
155061 | from output.models.ms_data.regex.re_l15_xsd.re_l15 import Doc
__all__ = [
"Doc",
]
| StarcoderdataPython |
4912717 | <filename>docker/website-builder/createPayoutPages.py
# coding=utf-8
import json
import sys
save_path = sys.argv[1]
with open('payouts.json') as json_file:
raw_payouts = json.load(json_file)
delegators = {}
for cycle,cycle_val in raw_payouts["payoutsByCycle"].items():
for delegator in cycle_val["delegators"... | StarcoderdataPython |
1988415 | from Node_Depths import nodeDepths, BinaryTree
def findNode(nodes, id):
if id==None:
return None
for node in nodes:
if node["id"] == id:
n = BinaryTree(node['value'])
n.left = findNode(nodes, node['left'])
n.right = findNode(nodes, node['right'])... | StarcoderdataPython |
3465599 | <filename>gym-xplane/gym_xplane/space_definition.py
import numpy as np
from gym import spaces
class xplane_space():
def Action_space(self):
"""
return spaces.Dict({"Latitudinal_Stick": spaces.Box(low=-1, high=1, shape=()),
"Longitudinal_Stick": spaces.Box(low=-1, high=1, shape=()),
... | StarcoderdataPython |
3577811 | <filename>app1/views.py
from django.shortcuts import render,HttpResponse
from app1.models import Contact
from app1.forms import ContactForm,NewsletterForm
from django.contrib import messages
# Create your views here.
from django.http import HttpResponse,JsonResponse,HttpResponseRedirect
def index(request):
return... | StarcoderdataPython |
6608614 | <filename>programme.py
from argparse import ArgumentParser
from pathlib import Path
from libprogramme import lecture, conversion, ecriture
parser = ArgumentParser(description = 'Générateur de site statique')
# Argument positionnel
parser.add_argument('convert', help = "Lance la conversion du markdown en html")
# ... | StarcoderdataPython |
1709334 | <gh_stars>0
from bs4 import BeautifulSoup
import requests
from urllib.request import Request, urlopen
import sqlalchemy
from sqlalchemy.sql.functions import user
import creds
import db
from sqlalchemy import Table, Column, Integer, String, MetaData
from datetime import datetime
username = creds.db['username']
password... | StarcoderdataPython |
1752586 | from django.urls import path
app_name = 'accounts'
urlpatterns = [
]
| StarcoderdataPython |
3474438 | # Generated by Django 2.2.10 on 2020-05-08 13:33
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ImageInfo',
f... | StarcoderdataPython |
1771405 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
## @package TBTKview
# @file plotMAG.py
# @brief Plot magnetization
#
# @author <NAME>
import h5py
import numpy
import matplotlib.pyplot
import matplotlib.axes
import matplotlib.cm
import scipy.ndimage.filters
import mpl_toolkits.mplot3d
import sys
import math
import... | StarcoderdataPython |
8042267 | from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import os
from scipy.interpolate import interp1d
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import argparse
def get_rid_of_num(name):
while(name[-1].isdigit()):
del name[-1]
return ''.jo... | StarcoderdataPython |
3562678 | from setuptools import setup
setup(name='py-pacman',
version='1.0.0',
install_requires=['pygame', 'gym', 'numpy', 'pygame-menu'] # And any other dependencies foo needs
) | StarcoderdataPython |
8104934 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerField()
other_value = models.IntegerField(default=0)
def __unicode__(self):
... | StarcoderdataPython |
9748099 | <filename>test/nn/test_initializers.py
# Copyright 2021 The NetKet 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... | StarcoderdataPython |
4971823 | """
Display Hooks for pycairo, cairocffi Surfaces and Contexts.
"""
from io import BytesIO
from IPython.core import display
def display_cairo_surface(surface):
"""Displayhook function for Surfaces Images, rendered as PNG."""
b = BytesIO()
surface.write_to_png(b)
b.seek(0)
data = b.read()
ip_... | StarcoderdataPython |
102702 | <reponame>neale/CS-program
from __future__ import print_function
import sys
import numpy as np
from Layers import Linear, ReLU, Sigmoid
from Loss import CrossEntropy
class FullyConnected(object):
def __init__(self, input_dims, hidden_units, batch_size):
self.grad = None
self... | StarcoderdataPython |
12847897 | <filename>oscar/lib/python2.7/site-packages/whoosh/analysis/ngrams.py
# Copyright 2007 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must reta... | StarcoderdataPython |
9779961 | DSN = "dbname=test user=test password=<PASSWORD> host=localhost" | StarcoderdataPython |
8037977 | <reponame>Irish-Gambit73/Python-Project
from playsound import playsound
playsound("jikan no seihou.mp3") | StarcoderdataPython |
9634414 | import os.path
import torch.utils.data as data
from data.image_folder import make_dataset
from PIL import Image
import random
import torchvision.transforms as transforms
import numpy as np
import torch
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(s... | StarcoderdataPython |
1764663 | # Copyright 2017 University of Chicago. 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 requ... | StarcoderdataPython |
12818651 | <filename>sdk/python/pulumi_aws/dms/endpoint.py<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, ... | StarcoderdataPython |
1851006 | <reponame>osgirl/python-veml6070
from setuptools import setup
setup(name='veml6070',
version='1.0',
url='http://github.com/cmur2/python-veml6070',
author='<NAME>',
description=' A python library for accessing the VEML6070 digital UV light sensor from Vishay.',
packages=['veml6070'],
... | StarcoderdataPython |
9654009 | # pylint: disable=missing-module-docstring,missing-function-docstring,unused-argument
from itertools import chain
from typing import List
import pytest
from _pytest.config import Config
from _pytest.config.exceptions import UsageError
from pytest_profiles.profile import profile
@pytest.mark.parametrize("profiles", ... | StarcoderdataPython |
8175709 | <filename>mvn_xsens_carla/carla_client.py
#!/usr/bin/env python3.6
import carla
import random
import time
from receive_from_xsens import get_data
SEGMENTS_IDS = {
1: "Pelvis",
2: "L5",
3: "L3",
4: "T12",
5: "T8",
6: "Neck",
7: "Head",
8: "Right Shoulder",
9: "Right Upper Arm",
... | StarcoderdataPython |
6581066 | <gh_stars>1-10
import importlib
import inspect
from copy import deepcopy
from typing import Dict, Callable, Any, List, Optional
from kallisticore.exceptions import UnknownModuleName, CouldNotFindFunction
from kallisticore.lib.credential import Credential
from kallisticore.lib.expectation import Expectation
from kallis... | StarcoderdataPython |
1689063 | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load i... | StarcoderdataPython |
4960776 | import random
from collections import defaultdict, Counter
# full credits to <NAME>!
# source: https://eli.thegreenplace.net/2018/elegant-python-code-for-a-markov-chain-text-generator/
def generate(file):
STATE_LEN = 10
with open(file, 'r', encoding='utf-8') as file:
data = file.read()
... | StarcoderdataPython |
1755680 | """Given a target image and a directory of source images, makes a photomosaic.
"""
import argparse
import cv2
import numpy as np
import os
import random
import sys
from glob import glob
from scipy.spatial import cKDTree
from skimage import color
def get_cell_tree(cell_images):
L_vector = [np.mean(im[:,:,0]) for i... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.