id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
11279602
<filename>100_days_challenge/days_1-5/day5_practice_adding_even.py # Find the sum of 2-100 even numbers total = 0 for number in range(2, 101, 2): total += number print(total)
StarcoderdataPython
4879402
from danlp.models import load_bert_base_model import numpy as np from data_handler.data_handler import DataHandler from tqdm import tqdm from torch import from_numpy from sklearn.decomposition import PCA #https://www.psycopg.org/docs/cursor.html#cursor-iterable class AlgorithmHandler(DataHandler): def embed...
StarcoderdataPython
1999026
# Simple vanity address generator in python import multiprocessing from time import time from urllib import parse from algosdk import account import algosdk import time import re from multiprocessing import Manager, Process import os import argparse def worker_address_search(i, regexes, q): joined =...
StarcoderdataPython
6643902
<filename>data_managers/data_manager_gatk_picard_index_builder/data_manager/data_manager_gatk_picard_index_builder.py #!/usr/bin/env python # <NAME>. # Uses fasta sorting functions written by <NAME>. import json import optparse import os import shutil import subprocess import sys import tempfile CHUNK_SIZE = 2**20 DE...
StarcoderdataPython
9618065
<reponame>bobbybabra/codeGuild<gh_stars>0 # 1. The parameter weekday is True if it is a weekday, and # the parameter vacation is True if we are on vacation. # We sleep in if it is not a weekday or we're on vacation. # Return True if we sleep in. # # This is the start of the function to get you started. ...
StarcoderdataPython
4976978
"""The main runtime of the MythX CLI.""" import logging import sys from pathlib import Path import click import yaml from pythx import Client, MythXAPIError from pythx.middleware.toolname import ClientToolNameMiddleware from mythx_cli import __version__ from mythx_cli.analysis.list import analysis_list from mythx_cli...
StarcoderdataPython
1603955
class P2PConfiguration: def __init__( self, # TODO: is there better way of specifying these defaults? so some defaults can use others in their calculation? network: bytes = bytes.fromhex("feedbeef"), # Mainnet constant TODO: move to a proper constants file node_id: int = 0, ...
StarcoderdataPython
8089738
a = '/leave' msg = '/coco' if not a in msg: print("nao tem") else: print("tem")
StarcoderdataPython
1721898
from sqlalchemy import create_engine, Table, Column, Integer, String, Boolean, MetaData, select import urlparse DATABASE_NAME = 'data/crawler.sqlite' HTML_DIR = 'data/html/' class CrawlerDb: def __init__(self): self.connected = False def connect(self): self.engine = create_engine('sqlite:///' + DATABASE_NAME...
StarcoderdataPython
3314148
<reponame>kagemeka/atcoder-submissions import sys s = sys.stdin.readline().rstrip() def main(): if s[0] == "A": if "C" in s[2:-1]: cnt = 0 for letter in s: if 65 <= ord(letter) <= 90: cnt += 1 if cnt == 2: ...
StarcoderdataPython
12808555
<reponame>stowage/ctypesgen<gh_stars>0 # -*- coding: us-ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab """ Main loop for ctypesgen. """ import optparse, sys from . import options as core_options from . import parser as core_parser from . import printer_python, printer_json, processor from . import message...
StarcoderdataPython
6486540
# config.py from authomatic.providers import oauth2, oauth1, openid SECRET = "UUID_ALEATOIRE" CONFIG = { 'tw': { # Your internal provider name 'short_name': 1, 'class_': oauth1.Twitter, 'consumer_key': 'MA_CLE_TWITTER', 'consumer_secret': 'MON_SECRET_TWITTER', }, 'fb': {...
StarcoderdataPython
8100509
from flask import request from app import app import ddbb import requests import json import time import string import random def register_user(code): if code == None: return False r = requests.post("https://accounts.spotify.com/api/token", data={ "grant_type": "authorization_code", "...
StarcoderdataPython
1670726
<filename>lsystem/KochCurve3D.py<gh_stars>1-10 from lsystem.LSystem import LSystem import math class KochCurve3D(LSystem): """Fractale courbe de koch en 3D""" def defineParams(self): self.LSName = "Koch curve 3D" self.LSAngle = math.pi / 2 self.LSSegment = 0.01 self.LSSteps = 8 self.LSStartingString = "A"...
StarcoderdataPython
3488145
import os import json import matplotlib.pyplot as plt class Logger(object): def __init__(self, log_dir): self.log_dir = log_dir if not os.path.exists(log_dir): os.makedirs(log_dir) self.data_dict = {} def record(self, *args): assert(len(args)%2 == 0) for i...
StarcoderdataPython
6528242
"""Tests for query and export utility function.""" import sys import logging import unittest from system_query.query import query_and_export _LOG = logging.getLogger(__name__) class Tests(unittest.TestCase): def test_unsupported_scope(self): with self.assertRaises(NotImplementedError): que...
StarcoderdataPython
11307738
import cv2 import mediapipe as mp import socket import numpy as np UDP_IP = "127.0.0.1" UDP_PORT = 5065 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles mp_pose = mp.solutions.pose # hand_down_overlay = cv2.imread('hand_...
StarcoderdataPython
11334288
<gh_stars>0 # Portions copied over from BCBio.GFF.GFFParser import re import copy import collections from six.moves import urllib from gffutils import constants from gffutils.exceptions import AttributeStringError import logging formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') logger = logg...
StarcoderdataPython
5194210
from typing import List import numpy as np import tensorflow as tf import xarray as xr from bioimageio.spec import nodes from bioimageio.spec.utils import get_nn_instance from ._model_adapter import ModelAdapter class TensorflowModelAdapter(ModelAdapter): def __init__(self, *, bioimageio_model: nodes.Model, dev...
StarcoderdataPython
9671477
<filename>QCGym/interpolators/__init__.py from QCGym.interpolators.identity import IdentityInterpolator
StarcoderdataPython
11244896
<gh_stars>10-100 """module to test high-level extract function in hvc.extract""" import os from glob import glob import hvc from hvc.utils import annotation from config import rewrite_config class TestExtract: def test_data_dirs_cbins(self, test_data_dir, tmp_output_dir): # test that calling extract does...
StarcoderdataPython
13451
import os os.system("pip install pytorch_transformers") import nsml print(nsml.DATASET_PATH) os.system('python ./code/train.py --n-labeled 10 --data-path '+ nsml.DATASET_PATH + '/train/ --batch-size 4 --batch-size-u 8 --epochs 20 --val-iteration 1000 --lambda-u 1 --T 0.5 --alpha 16 --mix-layers-set 7 9 12 --lrmain 0.0...
StarcoderdataPython
3242698
#!/usr/bin/env python3 try: from cx_Freeze import setup,Executable has_cx_freeze = True except ImportError: from distutils.core import setup has_cx_freeze = False print('Could not import cx_Freeze. Building executable not possible.') import platform from distutils.extension import Extension from C...
StarcoderdataPython
11262483
<filename>src/train_v2.py from argparse import ArgumentParser, Namespace from engine.main_engine_v2 import MainEngineV2 import importlib import torch import ignite.distributed as idist def run(local_rank, config): pe = MainEngineV2(local_rank, config) pe.train(config.run_params) def main(hyperparams): wi...
StarcoderdataPython
364955
<reponame>wunderio/WunderMachina #!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at ...
StarcoderdataPython
11247689
<reponame>syqu22/django-react-blog from django.test import TestCase from posts.models import Post, Tag from users.models import User class TestModels(TestCase): def setUp(self): self.user = User.objects.create_user( username='test', email='<EMAIL>', password='<PASSWORD>') self.tag1 =...
StarcoderdataPython
96264
from __future__ import absolute_import from textwrap import dedent class UserError(Exception): def __init__(self, msg): self.msg = dedent(msg).strip() def __unicode__(self): return self.msg
StarcoderdataPython
286712
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def weights_init(m): if isinstance(m, (nn.Conv2d, nn.Linear)): nn.init.kaiming_normal_(m.weight) if m.bias is not None: nn.init.constant_(m.bias, 0.0) class Net(nn.Mo...
StarcoderdataPython
128259
<gh_stars>0 class Solution: def XXX(self, nums: List[int]) -> bool: n=len(nums) vis=[0 for _ in range(n)] for i in range(min(nums[0]+1,n)): vis[i]=1 for i in range(1,n-1): if vis[i]: #此位置可以达到 if i+nums[i]>=n-1: return Tr...
StarcoderdataPython
8193047
<gh_stars>100-1000 from __future__ import absolute_import from __future__ import print_function import veriloggen import tmpvar expected_verilog = """ module blinkled # ( parameter WIDTH = 8 ) ( input CLK, input RST, output reg [WIDTH-1:0] LED ); reg [32-1:0] _tmp_0; reg [32-1:0] _tmp_1; w...
StarcoderdataPython
9660018
<gh_stars>1000+ from collections import deque from difflib import get_close_matches from itertools import chain from warnings import warn import theano import numpy as np from .. import utils __all__ = [ "get_all_layers", "get_output", "get_output_shape", "get_all_params", "count_params", "g...
StarcoderdataPython
266114
import os import time import json import logging from six.moves import cPickle import numpy as np import matplotlib.pyplot as plt import matplotlibex.mlplot as plx import ml.gptheano.vecgpdm.enums as enm from ml.gptheano.vecgpdm.equations import list_of_nones from ml.gptheano.vecgpdm.equations import matrix_of_nones im...
StarcoderdataPython
3439301
<reponame>bmacauley/auth0-aws-creds class Auth0AWSCreds(object): def __init__(self): pass
StarcoderdataPython
6422068
import cv2,time,pandas from datetime import datetime first_frame=None status_list=[None,None] times=[] df=pandas.DataFrame(columns=["Start",";End"]) camera = cv2.VideoCapture(0) while True: check, frame = camera.read() isMoving=0 gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) gray=cv2.GaussianBlur(gr...
StarcoderdataPython
5025033
<reponame>jedhsu/kagi """ *Ka* |⠂| Geometrically, middle-west one. """ from dataclasses import dataclass from kagi._index import A from ._k import K __all__ = ["Ka"] @dataclass class Ka( K, A, ): symbol = "\u2802"
StarcoderdataPython
1725283
# coding=utf-8 import solution as f """Test calculate_dimensions for n cases: 1) the height and width of the current image is smaller than the desired dimensions. 2) the height of the current image is smaller than the desired height but the width larger. 3) The width of the current image is smaller than the desired...
StarcoderdataPython
6464107
<filename>deep-rl/lib/python2.7/site-packages/OpenGL/GL/NV/texture_rectangle.py '''OpenGL extension NV.texture_rectangle This module customises the behaviour of the OpenGL.raw.GL.NV.texture_rectangle to provide a more Python-friendly API Overview (from the spec) OpenGL texturing is limited to images with power-o...
StarcoderdataPython
1697678
<gh_stars>0 # coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import o...
StarcoderdataPython
11207636
from chaoslib.exceptions import InterruptExecution from chaoslib.types import Activity, Run def before_activity_control(context: Activity, **kwargs): raise InterruptExecution("let's blow this up")
StarcoderdataPython
9662729
__version__ = 1.0 __all__ = ["Mutator", "Enforcer"] from Gatekeeper.mutator import Mutator from Gatekeeper.enforcer import Enforcer
StarcoderdataPython
11324088
#!/usr/bin/env python3 import os import subprocess import sys class CompileError(Exception): pass def main(root, in_file, out_file): cwd = os.getcwd() os.chdir(root) intermediate_file = 'intermediate.wasm' res = subprocess.run( ['arisen-cpp', '-O0', '-c', in_file, '-o', intermediate_file]...
StarcoderdataPython
12813457
from direction import Direction from door import Door from maze import Maze from room import Room, RoomWithABomb from wall import Wall, BombedWall class MazeGameFactory: @classmethod def make_maze(cls): return Maze() @classmethod def make_room(cls, room_number): return Room(room_numbe...
StarcoderdataPython
11288278
<filename>papahana_flask_server_demo/papahana/util.py import datetime import six import typing import yaml import pymongo import urllib from getpass import getpass import os from flask import current_app def read_mode(config='./config.live.yaml'): with open(config) as file: mode_dict = yaml.load(file, Loa...
StarcoderdataPython
5128845
<reponame>bdh1011/wau import os from flask import Flask from flask.ext.mail import Mail, Message from flask.ext.sqlalchemy import SQLAlchemy from celery import Celery app = Flask(__name__) app.config['SECRET_KEY'] = 'top-secret!' # Flask-Mail configuration app.config['MAIL_SERVER'] = 'smtp.googlemail.com' app.config[...
StarcoderdataPython
6634998
# Generated by Django 2.2.1 on 2019-06-17 01:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0009_subject_classcode'), ] operations = [ migrations.AlterField( model_name='subject', name='classcode', ...
StarcoderdataPython
4878880
<reponame>EichlerLab/chm1_scripts #!/usr/bin/env python import argparse from Bio import SeqIO from Bio import Seq from Bio import SeqRecord ap = argparse.ArgumentParser(description="Print sequences that are not well masked to an output file.") ap.add_argument("bedin", help="Input gap-bed file.") ap.add_argument("bed...
StarcoderdataPython
48046
<gh_stars>0 # The MIT License (MIT) # # Copyright (c) 2015 <NAME>, 2018 UMONS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights ...
StarcoderdataPython
8063118
import time from tkinter import * canvas = Tk() canvas.title("Reconnext&Teleplan") canvas.geometry("1366x768") canvas.resizable(1,1) bg = PhotoImage(file="images\mb.png") canvas.attributes ('-transparentcolor','') mycan = Canvas( width=1366, height=768) label = Label(font=("Arial", 140, "bold"), fg="green") l...
StarcoderdataPython
4929666
from peachpy import * from peachpy.x86_64 import * def fp16_alt_xmm_to_fp32_xmm(xmm_half): xmm_zero = XMMRegister() VPXOR(xmm_zero, xmm_zero, xmm_zero) xmm_word = XMMRegister() VPUNPCKLWD(xmm_word, xmm_zero, xmm_half) xmm_shl1_half = XMMRegister() VPADDW(xmm_shl1_half, xmm_half, xmm_half) xmm_shl1_nonsign =...
StarcoderdataPython
49244
"""Blueprints package."""
StarcoderdataPython
1661344
<filename>src/devpy/temp.py<gh_stars>100-1000 import tempfile from pathlib import Path def temp_dir(name, root=None): root = root or tempfile.gettempdir() directory = Path(root) / name directory.mkdir(exist_ok=True) return directory
StarcoderdataPython
1673175
from django.shortcuts import render, redirect from app.forms import CarrosForm from app.models import Carros # Create your views here. def home (request): data ={} data ['db'] = Carros.objects.all() return render ( request, 'index.html', data) def form(request): data = {} data ['form'] = CarrosF...
StarcoderdataPython
4820467
<reponame>eskay993/HomeAssistant-Kasa-HS100-Control """Module for smart plugs (HS100, HS110, ..).""" import logging from typing import Any, Dict from .smartdevice import DeviceType, SmartDevice, requires_update _LOGGER = logging.getLogger(__name__) class SmartPlug(SmartDevice): """Representation of a TP-Link Sm...
StarcoderdataPython
3350655
<gh_stars>10-100 # 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, s...
StarcoderdataPython
53387
<gh_stars>1-10 from contextlib import contextmanager import time from ecosante.extensions import cache @contextmanager def cache_lock(lock_id, oid): LOCK_EXPIRE = 60 * 60 timeout_at = time.monotonic() + LOCK_EXPIRE - 180 status = cache.add(lock_id, oid, LOCK_EXPIRE) try: yield status finall...
StarcoderdataPython
11271908
<reponame>firebird631/siis # @date 2018-08-24 # @author <NAME>, All rights reserved without prejudices. # @license Copyright (c) 2018 Dream Overflow # Strategy display table formatter helpers for views or notifiers from datetime import datetime from terminal.terminal import Color from terminal import charmap from co...
StarcoderdataPython
3208726
<gh_stars>0 """binary_classification ************************* Binary classification (ResNetv1-10 with CIFAR10) Source code: `binary_classification.py <https://github.com/siliconlabs/mltk/blob/master/mltk/models/examples/binary_classification.py>`_ This demonstrates how to classify two images: - Cat - Dog Using ...
StarcoderdataPython
12865736
import math import string from itertools import groupby from operator import itemgetter from nltk.corpus import stopwords from nltk.tokenize import wordpunct_tokenize N = 10788.0 # Number of documents, in float to make division work. class TermMapper(object): def __init__(self): if 'stopwords' in self....
StarcoderdataPython
384180
<gh_stars>0 from multiprocessing import Process def printFunction(country='Pakistan'): print('The name of Country is : ', country) if __name__ == "__main__": names = ['Turkey', 'China', 'Iran'] procs = [] proc = Process(target=printFunction) procs.append(proc) proc.start() for name in n...
StarcoderdataPython
5023629
<reponame>Q-Zheng/openmc from collections import OrderedDict import re import os from six import string_types from xml.etree import ElementTree as ET import openmc import openmc.checkvalue as cv from openmc.data import NATURAL_ABUNDANCE, atomic_mass class Element(object): """A natural element that auto-expands ...
StarcoderdataPython
6664834
# -*- coding: utf-8 - # # This file is part of pistil released under the MIT license. # See the NOTICE for more information. import errno import logging import os import select import socket from pistil import util from pistil.worker import Worker log = logging.getLogger(__name__) class TcpSyncWorker(Worker): ...
StarcoderdataPython
3367474
from sharpy.utils.sharpydir import SharpyDir import sharpy.utils.ctypes_utils as ct_utils import ctypes as ct import numpy as np import platform import os from sharpy.utils.constants import NDIM, vortex_radius_def UvlmLib = ct_utils.import_ctypes_lib(SharpyDir + '/lib/UVLM/lib/', 'libuvlm') class VMopts(ct.Structur...
StarcoderdataPython
3374164
<filename>26.py<gh_stars>0 # -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: 26 Description : ^_^ !!! Author : anglemiku Eamil : <EMAIL> date: 2019/9/19 ------------------------------------------------- Change Activity: ...
StarcoderdataPython
236194
class Solution: def sumNumbers(self, root ): self.result = 0 self.preOrder(root,0) return self.result def preOrder(self,root,tmp): if not root: return if not root.left and not root.right: # sum here self.result += tmp*10 + root.val ...
StarcoderdataPython
88900
#!/usr/bin/python3 # -*- encoding: utf-8 -*- """ Copyright 2015 Nb<<EMAIL>> 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 appli...
StarcoderdataPython
6567041
<reponame>martinbaste/filterno-server from flask import Flask, render_template, request from flask_cors import CORS from utils.query_GDELT import submit_query, get_key_words import nltk app = Flask(__name__) CORS(app) nltk.data.path.append('./nltk_dependencies') @app.route('/') def hello_world(): return render_temp...
StarcoderdataPython
309759
class AsyncSerialPy3Mixin: async def read_exactly(self, n): data = bytearray() while len(data) < n: remaining = n - len(data) data += await self.read(remaining) return data async def write_exactly(self, data): while data: res = await self.writ...
StarcoderdataPython
8018683
<gh_stars>1-10 import numpy as np from nsga2.examples.deep_learning.genotype import NeuralNetwork from nsga2.nsga2.initializer import Initializer class NNInitializer(Initializer): def __init__(self, n_individuals, data, target, is_classification, solver="lbfgs", n_layer_range=(...
StarcoderdataPython
3437809
<reponame>lpatmo/actionify_the_news<gh_stars>10-100 """Tests for mailer app"""
StarcoderdataPython
5081736
# # Lockstep Software Development Kit for Python # # (c) 2021-2022 Lockstep, Inc. # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. # # @author <NAME> <<EMAIL>> # @copyright 2021-2022 Lockstep, Inc. # @version 2022.2 # @link http...
StarcoderdataPython
322083
"""A bulk structure of amorphous silica.""" import numpy as np import mbuild as mb class AmorphousSilicaBulk(mb.Compound): """An amorphous silica box. density 2.2g/cm^3 """ def __init__(self): super(AmorphousSilicaBulk, self).__init__() mb.load( "amorphous_silica_bulk.p...
StarcoderdataPython
1733739
<gh_stars>1-10 '''This is a reproduction of the IRNN experiment with pixel-by-pixel sequential MNIST in "A Simple Way to Initialize Recurrent Networks of Rectified Linear Units" by <NAME>, <NAME>, <NAME> arXiv:1504.00941v2 [cs.NE] 7 Apr 2015 http://arxiv.org/pdf/1504.00941v2.pdf Optimizer is replaced with RMS...
StarcoderdataPython
48222
import pandas as pd import nltk import seaborn as sns import matplotlib.pyplot as plt import numpy as np import os nltk.download('stopwords') nltk.download('punkt') nltk.download('wordnet_ic') nltk.download('genesis') nltk.download('averaged_perceptron_tagger') nltk.download('wordnet') from src.Preprocess import Uti...
StarcoderdataPython
5129016
import difflib import os import unittest # Test suite for script horn-sat-solver.py class HornSATSolverTest(unittest.TestCase): def setUp(self): pass def launchTestWithRessource(self, inputFile): tmpFile = "tmp.file" os.system(f"cat {inputFile} | python3 src/horn-sat-solver.py > {tmpFile}") ...
StarcoderdataPython
9798551
<filename>pyramid/config/factories.py from zope.deprecation import deprecate from zope.interface import implementer from pyramid.interfaces import ( IDefaultRootFactory, IRequestFactory, IRequestExtensions, IRootFactory, ISessionFactory, ) from pyramid.traversal import DefaultRootFactory from...
StarcoderdataPython
12846869
#!/usr/bin/env python """ <Program Name> runtests.py <Author> <NAME> <<EMAIL>> <NAME> <<EMAIL>> <Started> May 23, 2016 <Copyright> See LICENSE for licensing information. <Purpose> Script to search, load and run in-toto tests using the Python `unittest` framework. """ from unittest import defaultTestL...
StarcoderdataPython
11383099
<filename>authcard/__init__.py name = "authcard"
StarcoderdataPython
11370384
<gh_stars>1-10 # Generated by Django 2.0.6 on 2018-07-18 16:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('registration', '0021_images_datetime'), ] operations = [ migrations.AlterField( model_name='userextend', ...
StarcoderdataPython
9714259
from molsysmt.lib import box as libbox import numpy as np from molsysmt import puw def box_lengths_from_box_vectors(box): unit = puw.get_unit(box) n_frames = box.shape[0] tmp_box = np.asfortranarray(puw.get_value(box), dtype='float64') lengths = libbox.length_edges_box(tmp_box, n_frames) lengths ...
StarcoderdataPython
6549459
<reponame>IldarRyabkov/backendschool2021 from flask import request, jsonify from sqlalchemy import exc from .base import BaseView from manager.db.schema import db, Courier, Region, WorkingHours from manager.api.schema import (couriers_response_schema, validate_request, CouriersSchema) ...
StarcoderdataPython
11374947
# -*- coding: utf-8 -*- """ Created on Fri Nov 8 15:48:28 2019 @author: yanglinsen """ from Bio import SeqIO from os import walk, listdir, path import re filelist = listdir("lbCpf1/") records = list(SeqIO.parse("../lbCpf1/6His-MBP-TEV-huLbCpf1.gb", "genbank")) first_record = records[0] for feature in first_record.fea...
StarcoderdataPython
1937799
import os, sys os.chdir("G:\\My Drive\\Academic\\Research\\Neural Heap") from neural_heap.dataset.io_synthesis import DATASET_RANGE HEAP_SIZE = DATASET_RANGE OP_SIZE = 3 HEAP_NAME = "tf_min_heap_pq"
StarcoderdataPython
5022909
from __future__ import absolute_import, division, print_function from h2o.frame import H2OFrame import pandas as pd from .base import check_frame from ..utils import flatten_all __all__ = [ '_check_is_1d_frame', 'as_series', 'is_numeric', 'is_integer', 'is_float', 'value_counts' ] def _check_...
StarcoderdataPython
1682473
#!/usr/bin/env python import numpy as np import argparse import json import threading import roslib; roslib.load_manifest('flyvr') roslib.load_manifest('visualization_msgs') import rospy import tf.transformations from sensor_msgs.msg import CameraInfo import sensor_msgs.msg import std_msgs.msg from geometry_msgs.msg ...
StarcoderdataPython
12827072
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import str from builtins import open from future import standard_library standard_library.install_aliases() import os import uuid import tarfile def get_im...
StarcoderdataPython
9637149
<reponame>kurianbenoy/Tree-Classifier<gh_stars>0 import os from flask import Flask, request, flash, redirect, render_template from fastai.vision.all import * from fastai.vision.core import PILImage from fastai.vision.all import load_learner from werkzeug.utils import secure_filename from api.utils.constants import UP...
StarcoderdataPython
3280570
<reponame>haizaar/crossbar-examples<filename>demos/votes/kivy/votes.py ############################################################################### ## ## Copyright (C) 2014, Tavendo GmbH and/or collaborators. All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modifica...
StarcoderdataPython
9655096
from typing import List from ems.datasets.location.location_set import LocationSet from ems.utils import parse_headered_csv class DemandSet(LocationSet): def __init__(self, filename: str = None, latitudes: List[float] = None, longitudes: List[float] = None): ...
StarcoderdataPython
4838654
from pint import UnitRegistry ureg = UnitRegistry()
StarcoderdataPython
1954737
from pydantic_fhir import r4 def test_enums_in_resource(): """Test schema on a real example with an enum field.""" status_enum = r4.StructureMap.schema()["properties"]["status"]["enum"] assert sorted(status_enum, key=lambda x: x["value"]) == sorted( [ {"value": item.value, "description...
StarcoderdataPython
3293703
<reponame>NodePing/python3-nodeping-api<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Get, create, update, and delete schedules for notifications. """ from . import _query_nodeping_api, _utils, config API_URL = "{0}schedules".format(config.API_URL) def get_schedule(token, schedule=None, customeri...
StarcoderdataPython
8116065
<filename>EV3(15) Final Version/subscriber15.py #!/usr/bin/env python3 import paho.mqtt.client as mqtt import helpers as hp import wheels from threading import Thread from ev3dev.auto import * #This is the Subscriber def representsInt(s): try: int(s) return True except ValueError: retu...
StarcoderdataPython
3588565
<gh_stars>0 import pygame import game_utilities as util from view.gui_variables import GUIVariables from view.sprite_grid import SpriteGrid class Ice(pygame.sprite.Sprite): """ Class for the ice sprites """ def __init__(self, size: int, layer: int, ice_group): """ Constructor for the...
StarcoderdataPython
4825151
<filename>ObjectWrapper/GlyphsApp/plugins.py # encoding: utf-8 from __future__ import print_function import objc from Foundation import NSBundle, NSLog, NSObject, NSClassFromString, NSMutableArray, NSMutableOrderedSet, \ NSString, NSAttributedString, NSNumber, NSUserDefaults, NSUserNotification, NSUserNotificationCe...
StarcoderdataPython
9771362
<gh_stars>0 from datetime import datetime, timedelta from typing import Optional from jose import jwt from ..config import SECRET_KEY, ALGORITHM, ACCESS_TOKEN_EXPIRE_MINUTES def encode_token(data: dict, expires_delta: Optional[timedelta] = None): to_encode = data.copy() if expires_delta: expire = da...
StarcoderdataPython
1636144
from tkinter import * from tkinter.ttk import * import string import random import webbrowser root = Tk() root.title("Strong password generator") root.geometry("350x300+463+200") lbl1 = Label(root,text="Strong password generator in python") lbl1.place(x="12", y="12") url = "https://www.github.com/de...
StarcoderdataPython
6640466
from random import randint import numpy as np import sys np.set_printoptions(threshold=sys.maxsize) img_size = 42 max_holes = 10 min_width = 6 EDGE = {0: 'down', 1: 'up', 2: 'right', 3: 'left'} def gen_square(): # make the base square sq = np.zeros([img_size, img_size], dtype=int) x1 = randint(1, 3 * im...
StarcoderdataPython
28272
<gh_stars>0 import discord import random def filtering(message): manage = "소환사님 🎀✨예쁜 말✨🎀을 사용해😡주세요~!😎😘" return manage def command(): embed = discord.Embed(title=f"명령어 모음", description="꿀벌봇은 현재 아래 기능들을 지원하고 있습니다!", color=0xf3bb76) embed.set_thumbnail(url="https://mblogthumb-phinf.pstatic.net/MjAxOD...
StarcoderdataPython
1635505
from typing import List from .docutils import LATEX_TAG_BEGIN_FORMAT, LATEX_TAG_END_FORMAT from .snippetExceptions import SnippetException class Snippet: BEGIN_TEMPLATE = LATEX_TAG_BEGIN_FORMAT END_TEMPLATE = LATEX_TAG_END_FORMAT INDENT = " " def __init__(self, name: str, tags=[]): self.__n...
StarcoderdataPython
3240237
<gh_stars>0 """Handle the console interface for the ClassifierNetwork package. This package, while intended to be used with the ModularMailer project, can be installed and used a standalone application, which this module handles the interface for. The intent of of this design is so that this package can be installed b...
StarcoderdataPython