id stringlengths 1 265 | text stringlengths 6 5.19M | dataset_id stringclasses 7
values |
|---|---|---|
3374230 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import getopt
import hashlib
import json
import re
import socket
import socketserver
import sqlite3
import struct
import sys
import threading
from flask import Flask, jsonify, request
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__)
auth = HTTPB... | StarcoderdataPython |
1718045 | from datetime import datetime
from cacahuate.jsontypes import MultiFormDict, Map
DATE_FIELDS = [
'started_at',
'finished_at',
]
def make_context(execution_data, config):
''' the proper and only way to get the ``'values'`` key out of
an execution document from mongo. It takes care of the transformati... | StarcoderdataPython |
3233622 | <gh_stars>1-10
from __future__ import annotations
from corkus.objects.base import CorkusBase
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from .ingredient import Ingredient
class PartialIngredient(CorkusBase):
"""Represents a ``Partial`` version of :py:class:`Ingredient`."""
@property
... | StarcoderdataPython |
3350240 | import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
from flask import Flask, jsonify
#################################################
# Database Setup
#########################... | StarcoderdataPython |
1773157 | from BribeNet.graph.ratingMethod import RatingMethod
from BribeNet.gui.apps.temporal.wizard.rating_methods.rating_method_frame import RatingMethodFrame
class WeightedMedianPRating(RatingMethodFrame):
enum_value = RatingMethod.WEIGHTED_MEDIAN_P_RATING
name = 'weighted_median_p_rating'
| StarcoderdataPython |
41887 | <reponame>fujitatomoya/rosidl_runtime_py
# Copyright 2019 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-... | StarcoderdataPython |
1642839 | <filename>data_cleaning_formatting/select_rand_image.py
## <NAME>
## This python script seelct random tiles from each slide
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import os
import cv2
import numpy as np
import random
import shutil
# %%
mydir="/project/umb_kourosh... | StarcoderdataPython |
3373751 | <reponame>zealoussnow/chromium
# Copyright 2019 The Chromium 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 re
"""Presubmit for build/util"""
USE_PYTHON3 = True
def _GetFilesToSkip(input_api):
files_to_skip = []
affecte... | StarcoderdataPython |
1731931 |
import os, datetime, requests
import tensorflow as tf
from sklearn.model_selection import train_test_split as sk_train_test_split
import matplotlib.pyplot as plt
import numpy as np
from .datagen import DataGen
def train_test_split(ids):
IDs_train, IDs_test = sk_train_test_split(ids, train_size=0.75)
return ... | StarcoderdataPython |
3382306 | # Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.
# 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 ... | StarcoderdataPython |
143134 | from base import app,c
import unittest
class baseTestCase(unittest.TestCase):
email = 'email@<EMAIL>'
password = 'password'
admin = '/admin'
login = '/login'
logout = '/logout'
def setUp(self):
'''Setup test variables and remove form CSRF for easy submission'''
app.testing = T... | StarcoderdataPython |
3231718 | <filename>modules/chatbridge/__init__.py
from . import chatbridge
def setup(bot):
bot.add_cog(chatbridge.ChatBridge(bot))
def config(bot):
config_template = {server: {"lta_server_address": ""} for server in bot.servers}
config_template["litebot_token"] = ""
return config_template | StarcoderdataPython |
1651001 | """Copyright (c) 2020 AIT Lab, ETH Zurich
Students and holders of copies of this code, accompanying datasets,
and documentation, are not allowed to copy, distribute or modify
any of the mentioned materials beyond the scope and duration of the
Machine Perception course projects.
That is, no partial/full copy nor modif... | StarcoderdataPython |
1615697 | <gh_stars>0
# -*- coding: utf-8 -*-
import numpy as np
from . import flags
from .atom import Atom
from .fields import ATOMIC_FIELDS, READONLY
from .fields import wrapGetMethod, wrapSetMethod
from .pointer import AtomPointer
from prody import LOGGER
__all__ = ['AtomSubset']
class AtomSubset(AtomPointer):
"""A c... | StarcoderdataPython |
4805404 | """Polynomials
Author: <NAME>
Thanks to:
www.wikipedia.org for polynomial division
https://en.wikipedia.org/wiki/Synthetic_division#Python_implementation
www.1728.org for root of cubic and quartic functions:
http://www.1728.org/cubic2.htm, http://www.1728.org/quartic2.htm
www.danielhomola.com for newton's method
http:/... | StarcoderdataPython |
1782833 | <reponame>suryamp97/Simple-PUB-SUB-System-with-Python---Dockerized
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template, jsonify
import mysql.connector
import tweepy
import smtplib
from flask_mail import Mail, Message
app = Flask(__name__)
app.config['MAIL_SERVER']='smtp.gmail.co... | StarcoderdataPython |
65136 | import numpy as np
from quickndirtybot.strategies.util import moving_fun
def measure(dataframe, smaperiod, minmaxperiod):
"""measure things on dataframe
smaperiod
period in minutes of moving average
minmaxperiod
period to calculate the minimum/maximum over, in minutes
"""
# get del... | StarcoderdataPython |
4838819 | import paramiko
from getpass import getpass
import time
ip_addr = '192.168.127.12'
username = 'pyclass'
password = '<PASSWORD>'
port = 8022
remote_conn_pre=paramiko.SSHClient()
remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
remote_conn_pre.connect(ip_addr, username=username, password=password, ... | StarcoderdataPython |
3371174 | <reponame>cyphix/cynodeeditor<filename>src/debug.py
# pylint: disable=missing-docstring
# pylint: disable=no-name-in-module
from __future__ import generator_stop
from __future__ import annotations
from PyQt5.QtGui import QColor, QPalette
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt
fr... | StarcoderdataPython |
3335799 | <gh_stars>0
import os
import random
import click
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import Delaunay
@click.command()
@click.option(
'-s', '--seed',
type=click.INT,
default=None, show_default=True,
help='the seed of the random number generator'
)
@click.option(
... | StarcoderdataPython |
1762641 | import streamlit as st
# Page Configuration
st.set_page_config(page_title="Carbonify Tool",page_icon="🌎",layout="wide",initial_sidebar_state="expanded")
from carbonify import BaseCarbone
#------------------------------------------------------------------------------------------
# PARAMETERS
#----------------------... | StarcoderdataPython |
1670466 | # coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.Grasland import Grasland
from OTLMOW.OTLModel.Datatypes.KlNSB import KlNSB
from OTLMOW.GeometrieArtefact.VlakGeometrie import VlakGeometrie
# Generated with OTLClassCreator. To modify: extend, do not edit
cla... | StarcoderdataPython |
101110 | '''OpenGL extension EXT.color_subtable
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_color_subtable'
_DEPRECATED = False
glColorSubTable... | StarcoderdataPython |
3291726 | from flask import url_for, render_template, request, redirect, session
from darts.app import app
import darts.utils
from darts.models import db, Score_countup, Score_501, Score_cricket
import datetime
@app.route('/ranking', methods=['GET', 'POST'])
def ranking():
ranking_countup_list = darts.utils.get_countup_ran... | StarcoderdataPython |
1656219 | <gh_stars>1-10
#!/usr/bin/env python3
import os
import sys
from openvino.inference_engine import IENetwork, IECore
import cv2
import numpy as np
import time
import socket
import json
import logging as log
import paho.mqtt.client as mqtt
import time
import logging
from argparse import ArgumentParser
from inference imp... | StarcoderdataPython |
66360 | <reponame>mirecl/python-inquirer
import json
import unittest
from blessed import Terminal
from inquirer import themes
from inquirer import errors
class ThemeTests(unittest.TestCase):
def setUp(self):
self.term = Terminal()
self.theme_dict = {
'Question': {
'mark_color... | StarcoderdataPython |
1696912 | <filename>karaoke-maker/backend/vocalremover/vocalremover.py<gh_stars>0
import os
import librosa
import numpy as np
import soundfile as sf
import torch
import tqdm
from threading import Thread
from backend.vocalremover import nets, utils
class VocalRemover(Thread):
def __init__(self,config:dict,file:str):
... | StarcoderdataPython |
1789802 | #coding:utf-8
import sys,os
from PIL import Image,ImageDraw
import pytesseract
#测试代码
def main(image_path):
im=Image.open(image_path)
# print "image info,",im.format,im.mode,im.size
(w,h)=im.size
R=0
G=0
B=0
for x in xrange(w):
for y in xrange(h):
... | StarcoderdataPython |
1750660 | """Unit tests for reviewboard.reviews.ui.base.FileAttachmentReviewUI."""
from djblets.testing.decorators import add_fixtures
from kgb import SpyAgency
from reviewboard.reviews.ui.base import (FileAttachmentReviewUI,
register_ui,
unregis... | StarcoderdataPython |
101980 | <reponame>lmallez/wikidata-tree-generator
#!/usr/bin/env python3
from enum import Enum
wikidata_properties = {
"sex": "P21",
"father": "P22",
"mother": "P25",
"instance_of": "P31",
"child": "P40",
"family": "P53",
"given_name": "P735",
"family_name": "P734",
"date_of_birth": "P569",... | StarcoderdataPython |
3267270 | <gh_stars>0
# Generated by Django 3.2.9 on 2021-11-30 21:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ContractorApp', '0009_profile_user_type'),
]
operations = [
migrations.RenameField(
model_name='profile',
old_na... | StarcoderdataPython |
1794222 | import logging
import pytest
import os
import pandas as pd
import numpy as np
import yaml
import xarray as xr
import xsimlab as xs
from itertools import product
from episimlab.partition import (
Partition as PartitionUsingXR,
ContactsFromCSV,
TravelPatFromCSV,
)
@pytest.fixture
def step_delta():
retur... | StarcoderdataPython |
3387554 | import unittest
import tests.envs as envs
import pykintone
from pykintone.application_settings.administrator import Administrator
import pykintone.application_settings.form_field as ff
from pykintone.application_settings.form import FormAPI
from pykintone.application_settings.view import View
class TestView(unittest.... | StarcoderdataPython |
1794857 | <gh_stars>1-10
"""
Question:
Write a program that calculates and prints the value according to the given formula:
Q = Square root of [(2 * C * D)/H]
Following are the fixed values of C and H:
C is 50. H is 30.
D is the variable whose values should be input to your program in a comma-separated sequence.
Example
Let us ... | StarcoderdataPython |
100446 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path impo... | StarcoderdataPython |
4838457 | # Generated by Django 3.0.7 on 2020-06-29 02:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Clinic_information',
... | StarcoderdataPython |
100220 | '''
Configures logger
'''
import logging
import os
# Delete previous debug log
if os.path.exists("debug.log"):
os.remove("debug.log")
# Initialize logger
FORMAT = '[%(levelname)s] - %(asctime)s: %(message)s'
logging.basicConfig(handlers=[logging.FileHandler(filename='debug.log', encoding='utf-8', mode='a+')],
... | StarcoderdataPython |
1795537 | import numpy as np
import datetime
import pandas
import os
import glob
import h5py
import yaml
from scipy import interpolate
from ttools import utils, config
from ttools.satellite import SATELLITES
OMNI_COLUMNS = (
"rotation_number", "imf_id", "sw_id", "imf_n", "plasma_n", "b_mag", "b_vector_mag", "b_vector_lat_... | StarcoderdataPython |
6103 | <gh_stars>0
import aspose.pydrawing as drawing
import aspose.slides as slides
def charts_multi_category_chart():
#ExStart:MultiCategoryChart
# The path to the documents directory.
outDir = "./examples/out/"
with slides.Presentation() as pres:
slide = pres.slides[0]
ch = pres.slides[0... | StarcoderdataPython |
19083 | #/bin/python3
import numpy as np
from scipy import signal as sig
class pySparSDRCompress():
'''
Implementation of the SparSDR Compressor based on
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>., <NAME>. and <NAME>., 2019, June. Sparsdr: Sparsity-proportional backhaul and compute for sdrs. In Proceedings of ... | StarcoderdataPython |
3246404 | <gh_stars>0
import argparse
import os
import tensorflow as tf
import cv2
from utils import read_json
from utils import read_video
def _bytes_feature(value):
"""Returns a bytes_list from a string / byte."""
return tf.train.Feature(bytes_list=tf.train.BytesList(value=value))
def _int64_feature(value):
""... | StarcoderdataPython |
3279638 | """
Provides middleware to support classic CUL/Apache log format.
For accurate request metrics, apply this middleware before any others.
You should use the following log format when running uWSGI with this
middleware installed:
.. code-block::
%(addr) %(addr) - %(user_id)|%(session_id) [%(rtime)] [%(uagent)] "%(... | StarcoderdataPython |
613 | <reponame>98llm/tir-script-samples
from tir import Webapp
import unittest
class GTPA036E(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelper.Setup("SIGAGTP", "05/08/2020", "T1", "D MG 01 ")
inst.oHelper.Program('GTPA036')
def test_GTPA036E_CT001(self):
... | StarcoderdataPython |
3260925 | <reponame>rdtsc/codeeval-solutions
#!/usr/bin/env python3
import sys
with open(sys.argv[1]) as file:
for line in (line.rstrip() for line in file):
terms = list(map(int, line.split(',')))
termCount = len(terms)
result = 0
for i in range(termCount - 3):
for j in range(i + 1, termCount - 2):
... | StarcoderdataPython |
3215888 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# Copyright (c) 2018 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | StarcoderdataPython |
51584 | <reponame>maisonarmani/Tools_Box
# -*- coding: utf-8 -*-
# Copyright (c) 2015, <EMAIL> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import get_match_cond
@frappe.whitelist()
def employee_query... | StarcoderdataPython |
3390010 | <reponame>liyicong763/Ferproof_for_Python
import random
# Prime number
p = 260978677425009836700364089744760003717
# Generator
g = random.randint(1, p - 1)
class Verifier:
def __init__(self, p, g):
self.p = p
# Generator
self.g = g
# Secret number
self.s = random.randin... | StarcoderdataPython |
77688 | <filename>src/tests/datastructures/test_misc.py
'''
Created on 20/05/2009
@author: Andres
'''
import unittest
from algoritmia.datastructures.misc import RangeSet
class TestRangeSet(unittest.TestCase):
def setUp(self):
self.r1 = RangeSet(0, 10)
self.r2 = RangeSet(11, 20)
self.r3... | StarcoderdataPython |
50242 | <reponame>VP-GEO/cbm<filename>src/ipycbm/sources/rest_api.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : <NAME>, <NAME>
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause B... | StarcoderdataPython |
4838028 | <filename>utils/metrics/num_queries.py<gh_stars>0
# !/usr/bin/env python
# coding=UTF-8
"""
@Author: <NAME>
@LastEditors: <NAME>
@Description:
@Date: 2021-09-22
@LastEditTime: 2021-09-22
基于进行变换数量的 metric,
基于 TextAttack 的 AttackQueries
"""
from typing import NoReturn, Union, Sequence
import numpy as np
from .base im... | StarcoderdataPython |
3344853 | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class CloudfrontDistributionEncryption(BaseResourceCheck):
def __init__(self):
name = "Ensure cloudfront distribution ViewerProtocolPolicy is set to HTTP... | StarcoderdataPython |
43772 | <gh_stars>100-1000
"""
A statement function set holds a set of statement functions that can be used in statements.
"""
class BaseStatementFuncSet(object):
"""
A statement function set holds a set of statement functions that can be used in statements.
"""
def __init__(self):
self.funcs = {}
... | StarcoderdataPython |
3367915 | <gh_stars>100-1000
# coding=utf-8
#
# Copyright (c) 2010-2015 Illumina, Inc.
# All rights reserved.
#
# This file is distributed under the simplified BSD license.
# The full text can be found here (and in LICENSE.txt in the root folder of
# this distribution):
#
# https://github.com/Illumina/licenses/blob/master/Simpli... | StarcoderdataPython |
3349490 | <filename>python-3.4.4.amd64/Lib/idlelib/configSectionNameDialog.py
"""
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
The 'return value' for the dialog, used two placed in configDialog.py,
is the .result attribute set in the Ok and Cance... | StarcoderdataPython |
115788 | <reponame>lefeverd/dbbackup
import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from dbbackup import tempbackupfile
class TestTempbackupfile(unittest.TestCase):
def test_copy_to_destination(self):
with TemporaryDirectory() as tmpdir:
tempfile = tempbackupfile.Temp... | StarcoderdataPython |
123916 | # <NAME>
# BUBBLE SORT IMPLEMENTED IN PYTHON RECURSIVELY.
def bubblesort(arr, n):
# checking if the array does not need to be sorted and has a length of 1.
if n <= 1:
return
# creating a for-loop to iterate for the elements in the array.
for i in range(0, n - 1):
# crea... | StarcoderdataPython |
1682549 | <filename>util/checkpoint.py
import logging
import os
import torch as t
logger = logging.getLogger()
def save_checkpoint(epoch, arch, model, extras=None, is_best=None, name=None, output_dir='.'):
"""Save a pyTorch training checkpoint
Args:
epoch: current epoch number
arch: name of the networ... | StarcoderdataPython |
3339409 | <reponame>dajkatal/SmartGYM
import os
from smartgym.settings import BASE_DIR
print()
print(BASE_DIR)
| StarcoderdataPython |
1673534 | <gh_stars>0
# Copyright The PyTorch Lightning team.
#
# 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... | StarcoderdataPython |
199923 | <filename>lesson10/liyongli/devops/apps/users/urls.py
# -*- coding:utf-8 -*-
# author: lyl
from django.conf.urls import url
from apps.users.views import UserMangerView, UserUpdateView, RoleListView, GroupListView
urlpatterns = [
url(r'^user_list/$', UserMangerView.as_view(), name='user_list'),
url(r'^update_ce... | StarcoderdataPython |
194808 | from Utilities.Database import database_data_line, database_record_logs
from Utilities import configure_functions
from Utilities.helpers import should_skip, detect_change
from shared_types import ConfigType
from typing import Dict
import pymongo
import re
#
# TODO: set MongoDB credentials
#
# specify mong... | StarcoderdataPython |
1608273 | from django.db import router
from .base import Operation
class AddField(Operation):
"""
Adds a field to a model.
"""
def __init__(self, model_name, name, field):
self.model_name = model_name.lower()
self.name = name
self.field = field
def state_forwards(self, app_label, s... | StarcoderdataPython |
3220333 | #!/usr/bin/env python
# Copyright (c) 2014 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Python script to call croutoncycle. This is needed to let the
# hotkeys ctr-shift-alt F1/F2 work when xbmc is in fullscreen.
imp... | StarcoderdataPython |
1786648 | <reponame>bruinxiong/gnerf
from .generator import GNeRF
from .posemodel import InversionNet, PoseParameters
from .discriminator import Discriminator
| StarcoderdataPython |
3217111 |
from moving_averages import ExpMA
from spreads import spread_timeseries | StarcoderdataPython |
3213173 | """Plot the effective area as a function of energy"""
import pyfoxsi
from pyfoxsi.response import STCResponse
import matplotlib.pyplot as plt
resp_q = STCResponse(kind='Q')
resp_f = STCResponse(kind='F')
plt.figure(1)
plt.subplot(121)
resp_q.plot()
plt.plot(resp_q._energies, resp_q._optic_effective_area,
l... | StarcoderdataPython |
3330156 | <reponame>willyh101/live2p
from termcolor import cprint
import threading
class Alert:
alerts = {
'none': '*',
'info': '[INFO]',
'warn': '[WARNING]',
'error': '[ERROR]',
'success': '[INFO]'
}
colors = {
'none': 'white',
'info': 'yellow',
'... | StarcoderdataPython |
1677163 | #/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011-2014, <NAME>
#
# 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 requi... | StarcoderdataPython |
3291455 | <filename>srttools/__init__.py<gh_stars>1-10
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa... | StarcoderdataPython |
119596 | import logging
from datetime import datetime
from banal import is_mapping, ensure_list
from followthemoney import model
from followthemoney.exc import InvalidData
from followthemoney.helpers import remove_checksums
from aleph.logic.collections import index_aggregator, refresh_collection
from aleph.logic.aggregator imp... | StarcoderdataPython |
1689843 | import re,pyperclip
# create phone regex
phoneRegex = re.compile(r'''
( (\d{3}|\(\d{3}\))? # Area code
(\s|-|\.)? # Seperator
(\d{3}) # first 3 digits
(\s|-|\.) # seperator
(\d{4}) # last 3 digits
... | StarcoderdataPython |
1637913 | <reponame>liudengfeng/spaCy<filename>spacy/lang/zh/texsmart/examples/python/02_tag.py
import sys
import os.path
module_dir = os.path.dirname(os.path.realpath(__file__))
sys.path.append(module_dir+'/../../lib/')
from tencent_ai_texsmart import *
options = '{"ner":{"enable":true,"fine_grained":false}}'
print('Creating a... | StarcoderdataPython |
3368715 | import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.spatial import distance
from scipy.optimize import differential_evolution
class IntracellAnalysisV2:
# IA constants
FC_UPPER_VOLTAGE = 4.20
FC_LOWER_VOLTAGE = 2.70
NE_UPPER_VOLTAGE = 0.01
NE_LOWER_VOLTAGE = 1.... | StarcoderdataPython |
24582 | <filename>clot/app.py
"""A simple command-line interface to the clot.torrent package."""
from argparse import ArgumentParser
from os import path, walk
import shutil
from clot import __version__, torrent
def main():
"""Execute actions according to the command-line arguments."""
args = _parse_command_line()
... | StarcoderdataPython |
107308 | """
/***************************************************************************
Plugin Installer module
Plugin version comparison functions
-------------------
Date : 2008-11-24
Copyright : (C) 2008 by <NAME... | StarcoderdataPython |
1668203 | <filename>10808/solution.py
def sol():
S = input()
for i in range(26):
print(S.count(chr(i + 97)), end=' ')
if __name__ == "__main__":
sol()
| StarcoderdataPython |
3239959 | <reponame>jarodvip/oneinstack-backup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class CosErr(object):
"""sdk错误码"""
PARAMS_ERROR = -1 # 参数错误
NETWORK_ERROR = -2 # 网络错误
SERVER_ERROR = -3 # server端返回错误
UNKNOWN_ERROR = -4 # 未知错误
@staticmethod
def get_err_msg(errcode, err_info):
... | StarcoderdataPython |
1668769 | <reponame>emanuele/measure_peaks
"""Code to parse HPLC files, to smooth the signal, to detrend, to
detect peaks and to measure their areas. Moreover, given data from
standards and samples, the mole fraction of each peak is estimated by
comparing with the matching one in the standards.
Copyright 2017 <NAME> and <NAME>.... | StarcoderdataPython |
123567 | import pytube
vid = pytube.YouTube('https://www.youtube.com/watch?v=9bZkp7q19f0')
stream = vid.streams.get_by_itag(251)
stream.download() | StarcoderdataPython |
8885 | <filename>parser/fase2/team19/Analisis_Ascendente/Instrucciones/PLPGSQL/Ifpl.py
import Analisis_Ascendente.Instrucciones.PLPGSQL.EjecutarFuncion as EjecutarFuncion
from Analisis_Ascendente.Instrucciones.PLPGSQL.plasignacion import Plasignacion
from Analisis_Ascendente.Instrucciones.instruccion import Instruccion
fro... | StarcoderdataPython |
90275 | <gh_stars>0
import m5
from m5.objects import *
m5.util.addToPath('learning_gem5/part1/')
#from caches import *
'''
Setting up the System
'''
system = System()
system.clk_domain = SrcClockDomain()
system.clk_domain.clock = '2GHz'
system.clk_domain.voltage_domain = VoltageDomain()
system.mem_mode = 'timing'
sys... | StarcoderdataPython |
3324564 | from .utils import FAKE_UA
from .spiders import Spider
from .config import SimpyderConfig
| StarcoderdataPython |
1613330 | import csv
import numpy
import scipy.interpolate as intp
import ckdtree
class CSVReader:
def __init__(self,file):
print "Reading data..."
csvFile = open(file)
self.data= numpy.loadtxt(csvFile, delimiter=',')
self.coordinate=numpy.delete(self.data, numpy.s_[3:], 1)
def cfdmetric(self,x,y,z):
point=numpy.a... | StarcoderdataPython |
4807739 | <gh_stars>1-10
#!/usr/bin/env python
# Based off of the similar structure from requests:
# https://raw.githubusercontent.com/kennethreitz/requests/v1.2.3/requests/structures.py
import collections
class CaseInsensitiveDict(collections.MutableMapping):
def __init__(self, data=None, **kwargs):
self._store = dict()
... | StarcoderdataPython |
3280468 | <reponame>Monika199211/ga-learner-dst-repo
# --------------
#Header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#Reading of the file
data=pd.read_csv(path)
data.replace(to_replace="-",value="Agender",inplace=True)
sns.countplot(x=data['Gender'])
sns.coun... | StarcoderdataPython |
94454 | import asyncio
import hashlib
import json
import re
import ssl
import websocket
import websockets
class OKCoinWSPublic:
Ticker = None
def __init__(self, pair, verbose):
self.pair = pair
self.verbose = verbose
@asyncio.coroutine
def initialize(self):
TickerFirstRun = True
while True:
i... | StarcoderdataPython |
4839066 | """Functions operating on the PEtab parameter table"""
import numbers
import pandas as pd
import numpy as np
from collections import OrderedDict
from typing import Iterable, Set, List, Tuple, Dict, Union
import libsbml
from . import lint, core, measurements, conditions, observables
from .C import * # noqa: F403
d... | StarcoderdataPython |
4836856 | import json
from typing import Any, Optional
DEFAULT_OPTIMIZER_CONFIG = {
'name' : 'Adam',
'paras': {
'lr' : 1e-3,
'weight_decay': 0.0,
}
}
DEFAULT_LR_SCHEDULER_CONFIG = {
'name' : 'StepLR',
'paras': {
'step_size': 1000,
}
}
DEFAULT_LOGREG_CONFIG = {
}
DEFAU... | StarcoderdataPython |
3277732 | from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from erpfil.auth import login_required
from erpfil import db as database
bp = Blueprint('partner', __name__, url_prefix='/partner')
def partner_defaults():
return {
'title': '... | StarcoderdataPython |
183920 |
# import mysql.connector
# DBHOST = 'localhost'
# DBUSER = 'search_concept'
# DBPASS = '<PASSWORD>'
# DBNAME = 'search_concept'
# def getconn():
# return mysql.connector.connect(
# host=DBHOST,
# user=DBUSER,
# passwd=<PASSWORD>,
# database=DBNAME
# )
SQL_CREATE_TABLE = '''
C... | StarcoderdataPython |
3240080 | <filename>setup.py
from setuptools import setup
setup(
name='Bitcons Notification',
version='1.0',
description='App for getting current value of bitcoins.',
author='<NAME>',
author_email='<EMAIL>',
url='http://bitcoinsnotification-direitabrasil.rhcloud.com/',
install_requires=['pymongo'],
)... | StarcoderdataPython |
1679714 | <gh_stars>1-10
"""
Copyright (c) 2020 The Orbit 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 logging
from core.orbit_e2e import Fragment, find_control
class MoveFunctionsTab(Fragment):
def right_click_move_context(self... | StarcoderdataPython |
167293 | import time
import sys
import os
import platform
import subprocess
if platform.system()=="Linux" :
from os import popen
elif platform.system()=="Windows" :
import winsound
def timemyshit(minutes,seconds):
time_start = time.time()
const=seconds
totaltime=seconds + minutes*60
passedtime=0
while True:
try:
... | StarcoderdataPython |
1624126 | <gh_stars>0
#!/usr/bin/env python3
import sys
from functools import reduce
import operator
import math
import tensorflow as tf
from tensorflow.core.framework import graph_pb2
import numpy
import ml
first = True
paddings = {}
def output(layers, named, op, layer, prev_input=True):
global first
named[op.name] =... | StarcoderdataPython |
1604283 | <gh_stars>0
import time
import adafruit_dht
from board import D2
#initial the dht device
dhtDevice = adafruit_dht.DHT22(D2)
while True:
try:
# show the values to the serial port
temperature = dhtDevice.temperature * (9 / 5) + 32
humidity = dhtDevice.humidity
print("Temp: {:.1f} F H... | StarcoderdataPython |
4831972 | <reponame>strubbi77/python-for-android<filename>pythonforandroid/recipes/xeddsa/__init__.py
from pythonforandroid.recipe import CythonRecipe
from pythonforandroid.toolchain import current_directory, shprint
from os.path import join
import sh
class XedDSARecipe(CythonRecipe):
name = 'xeddsa'
version = '0.4.4'
... | StarcoderdataPython |
68083 | <reponame>dazz22/udacity-into-to-algorithms
# Write a function that takes in a graph
# represented as a list of tuples
# and return a list of nodes that
# you would follow on an Eulerian Tour
#
# For example, if the input graph was
# [(1, 2), (2, 3), (3, 1)]
# A possible Eulerian tour would be [1, 2, 3, 1]
def find_e... | StarcoderdataPython |
1792459 | <filename>setup.py
from setuptools import setup, find_packages
from jocular import __version__
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.md').read_text(encoding='utf-8')
URL = 'https://transpy.eu.pythonanywhere.com/jocular/'
setup(
name='jocular',
vers... | StarcoderdataPython |
141695 | <reponame>deHasara/cylon<filename>python/pycylon/test/test_frame.py
##
# 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 appl... | StarcoderdataPython |
1753576 | <filename>src/DNA.py
from random import random, randint
__all__ = ["DNA"]
# range constraint for the function being optimized
min_i, max_i = -100, +100
k_i = 22 # number of bits for the x and y variables of this problem
# a chromosome is represented by 44 binary digits, with 22 for x and 22 for y
# the convert_to_... | StarcoderdataPython |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.