id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4987476
from gfpgan import GFPGANer from realesrgan import RealESRGANer import torch # bg_upsampler = RealESRGANer( # scale=2, # model_path='https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth', # tile=400, # tile_pad=10, # pre_pad=0, # half=True) model = GFPGANer( ...
StarcoderdataPython
8009051
import numpy as np np_arr = np.array([[1,2], [6,8]]) print(np_arr) np_arr_insert = np.insert(arr = np_arr , obj = 1 , values = [3,4] , axis = 0 ) print(np_arr_insert) np_arr_append = np.append(arr = np_arr , values = [[3,4], [1,2]]) print(np_arr_append) np_arr_delete = np.delete(arr = np_arr , obj = 1 , axis = 1) p...
StarcoderdataPython
4903505
<reponame>neotje/PyBluetoothctl<filename>src/bluetoothctl/__init__.py from bluetoothctl.classes import BluetoothCtl, BLdevice
StarcoderdataPython
72914
import argparse from .shared import glob_paths, print_utf8, has_magic import glob import os import sys from . import chunks import math from itertools import count def tabulate(lens, rows, columns): data = [] sizes = [] for chunk in chunks(lens, rows): size = max(chunk) + 1 si...
StarcoderdataPython
11387389
<reponame>Mikuana/oops_fhir from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet from oops_fhir.r4.code_system.encounter_status import ( EncounterStatus as EncounterStatus_, ) __all__ = ["EncounterStatus"] _resource = _ValueSet.parse_file(Pat...
StarcoderdataPython
8056683
# Get Two Integers from the user and print the greater value among them.
StarcoderdataPython
1657183
''' EvolvePy's integration with Unity's ML Agents (https://github.com/Unity-Technologies/ml-agents). ''' from .unity import UnityFitnessFunction
StarcoderdataPython
3463572
<filename>service_info_cms/migrations/0002_pagerating_ratingextension.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0012_auto_20150607_2207'), ('service_info_cms', '0001...
StarcoderdataPython
3367158
<gh_stars>1-10 from paramiko.client import SSHClient, AutoAddPolicy from core.logger.Logger import Logger class SSHTarget: def __init__(self, host, port=22, timeout=10): self.host = host self.port = int(port) self.timeout = timeout self.ssh_client = SSHClient() self.ssh_...
StarcoderdataPython
3311587
15 uid=2057284 20 ctime=1290656304 20 atime=1292623534 24 SCHILY.dev=234881026 23 SCHILY.ino=25871146 18 SCHILY.nlink=1
StarcoderdataPython
3549012
#!/usr/bin/env python # -*- coding: UTF-8 -*- import sys import os here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(here, os.pardir)) from project_name.main import run_server run_server()
StarcoderdataPython
127331
<reponame>inuradz/Advent-of-code-2018 import sys num = 0 for line in sys.stdin: num += int(line.rstrip()) print(num)
StarcoderdataPython
6529505
#!/usr/bin/python import sqlite3 conn = sqlite3.connect('esp32.db') print ("Opened database successfully") conn.execute('''CREATE TABLE SENSOR (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT NOT NULL, DATA INT NOT NULL);''') print ("Table created successf...
StarcoderdataPython
11247737
<gh_stars>1-10 from IQNewsClipThread import IQNewsClipThread as Scraper if __name__ == '__main__': with open('config/sources.csv', 'r', encoding='utf-8-sig') as f: sources = [source.strip() for source in f.readlines()] with open('config/symbols.csv', 'r', encoding='utf-8-sig') as f: keys = [sy...
StarcoderdataPython
8167966
""" Test the pipeline module. """ from distutils.version import LooseVersion from tempfile import mkdtemp import shutil import time import pytest import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import as...
StarcoderdataPython
6610546
from PyQt5 import QtWidgets, QtCore, QtGui import numpy as np import cv2 from PIL import ImageGrab import platform platform_name = platform.system() isMac = platform_name == 'Darwin' if isMac: from MacCapture import cartesian_capture else: import tkinter as tk WINDOW_WIDTH = 600 WINDOW_HEIGHT = 400 IMG_FILE_NA...
StarcoderdataPython
8160363
<filename>tornado_server/router.py #!/usr/bin/python3 from tornado.web import Application from handlers import * settings = { "cookie_secret": "__TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__" } import defaults from tinydb import TinyDB, Query cache = TinyDB(defaults.CACHE_FILE) import database db = database.Datab...
StarcoderdataPython
200086
<reponame>FullFact/python-batchmailchimp<filename>batch_mailchimp/batch_operations.py<gh_stars>0 from mailchimp3.entities.batchoperations import \ BatchOperations as OriginalBatchOperations class BatchOperations(OriginalBatchOperations): def create(self, data): if type(data) is dict: batch...
StarcoderdataPython
6556968
<gh_stars>0 import os from PIL import Image import torch import torchvision.transforms as tf from torchvision.datasets import CIFAR10 import torch from torchvision.transforms import transforms def cifar10n(transform=None): if transform is None: transform = tf.ToTensor() cifar10 = CIFAR10('./data/cifar...
StarcoderdataPython
1949936
<reponame>tuming1990/tf-pdnn # Copyright 2013 <NAME> Carnegie Mellon University # 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 # # THIS C...
StarcoderdataPython
11232234
<filename>gask/utils/gcommands.py from .gobjects import GGask, GTimeEntry, GUser, GProject, GThread, GIssue import json def build_me_profile(session, url): req = session.get(url + '/me/') profile_ = json.loads(req.text) profile = GUser(data=profile_) req = session.get(url + '/me/?last_entry=true&') ...
StarcoderdataPython
11367694
<gh_stars>1-10 import glob import argparse #import lsst.eotest.sensor as sensorTest from ultraflatstask import UltraFlatsTask from os.path import join sensor_id = 'ITL-3800c-090' in_file_path = '/nfs/slac/g/ki/ki19/lsst/elp25/S11/ultratask/' infiles = glob.glob(join(in_file_path, '00*.fits')) #bias = glob.glob(join(...
StarcoderdataPython
5058559
import os CONFIDENTIALITY_MAP = { "public": "green", "restricted": "yellow", "non-public": "red", } def get_confidentiality(dataset): return CONFIDENTIALITY_MAP[dataset["accessRights"]] def getenv(name): """Return the environment variable named `name`, or raise OSError if unset.""" env = os...
StarcoderdataPython
6429767
''' Created on 30.01.2020 @author: JM ''' from PyTrinamic.ic.TMC5161.TMC5161_register import TMC5161_register from PyTrinamic.ic.TMC5161.TMC5161_register_variant import TMC5161_register_variant from PyTrinamic.ic.TMC5161.TMC5161_fields import TMC5161_fields from PyTrinamic.helpers import TMC_helpers class TMC5161():...
StarcoderdataPython
233051
<filename>847. Shortest Path Visiting All Nodes/847. Shortest Path Visiting All Nodes.py class Solution: def shortestPathLength(self, graph): def dp(node, mask): state = (node, mask) if state in cache: return cache[state] if mask & (mask - 1) == 0: ...
StarcoderdataPython
4956453
<filename>14_Day_Higher_order_functions/exercises/7.py countries = ['Estonia', 'Finland', 'Sweden', 'Denmark', 'Norway', 'Iceland'] def upper_countries(country): return country.upper() countries_upper = map(upper_countries, countries) print(list(countries_upper))
StarcoderdataPython
6436116
""" Block for testing variously scoped XBlock fields. """ import json from webob import Response from xblock.core import XBlock, Scope from xblock import fields class UserStateTestBlock(XBlock): """ Block for testing variously scoped XBlock fields. """ BLOCK_TYPE = "user-state-test" has_score = ...
StarcoderdataPython
59338
<gh_stars>0 from base_models.densenet import DenseNet from base_models.resnet import ResNet from base_models.vgg import VGG from base_models.xception import Xception from base_models.mobilenet import MobileNet from base_models.vovnet import VovNet from base_models.vovnet_shortcut import VovNet_shortcut from base_models...
StarcoderdataPython
1784620
import click from Bio import SeqIO from Bio.Seq import Seq from .CAI import CAI @click.command() @click.option( "-s", "--sequence", type=click.Path(exists=True, dir_okay=False), help="The sequence to calculate the CAI for.", required=True, ) @click.option( "-r", "--reference", type=cli...
StarcoderdataPython
9687548
#!/usr/bin/env python import os import unittest import uuid import manifest import plow.client def launch_test_job(name): """ struct JobSpecT { 1:string name, 2:string project, 3:bool paused, 4:string username, 5:i32 uid, 6:string logPath 7:list<LayerSpecT> layers, 8:list<Depen...
StarcoderdataPython
5185862
<filename>Python/Polyval/Polyval.py<gh_stars>0 import numpy as np print(np.polyval(list(map(float,input().split())), int(input())))
StarcoderdataPython
1932559
<reponame>LittleBai0606/TeachingSecretarySystem<filename>TSSystem/apps/srtp_project/migrations/0018_auto_20180608_0921.py # Generated by Django 2.0.5 on 2018-06-08 09:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('srtp_project', '0017_auto_20180607_...
StarcoderdataPython
8097331
<reponame>uzairAK/serverom-panel<gh_stars>0 # -*- coding: utf-8 -*- from .cloudManager import CloudManager import json from loginSystem.models import Administrator from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging from django.views.decorators.csrf import csrf_exempt @csrf_exempt def router(re...
StarcoderdataPython
3443393
import re text_to_search = ''' abcdefghijklmnopqurtuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 Ha HaHa MetaCharacters (Need to be escaped): . ^ $ * + ? { } [ ] \ | ( ) dazeofthewolf.com 321-555-4321 123.555.1234 123*555*1234 800-555-1234 900-555-1234 Mr. Darklord Mr Smith Ms Dana Mrs. Robinson Mr. T ''' sentenc...
StarcoderdataPython
3351665
import os import sys sys.path.insert(0, os.path.abspath("..")) project = "python-chi" copyright = "2021, University of Chicago" author = "<NAME>" version = "0.1" release = "0.1" extensions = [ "nbsphinx", "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.napoleon", "sphinx.ext.viewcode...
StarcoderdataPython
4808201
import cv2, time video=cv2.VideoCapture(0) a=1 while True: a=a+1 check, frame = video.read() print(check) print(frame) gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) #time.sleep(3) cv2.imshow("Capturing", gray) #key=cv2.waitKey(1000) # 1 second intevals key=cv2.waitKey(1) #...
StarcoderdataPython
1664282
<reponame>havenmoney/platform-clients<gh_stars>0 import haven from haven.authed_api_client import AuthedApiClient from datetime import datetime from dateutil.tz import tzutc def main(): config = haven.Configuration(host="https://haven.dev/api") api = haven.DefaultApi(AuthedApiClient( id="YOUR_ID_HERE...
StarcoderdataPython
318235
# DESCRIPTION # Given a non-negative integer num represented as a string, # remove k digits from the number so that the new number is the smallest possible. # Note: # The length of num is less than 10002 and will be ≥ k. # The given num does not contain any leading zero. # EXAMPLE 1: # Input: num = "1432219", k = 3 # ...
StarcoderdataPython
8121060
<gh_stars>0 from typing import Dict, Optional, List #, String# helps enforce typing import random import numpy as np from fastapi import APIRouter import joblib import pandas as pd from pydantic import BaseModel, Field, validator, Json # import spacy # from sklearn.feature_extraction.text import TfidfVectorizer # impor...
StarcoderdataPython
1967157
import json import math import mmh3 import os import sys import time import numpy as np import pandas as pd import pyspark.sql.functions as F import toposort from pyspark.sql import Row as SparkRow from pyspark.sql import SparkSession, Window from pyspark.sql.types import * from objects.resource import Resource from ...
StarcoderdataPython
1870945
import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F from convgru import ConvGRUCell from gen_models import make_conv_net, make_fc_net, make_upconv_net import numpy as np from numpy import pi from numpy import log as np_log log_2pi = np_log(2*pi) LOG_COV_MAX = 0 LOG_...
StarcoderdataPython
11267869
from sources.experiments.experiment_metadata_provider_utils import ExperimentMetadataProvider from sources.flwr.flwr_servers.early_stopping_server import DEFAULT_NUM_ROUNDS_ABOVE_TARGET GB_NORM_EXPERIMENTS_FIXED_METADATA_C10 = { "num_clients": 100, "num_rounds": 2500, "clients_per_round": 10, "batch_si...
StarcoderdataPython
11371358
<filename>main.py from flask import Flask,request,render_template,jsonify from flask_restful import Resource,Api app = Flask(__name__) api = Api(app) @app.route('/') def index(): return render_template("index.html") class Student(Resource): def get(self): return [{"rollNo":101,"name":"<NAME>"},{"rollNo":123,"n...
StarcoderdataPython
3298189
<gh_stars>1-10 import os import webapp2 import jinja2 from google.appengine.ext import ndb from google.appengine.api import users import logging,json from contact import Contact class APIRouterHandler(webapp2.RequestHandler): def get(self): url_route = self.request.uri url_routes = url_route.split(...
StarcoderdataPython
11311607
try: from sentry_sdk import capture_exception except ImportError: def capture_exception() -> None: pass
StarcoderdataPython
3401767
from ast import literal_eval as make_tuple from django.db import models from django.core.exceptions import ValidationError from distributed.protocol.serialize import serialize, deserialize class DaskSerializedField(models.Field): description = 'A field the automatically serializes and deserializes using Dask ser...
StarcoderdataPython
191317
""" Default feature encoding functions and pipelines for automated feature transformation. """ from sklearn.pipeline import Pipeline from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction import DictVectorizer from skl...
StarcoderdataPython
11259645
<reponame>AurelienLourot/charm-helpers import unittest from mock import call, patch import yaml import tools.charm_helpers_sync.charm_helpers_sync as sync import six if not six.PY3: builtin_open = '__builtin__.open' else: builtin_open = 'builtins.open' INCLUDE = """ include: - core - contrib.opensta...
StarcoderdataPython
4914872
from library.telegram.base import RequestContext from telethon import events from .base import BaseHandler class StopHandler(BaseHandler): filter = events.NewMessage(incoming=True, pattern='^/stop$') async def handler(self, event: events.ChatAction, request_context: RequestContext): request_context....
StarcoderdataPython
3247092
import os import numpy as np import torch from torch.utils.data import Dataset, DataLoader from morgana import utils from tts_data_tools import file_io from tts_data_tools.utils import get_file_ids TO_TORCH_DTYPE = { np.dtype('float16'): torch.float16, np.dtype('float32'): torch.float32, np.dtype('floa...
StarcoderdataPython
6441533
from __future__ import print_function, division from ngraph.frontends.caffe2.c2_importer.importer import C2Importer import ngraph.transformers as ngt import ngraph.frontends.common.utils as util from caffe2.python import core, workspace import numpy as np def linear_regression(iter_num, lrate, gamma, step_size, noise...
StarcoderdataPython
21444
<filename>MilightWifiBridge/MilightWifiBridge.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Milight 3.0 (LimitlessLED Wifi Bridge v6.0) library: Control wireless lights (Milight 3.0) with Wifi Note that this library was tested with Milight Wifi iBox v1 and RGBW lights. It should work with any ot...
StarcoderdataPython
1785868
<gh_stars>0 def find_top_confirmed(n = 15): import pandas as pd corona_df=pd.read_csv("dataset2.csv") by_country = corona_df.groupby('Country_Region').sum()[['Confirmed', 'Deaths', 'Recovered', 'Active']] cdf = by_country.nlargest(n, 'Confirmed')[['Confirmed']] return cdf cdf=find_top_confirme...
StarcoderdataPython
5189725
<gh_stars>0 #!/usr/bin/python # Grab data from the current cost envi in the lounge room import time import pycurrentcost from prometheus_client import CollectorRegistry, Gauge, push_to_gateway sensor_map = { '0': 'all', '1': 'fridge_kitchen', '3': 'freezer_laundry', '6': 'fridge_laundry', } def ...
StarcoderdataPython
9721876
import cv2 print ("package improted") print('Opencv version {0}'.format(cv2.__version__)) path = 'Resources/' # reading and showing images that stored in current project folder Resources img = cv2.imread("Resources/base.jpeg") # imread second argument could be cv2.IMREAD_COLOR, cv2.IMREAD_COLOR, cv2.IMREAD_UNCHANGE...
StarcoderdataPython
1932802
# Copyright 2019 Adobe. All rights reserved. # This file is licensed to you 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 ...
StarcoderdataPython
5026895
#!/usr/bin/env python3.5 # 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 #...
StarcoderdataPython
1809773
<filename>metakernel/_metakernel.py from __future__ import print_function import base64 import codecs import glob import importlib import inspect import json import logging import os import pkgutil import subprocess from subprocess import CalledProcessError import sys import warnings from collections import OrderedDic...
StarcoderdataPython
3526645
# -*- coding: utf-8 -*- from io import open from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) with open(path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() setup( name="taqu", version="1.0.0", description="Taqu Task Queue syste...
StarcoderdataPython
178507
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-13 20:17 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vacs', '0012_auto_20170711_0616'), ] oper...
StarcoderdataPython
1841288
import torch import torch.nn as nn import torch.optim as optim from sklearn.model_selection import train_test_split from sklearn.svm import SVC import numpy as np from collections import defaultdict class EasyDict(dict): __getattr__ = dict.get __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ ...
StarcoderdataPython
6511901
<reponame>face-pass/KAO-PASS-backend import os config = { 'host': os.environ['HOST'], 'port': int(os.environ['PORT']), 'user': os.environ['USER'], 'password': os.environ['<PASSWORD>'], 'database': os.environ['DB'], 'ssl': {'ssl': {'ca': os.environ['SSL']} } }
StarcoderdataPython
3286856
# I am a module package (for mutexcntl) # Note that my parent dir (Errata) doesn't need a __init__.py, # nor does Errata need to be on PYTHONPATH -- it's the home # dir ('.') of the cgi script invoked on browse/submit requests, # so module/package searches start there automatically; but # if mutexcntl is ever used...
StarcoderdataPython
4942968
<filename>eosim/gui/mainapplication.py<gh_stars>0 import tkinter as tk from tkinter import ttk from .welcomeframe import WelcomeFrame from .configure.cfframe import ConfigureFrame from .executeframe import ExecuteFrame from .visualize.visualizeframe import VisualizeFrame from .operations.operationsframe import Opera...
StarcoderdataPython
5052909
<reponame>aldanor/skggm<gh_stars>100-1000 from __future__ import print_function import sys from setuptools import setup from distutils.extension import Extension from Cython.Build import cythonize import platform try: import numpy # NOQA except ImportError: print('numpy is required during installation') ...
StarcoderdataPython
328899
# spaceconfig = {"usemodules" : ["unicodedata"]} import ast import warnings def test_error_unknown_code(): def fn(): f'{1000:j}' exc_info = raises(ValueError, fn) assert str(exc_info.value).startswith("Unknown format code") def test_ast_lineno_and_col_offset(): m = ast.parse("\nf'a{x}bc{y}de'"...
StarcoderdataPython
8161751
<reponame>donsheehy/dsviz<gh_stars>1-10 from ds2viz.primitives import * styledefaults = {'radius': 3, 'fill': (1,1,1), 'stroke': (0,0,0), 'stroke_width' : 0, 'font_size': 24, 'font_family' : 'monospace', 'font_weight'...
StarcoderdataPython
1744421
"""Solon decorators""" import logging import pylons from decorator import decorator from pylons.controllers.util import abort from tw2.core import ValidationError log = logging.getLogger(__name__) def in_group(group): """Requires a user to be logged in, and the group specified""" def wrapper(func, *args, **k...
StarcoderdataPython
376798
<reponame>znerol/spreadflow-delta from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from testtools import TestCase from spreadflow_delta.proc import Filter, Extractor class SpreadflowDeltaTestCase(TestCase): pass
StarcoderdataPython
11304700
<filename>apple/tvos.bzl # Copyright 2019 The Bazel 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 ...
StarcoderdataPython
9780493
"""Extract labeling data from the question labeling HITs. See ``python extractlabels.py --help`` for more information. """ import ast import collections import json import logging import click from scripts import _utils logger = logging.getLogger(__name__) # constants EXPECTED_NUM_LABELS = 3 KEY_SCHEMA = { ...
StarcoderdataPython
3301848
<reponame>howawong/legco-api-server import datetime from haystack import indexes from .models import Party, MeetingSpeech, Question class PartyIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True) name_en = indexes.CharField(model_attr='name_en') name_ch = indexes.CharFiel...
StarcoderdataPython
1931474
<reponame>pykit3/k3num<gh_stars>0 import unittest import doctest import k3num def load_tests(loader, tests, ignore): tests.addTests(doctest.DocTestSuite(k3num)) return tests
StarcoderdataPython
1949990
<filename>python/GPIO.py #! /usr/bin/env python3 import enum import PyQt5 import PyQt5.QtCore class GPIODirection(enum.Enum): INPUT = 0 OUTPUT = 1 BIDIRECTIONAL = 2 ALTERNATE = 3 class GPIOState(enum.Enum): OFF = 0 ON = 1 class GPIO(PyQt5.QtCore.QObject): """ Container class for...
StarcoderdataPython
5087375
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/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-based ...
StarcoderdataPython
262503
<filename>mkt/monolith/urls.py<gh_stars>0 from django.conf.urls import include, patterns, url from tastypie.api import Api from .resources import MonolithData api = Api(api_name='monolith') api.register(MonolithData()) urlpatterns = patterns('', url(r'^', include(api.urls)), )
StarcoderdataPython
11200115
<gh_stars>0 import logging import time from pydantic import HttpUrl from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.firefox.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.com...
StarcoderdataPython
9614593
<gh_stars>0 # Generated by Django 2.2.5 on 2020-10-31 15:59 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('contents', '0001_initial'), ] operations = [ migrations.AlterField( model_name='goo...
StarcoderdataPython
9777513
#!/usr/bin/env python import glob import json import soundfile as sf from soundfile import SoundFile def convert_flac_to_wav(wav_path: str) -> None: """ Convert a .flac speech file to .wav file Parameters ----------- :params wav_path: Path to the flac file Notes ...
StarcoderdataPython
6570823
from db import db from db import db import datetime import logging from pymongo import DESCENDING from biliob_tracer.task import ProgressTask coll = db['author'] # 获得collection的句柄 logging.basicConfig(level=logging.INFO, format='[%(asctime)s] %(levelname)s @ %(name)s: %(message)s') logger = logging...
StarcoderdataPython
3422602
<reponame>mikekeda/tools from django.contrib.auth import get_user_model from django.test import TestCase User = get_user_model() class BaseTestCase(TestCase): test_user = None test_admin = None @classmethod def setUpClass(cls): super().setUpClass() # Create usual user. cls.pa...
StarcoderdataPython
239449
<filename>Probability Statistics Beginner/Linear regression-15.py ## 2. Drawing lines ## import matplotlib.pyplot as plt import numpy as np x = [0, 1, 2, 3, 4, 5] # Going by our formula, every y value at a position is the same as the x-value in the same position. # We could write y = x, but let's write them all out t...
StarcoderdataPython
6563655
from rest_framework import serializers from core.models import * class DiscountCouponSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = DiscountCoupon fields = ('discount_type', 'value', 'expiration_date', 'course') class SmallCourseSerializer(serializers.ModelSerializer): ...
StarcoderdataPython
243145
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Jan 13 20:53:10 2021 PycaretとStreamlitで作るGUI AutoML """ # streamlit run filename import streamlit as st import pandas as pd import datetime st.markdown("# 1. データをアップロードします") uploaded_file = st.file_uploader("CSVファイルをアップロードしてください", type='csv', key='train') if up...
StarcoderdataPython
6498763
<filename>spinoffs/oryx/oryx/util/summary_test.py # Copyright 2020 The TensorFlow Probability Authors. # # 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...
StarcoderdataPython
4897509
<reponame>maykinmedia/bluebottle<filename>bluebottle/bb_fundraisers/urls/api.py from django.conf.urls import patterns, url from ..views import FundraiserListView, FundraiserDetailView urlpatterns = patterns('', url(r'^$', FundraiserListView.as_view(), name='fundraiser-list'), url(r'(?P<pk>[\d]+)$', Fundraise...
StarcoderdataPython
4926306
<gh_stars>0 # Copyright 2016, Tresys Technology, LLC # # This file is part of SETools. # # SETools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 2.1 of # the License, or (at your option...
StarcoderdataPython
3299159
<gh_stars>1-10 # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyBiomFormat(PythonPackage): """The BIOM file format (canonically pronounce...
StarcoderdataPython
1690921
"""Utilities for deriving new names from existing names. Style objects are used to customize how :ref:`storable objects are found for DataSet objects <using-loadable-fixture-style>` """ __all__ = [ 'CamelAndUndersStyle', 'TrimmedNameStyle', 'NamedDataStyle', 'PaddedNameStyle', 'ChainedStyle'] class Style(o...
StarcoderdataPython
1660095
<reponame>LCS2-IIITD/Code-mixed-classification<gh_stars>0 from __future__ import absolute_import import sys import os sys.path.append('./drive/My Drive/CMC/') # In[7]: get_ipython().system('wandb login') # In[2]: from __future__ import absolute_import import sys import os import shutil try: from dotenv...
StarcoderdataPython
3300178
from mundiapi.mundiapi_client import MundiapiClient from mundiapi.models import * from mundiapi.controllers import * from mundiapi.exceptions.error_exception import * MundiapiClient.config.basic_auth_user_name = "YOUR_SECRET_KEY:" charges_controller = charges_controller.ChargesController() chargeId = "ch_8YQ1JeTLzF8z...
StarcoderdataPython
5000675
<reponame>UmaTaru/run """ This file allows multiple jobs to be run on a server. After each job, an email is sent to notify desired people of its completion. Must specify a text job file that contains the names and commands for each job. Each job has 4 lines, containing: 1) the name, 2) the comma...
StarcoderdataPython
4826012
import socket import uuid ENCODING_FORMAT = 'UTF-8' def get_hostname(): return socket.gethostname() def get_ip(): return socket.gethostbyname(get_hostname()) def get_uuid(): return uuid.uuid1().hex def get_rand_name(): return get_ip() + "_" + get_uuid()[:6] def is_ip(ip_str): return True ...
StarcoderdataPython
3540934
from __future__ import absolute_import, print_function import signal import sys from multiprocessing import cpu_count import click from sentry.runner.decorators import configuration, log_options from sentry.bgtasks.api import managed_bgtasks class AddressParamType(click.ParamType): name = "address" def __...
StarcoderdataPython
1899635
<reponame>Iwan-Zotow/runEGS # -*- coding: utf-8 -*- import math import logging import numpy as np import phandim EPS = 1.0e-4 def invariant(shot, the_range, steps, nr): """ Check phantom parameters Parameters ---------- shot: float shot position, mm the_...
StarcoderdataPython
1184
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2021 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
StarcoderdataPython
342695
<gh_stars>0 from Bot.models import TelegramUser from Profile.models import Profile from ..bot import TelegramBot from .BotComponent import ReplyKeyboardHome from Bot.BotSetting import ChannelName # Home def go_home(chat_id, bot: TelegramBot): message = "صفحه اول " \ "🏠" bot.sendMessage(chat_id...
StarcoderdataPython
288055
class OslotsFeature(object): def __init__(self, api, metaData, data): self.api = api self.meta = metaData self.data = data[0] self.maxSlot = data[1] self.maxNode = data[2] def items(self): maxSlot = self.maxSlot data = self.data maxNode = self...
StarcoderdataPython
8126306
import asyncio import logging import os import json import rustsgxgen from .base import Module from ..nodes import NativeNode from .. import tools from .. import glob from ..crypto import Encryption from ..dumpers import * from ..loaders import * from ..manager import get_manager BUILD_APP = "cargo build {} {} --man...
StarcoderdataPython
9788753
import argparse parser = None if not parser: parser = argparse.ArgumentParser() parser.add_argument('--nodeos-ip', metavar='', help="Ip address of nodeos ", default='127.0.0.1', dest="nodeos_ip") parser.add_argument('--keosd-ip', metavar='', help="Ip address of keosd", default='127.0.0.1', dest="keosd_ip"...
StarcoderdataPython