id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
6679629
<gh_stars>0 from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError import email_validator from app.models import User import pickle class RegistrationForm(FlaskForm): username = ...
StarcoderdataPython
75674
import os from nxpy.nxfile import NXFile def test_nxnode_resolve(): node = NXFile(os.path.join(os.path.dirname(__file__), 'map.nx')).get_root_node().resolve( "Tile/grassySoil.img/bsc/0") assert node.width == 90 node2 = NXFile(os.path.join(os.path.dirname(__file__), 'map.nx')).get_root_node().g...
StarcoderdataPython
150318
<filename>colossus/apps/notifications/admin.py from django.contrib import admin from colossus.apps.notifications import models as m admin.site.register(m.Notification)
StarcoderdataPython
12805451
# This code adapted from https://github.com/python-pillow/Pillow/issues/4644 to resolve an issue # described in https://github.com/python-pillow/Pillow/issues/4640 # # There is a long-standing issue with the Pillow library that messes up GIF transparency by replacing the # transparent pixels with black pixels (among ot...
StarcoderdataPython
6554654
import tensorflow as tf class XTensorBoardCallback(tf.keras.callbacks.TensorBoard): """ TensorBoard logging with a learning rate added. """ def __init__(self, log_dir, **kwargs): super().__init__(log_dir=log_dir, **kwargs) def on_epoch_end(self, epoch, logs=None): logs.update({"l...
StarcoderdataPython
3503032
<filename>setup.py # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open("requirements.txt") as f: install_requires = f.read().strip().split("\n") # get version from __version__ variable in phytex_pharma_custom/__init__.py from phytex_pharma_custom import __version__ as version setup( name=...
StarcoderdataPython
5136987
import sys import configparser import os import subprocess SAMBA_CONFIG_PARSER = configparser.ConfigParser() SAMBA_FILE_PATH = '../smb.conf' SAMBA_CONFIG_PARSER.read(SAMBA_FILE_PATH) BLOCKED_SECTIONS = ["global", "homes", "printers", "print$"] SECTION_NAME = sys.argv[2] OPTION_NAME = sys.argv[3] def section_exist(sec...
StarcoderdataPython
3420528
def main(): print_header() name = get_user_name() print("Hello {}".format(name)) def print_header(): print("--------------------------------") print(" THE MAIN APP ") print("--------------------------------") def get_user_name(): return input("What is your name? ") if __name__ == '_...
StarcoderdataPython
68096
from gensim.models import FastText from gensim.models import word2vec import logging import argparse def fasttext_train(tool): assert tool == 'fasttext' or tool == 'word2vec', 'you can choose: [word2vec, fasttext]' logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) ...
StarcoderdataPython
332852
<filename>infer.py import tensorflow as tf import numpy as np import PIL import glob import os import argparse def get_args(): my_parser = argparse.ArgumentParser() my_parser.add_argument('-p','--folder_path',type=str,help='Path to folder of frames',required=True) my_parser.add_argument('-m','--model_path'...
StarcoderdataPython
8092869
<reponame>slaclab/central_node_ioc<filename>CentralNodeApp/srcDisplay/fault_panel.py from os import path from pydm import Display from fault_list_item import FaultListItem import argparse class FaultPanel(Display): def __init__(self, fault_list=[], parent=None, args=[]): super(FaultPanel, self).__init__(parent=p...
StarcoderdataPython
1772172
<reponame>neeravjain24/shogun #!/usr/bin/env python import shogun as sg traindat = '../data/fm_train_real.dat' testdat = '../data/fm_test_real.dat' parameter_list=[[traindat,testdat, 1.0],[traindat,testdat, 5.0]] def kernel_exponential (train_fname=traindat,test_fname=testdat, tau_coef=1.0): from shogun import kerne...
StarcoderdataPython
1763859
print(detection_predictions[0]['labels'].size()[0], 'objects detected !') detection_predictions[0]
StarcoderdataPython
8129026
<gh_stars>1-10 #!/usr/bin/env python import os import sys from setuptools import setup, find_packages if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() with open('README') as readmeFile: long_desc = readmeFile.read() setup( name='miette', version='1.5', desc...
StarcoderdataPython
3505177
import pygame pygame.init() display_width = 800 display_height = 600 gameDisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('A bit Racey') black = (0,0,0) white = (255,255,255) clock = pygame.time.Clock() crashed = False carImg_right = pygame.image.load('/Users/vladislavde...
StarcoderdataPython
281415
<reponame>TPei/jawbone_visualizer<filename>helper/date_parser.py __author__ = 'TPei' import datetime def parse_date(date): """ parse date string looking like this December 6, 2014 at 5:17pm :param date: :return: datetime.datetime """ # used to get month no # '' at beginning of list so ...
StarcoderdataPython
6615342
<reponame>Cam2337/snap-python import snap G = snap.GenPrefAttach(100000, 3) snap.PlotInDegDistr(G, "pref-attach", "PrefAttach(100000, 3) in Degree")
StarcoderdataPython
84502
<reponame>bryancatanzaro/copperhead #!/usr/bin/env python # # Copyright 2008-2012 NVIDIA Corporation # Copyright 2009-2010 University of California # # 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 ...
StarcoderdataPython
1667111
/home/runner/.cache/pip/pool/7d/6d/ab/ac311c5a2b70a57850205b558ae0b62441c3c75a085d742c8fa6067792
StarcoderdataPython
4976001
from phi.flow import * from functools import partial # Simulation parameters k0 = 0.15 # smallest wavenumber in the box x = 128 # x size y = 128 # y size dt = control(0.05) # timestep scale = 1 / 100 # Physical Parameters c1 = 0.1 # adiabatic coefficient [0, None] # Numerical Parameters arakawa_coeff = 1 # Poiss...
StarcoderdataPython
9784794
# -*- coding: utf-8 -*- """Console script for BitcoinExchangeFH.""" import logging import click import yaml from befh import Configuration, Runner LOGGER = logging.getLogger(__name__) @click.command() @click.option( '--configuration', help='Configuration file.', required=True) @click.option( '--d...
StarcoderdataPython
200684
<filename>queue-based-ingestion/python-sam/src/api/authorizer.py # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 # Authorizer code based on https://github.com/awslabs/aws-apigateway-lambda-authorizer-blueprints/blob/master/blueprints/python/api-gateway-authorizer-p...
StarcoderdataPython
5160494
<gh_stars>1-10 #!/usr/bin/env python3 import sys import re import mpmath as mp mp.dps=250 mp.mp.dps = 250 if len(sys.argv) != 2: print("Usage: format_CIAAW.py ciaawfile") quit(1) path = sys.argv[1] atomre = re.compile(r'^(\d+) +(\w\w*) +(\w+) +\[?(\d+)\]?\*? +(.*) *$') isore = re.compile(r'^(\d+)\*? +(\[...
StarcoderdataPython
6667681
<gh_stars>0 from classes.enemies.Enemy import Enemy import random from classes.enemies.BasicEnemy import BasicEnemy from classes.enemies.GrungeEnemy import GrungeEnemy class EnemyFactory: __weak_enemies = [BasicEnemy, GrungeEnemy] __regular_enemies = [] __strong_enemies = [] def __init__(self, window)...
StarcoderdataPython
9605572
from abc import ABC from logging import Logger from typing import Dict, List, Optional, Union, Any, Iterable from dacite import from_dict from data import TimeUtil, LoggingUtil from data.entity import SigningPolicyEntity, Entity, IndexEntity, PanelEntity, SeasonEntity, EpisodeEntity, \ SeriesEntity, MovieEntity f...
StarcoderdataPython
262901
<reponame>willtwr/iSiam-TF<filename>datasets/vid.py<gh_stars>1-10 #! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2017 bily Huazhong University of Science and Technology # # Distributed under terms of the MIT license. """VID Dataset""" from __future__ import absolute_import from __future__ import d...
StarcoderdataPython
5071582
#!/usr/bin/python # -*- coding: utf-8 -*- #sqltest.py - Fetch and display the MySQL database server version. # import the MySQLdb and sys modules #deletes first row, runs after the robot finishes order. import MySQLdb import sys import os import time # open a database connection # be sure to change the host IP address,...
StarcoderdataPython
11227222
<filename>linha/#2_legendas_no_grafico.py # CONFIGURANDO # ------------------------------------------- #%matplotlib inline import matplotlib as mpl #%mpl.rcParams['figure.dpi'] = 100 import numpy as np import matplotlib.pyplot as plt # CRIANDO DADOS # ------------------------------------------- x = np.linspace(0, 10...
StarcoderdataPython
3523014
#!/usr/bin/env python # -*- coding: utf-8 -*- # General libraries import sys import numpy as np import math # OUT/REMOVE IT? from math import sqrt import random import matplotlib.pyplot as plt from matplotlib.patches import Circle import time # My libraries from biblioteka import rysowanie, stale from gpu_code import ...
StarcoderdataPython
271622
# -*- coding: utf-8 -*- ''' Neural Network model definition using Tensorflow Keras ''' __author__ = "<NAME>" __date__ = "February 2021" from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Conv2D, MaxPooling2D, Dense, Dropout, Flatten # Define Keras model architecture model ...
StarcoderdataPython
1971681
<filename>tests/cases/build/builtin_functions.py from minpiler.std import M M.print(abs(-10)) M.print("test") x, y = divmod(10, 3) M.print(x, y) M.print(pow(2, 3)) M.print(max(1, 2, 3, 1)) M.print(min(1, 2, 3, 1)) M.print(float(1.5)) M.print(int(1.5)) M.print(bool(1.5)) # > print 10.0 # > print "test" # > pri...
StarcoderdataPython
1639140
from setuptools import setup """ author: fungaegis github: https://github.com/fungaegis/pytest-failed-screenshot """ with open("./README.rst", "r") as readme: long_description = readme.read() setup( name='pytest_failed_screenshot', url='https://github.com/fungaegis/pytest-failed-screenshot', version='1...
StarcoderdataPython
11245249
import pygame from pygame.locals import * from random import randrange trackFiles = [] trackTile = ['empty.png', 'start.png', 'vertStraight.png', 'horiStraight.png', 'turn90.png', 'turn180.png', 'turn270.png', 'turn360.png', 'checkpointOne.png', 'checkpointTwo.png'] empty = 0 st...
StarcoderdataPython
209480
from setuptools import find_packages, setup tests_requirements = [ 'pytest', 'pytest-cov', 'pytest-flake8', 'pytest-isort', ] setup( name='babyte', author='Kozea', packages=find_packages(), include_package_data=True, install_requires=[ 'flask', 'oauth2client', ...
StarcoderdataPython
11367528
<gh_stars>100-1000 import math import os from joblib import Parallel, delayed from chazutsu.datasets.framework.dataset import Dataset from chazutsu.datasets.framework.resource import Resource from chazutsu.datasets.framework.xtqdm import xtqdm class IMDB(Dataset): def __init__(self): super().__init__( ...
StarcoderdataPython
3429302
<reponame>BBN-E/ZS4IE # Copyright 2015 by Raytheon BBN Technologies Corp. # All Rights Reserved. """ Python API for Accessing SerifXML Files. >>> import serifxml3 >>> document_text = ''' ... John talked to his sister Mary. ... The president of Iran, <NAME>, said he wanted to resume talks. ...
StarcoderdataPython
5021162
import operator from pytest import mark, raises from evaluator import evaluate, global_env import evaluator from parser import tokenize, parse import errors def test_evaluate_integer(): ast = 2 want = 2 got = evaluate(ast, {}) assert want == got def test_evaluate_symbol(): ast = '*' want...
StarcoderdataPython
9648449
''' # https://leetcode.com/problems/permutation-in-string Approach 1: 0. Create hashmap of s1 with count of each letter 1. Create sliding window of length = len(s1) 2. Slide the window over s1: 2.1. Set hashmap/counter of alphbets in each substring of s1 of length = len(s1) 2.2. Compare the hashmap with that of s...
StarcoderdataPython
1919721
<reponame>ecobasa/ecobasa # -*- coding: utf-8 -*- from __future__ import unicode_literals from haystack.utils import Highlighter from haystack.views import SearchView from six import string_types class FindView(SearchView): def get_results(self): """ Override get_results to add the value of the f...
StarcoderdataPython
3401569
<gh_stars>0 #!/usr/bin/env python from distutils.core import setup setup(name='SpaceScout-Server', version='1.0', description='REST Backend for SpaceScout', install_requires=['Django>=1.4,<1.5','mock','oauth2','PIL','pyproj','pytz','South','simplejson>=2.1','django-oauth-plus'], )
StarcoderdataPython
318391
from InterlocksWdg import *
StarcoderdataPython
3497161
<gh_stars>1-10 from django.contrib.auth import get_user_model from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _ from girder_utils.db import DeferredFieldsManager from s3_file_field import S3FileField class Submission(m...
StarcoderdataPython
9757847
class Library: def __init__(self, location): self.location = location self.books = [] def find_book(self, title): try: book = [b for b in self.books if b.title == title][0] return "%s in library %s" % (book.title, self.location) except IndexError: ...
StarcoderdataPython
5073517
# -------------------------------------------- # File: byke_testapp.py # Date: 30/09/2019 # Author: <NAME> # Modified: # Desc: Test application for testing of byke systems, gps, motion sensor, and pic communication. # Setup for sql db testing. # -------------------------------------------- import tkinter as tk im...
StarcoderdataPython
6406940
from functools import partial from typing import Callable, Iterable, Tuple from rechunker.executors.util import chunk_keys, split_into_direct_copies from rechunker.types import CopySpec, Executor, ReadableArray, WriteableArray import pywren_ibm_cloud as pywren from pywren_ibm_cloud.executor import FunctionExecutor ...
StarcoderdataPython
8111216
import random #from colors import color, red, blue lower="abcdefghijklmnopqrstuvwxyz" upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" numbers="0123456789" symbols="~!@#$%^&*()_+}=-{:|<>?/.,';[]'" all=lower+upper+numbers+symbols length=int(input("REQUIRED LENGTH : ")) password= "".join(random.sample(all,length)) print ("NEW PA...
StarcoderdataPython
367613
[ORG 0x7C00]
StarcoderdataPython
6482184
<gh_stars>0 # %% ####################################### def pilshow_imagefile_vscode(image_file: str): """When used with a VS Code "Interactive Window", displays the referenced image file. Args: image_file (str): Reference the path of the image. """ from PIL import Image # image_object ...
StarcoderdataPython
4998884
from abc import ABC from artemis_client.session import ArtemisSession class ArtemisManager(ABC): _session: ArtemisSession def __init__(self, artemis_session: ArtemisSession) -> None: self._session = artemis_session
StarcoderdataPython
1680540
<filename>common/code/snippets/security/blind_sqli_dyn_field_len.py #!/usr/bin/env python3 # Reference: # https://spencerdodd.github.io/2017/06/22/kioptrix-2/ import sys import requests chars = "abcdefghijklmnopqrstuvwxyz01234567890.()<>*^%$@!" target = "192.168.56.101" url = "http://192.168.56.101/index.php" port =...
StarcoderdataPython
9797294
class BLNKController: def __init__(self): # stalk signal for less than 550ms means it was tapped self.tap_duration_frames = 55 self.tap_direction = 0 self.blinker_on_frame_start = 0 self.blinker_on_frame_end = 0 self.prev_turnSignalStalkState = 0 def update_st...
StarcoderdataPython
9653866
import inspect from state_machine.models import Event, State, InvalidStateTransition from state_machine.orm import get_adaptor _temp_callback_cache = None def get_callback_cache(): global _temp_callback_cache if _temp_callback_cache is None: _temp_callback_cache = dict() return _temp_callback_cac...
StarcoderdataPython
1833782
<filename>bytesviewapi/constants.py<gh_stars>0 # All the API URL and language suported by API. BASE_URL = 'https://api.bytesview.com/1/' # Sentiment URL SENTIMENT_URL = BASE_URL + 'static/sentiment' SENTIMENT_LANGUAGES_SUPPORT = {"ar", "en"} # Emotion URL EMOTION_URL = BASE_URL + 'static/emotion' EMOTION_LANGUAGE...
StarcoderdataPython
8198170
<filename>binding.gyp { "targets": [ { "target_name": "roaring", "default_configuration": "Release", "cflags": ["-O3", "-std=c99"], "cflags_cc": ["-O3", "-std=c++11"], "defines": ["DISABLEAVX"], "sources": [ "src/cpp/roaring.c", "src/cpp/module.cpp", "sr...
StarcoderdataPython
1733638
<filename>convert_temp.py #!/usr/bin/env python import time import os temp_file = '/sys/devices/platform/dht22@0/iio:device0/in_temp_input' dir_path = '/home/pi/.openauto/temp_conversion' write_file = '/home/pi/.openauto/temp_conversion/temp.txt' def check_path(): ''' Verify that the paths exist ''' if os.pa...
StarcoderdataPython
11213529
<reponame>mingaleg/yakubovich<filename>clerk/signals/__init__.py import django.dispatch new_judged_submission = django.dispatch.Signal(['contest_pk', 'run_id'])
StarcoderdataPython
66960
import collections import numpy as np import pandas as pd import matplotlib.colors import matplotlib.cm as cm import matplotlib.pyplot as plt import matplotlib.colors as mcolors import plotly import chart_studio.plotly as py import plotly.graph_objects as go from plotly.subplots import make_subplots class MultiResol...
StarcoderdataPython
6661294
<gh_stars>10-100 import logging from async_v20.client import OandaClient from async_v20.client import __version__ from async_v20.definitions import * from async_v20.endpoints.annotations import * logging.getLogger(__name__).addHandler(logging.NullHandler()) __version__ = __version__
StarcoderdataPython
376558
<filename>ait/core/server/plugins/__init__.py from .data_archive import * from .limit_monitor import * from .openmct import *
StarcoderdataPython
9607681
<filename>To-Do/main.py #Importing Modules from textwrap import fill import tkinter as tr from tkinter import TOP, Listbox, messagebox import pickle from tkinter.tix import Tk #Title root = tr.Tk() root.title("To-Do List") #Declaration height1 = 30 width1 = 100 width2 = 20 default_font = "Arial Rou...
StarcoderdataPython
8077880
<reponame>tomasoptytek/cf_data_mining #!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'daleksovski' from sklearn import metrics def build_classifier(classifier, data): '''Builds a classifier :param classifier: a Classifier object :param data: a SciKit dataset structure ''' # generic, ...
StarcoderdataPython
3285864
<filename>common/bulk_import.py<gh_stars>0 import datetime import re from django.contrib.auth.models import User from common.models import Class, Semester, Subject from io import StringIO from lxml.html import parse class ImportException(Exception): pass class BulkImport: def is_allowed(self, clazz, no_lectur...
StarcoderdataPython
8093155
<reponame>bluePhlavio/eph """Defines parsing functions to read Jpl Horizons ephemeris.""" import re from string import whitespace as ws from astropy import units as u from astropy.table import Table, QTable from .util import parse_table, parse_row, numberify, transpose, yes_or_no from .exceptions import JplBadReqErr...
StarcoderdataPython
6568393
<filename>HW1/linprimalsvm.py # Input: numpy matrix X of features, with n rows (samples), d columns (features) # X[i,j] is the j-th feature of the i-th sample # numpy vector y of labels, with n rows (samples), 1 column # y[i] is the label (+1 or -1) of the i-th sample # Output: numpy vector...
StarcoderdataPython
1846838
<filename>model-1/serve/code/serve.py #!/usr/bin/env python3 import os from flask import Flask from flask import request import pandas as pd from sklearn import linear_model import pickle app = Flask(__name__) @app.route('/ping') def index(): return "true" @app.route('/invocation', methods=['GET']) def get_predi...
StarcoderdataPython
3352621
import networkx as nx import numpy as np import matplotlib.pyplot as plt from networkx.drawing.nx_agraph import graphviz_layout def plot_graph(G, G2=None, nodelist=None, pos=None, figsize=[40, 20], edge_color='b', edge_color2='r', node_size=2500, node_color='y', font_size=12, label=True, width= None): if pos is...
StarcoderdataPython
8029757
import enum import logging from typing import Optional, Tuple from PyQt5 import QtCore from .component import Component from .motors import Motor, MotorRole, MotorDirection from ...devices.device.frontend import DeviceFrontend logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class BeamStop(QtCore...
StarcoderdataPython
6532610
#!/usr/bin/env python import sys from operator import add import numpy as np from sklearn.decomposition import PCA from sklearn import preprocessing import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib from matplotlib import rcParams rcParams['font.family'] = 'Arial' rcParams['legend.numpoints']...
StarcoderdataPython
11229019
"""Tests for the aerial_position module.""" from auvsi_suas.models.aerial_position import AerialPosition from auvsi_suas.models.gps_position import GpsPosition from django.test import TestCase class TestAerialPositionModel(TestCase): """Tests the AerialPosition model.""" def assertDistanceEqual(self, pos1, ...
StarcoderdataPython
9602981
<reponame>CityOfZion/neo3-boa<gh_stars>10-100 from typing import Any from boa3.builtin import contract, public from boa3.builtin.type import UInt160 @contract('0xf3349090a6abd4771739da994dd155a4294e6837') class Nep17: @staticmethod def symbol() -> str: pass @staticmethod def decimals() -> i...
StarcoderdataPython
156863
import copy def parse_lines(input_text): action = input_text.split(" ")[0] amount = int(input_text.split(" ")[1]) return [action, amount, 0] def run_game(input_file): acc = 0 index = 0 curr = input_file[index] curr[2] += 1 while curr[2] <= 1 and index < len(input_file): actio...
StarcoderdataPython
56616
<reponame>devTaemin/Anchorvalue-fintech-hackathon import pandas as pd from pandas import DataFrame df_0 = pd.read_csv('2019.csv', delimiter=',', encoding='utf-8-sig') df_1 = pd.read_csv('2020.csv', delimiter=',', encoding='utf-8-sig') #df_2 = pd.read_csv('2020_news_summary.csv', delimiter=',') df_merge = pd.concat([d...
StarcoderdataPython
11235105
<gh_stars>0 ''' Assembles plot pages based on the grimsel.plotting.plotting module ''' import sys from importlib import reload import logging import subprocess import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import pyAndy.c...
StarcoderdataPython
5144881
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt from PIL import Image def evaluate(b, dir): gt = np.zeros([7, 168, 168]) for num in range(7): gt[num] = np.asarray(Image.open(dir + '/train/' + str(num + 1) + '.bmp')) ang = np.zeros([7, 2]) lvector = np.zeros([7, 3]) ...
StarcoderdataPython
142802
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # 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 # to...
StarcoderdataPython
5174594
# type: ignore from .batchrequest import * from .scraperequest import *
StarcoderdataPython
3258104
"""Utility, helps with gen3.""" import os import urllib3 import requests import sys import json from gen3.auth import Gen3Auth from gen3.submission import Gen3Submission from gen3_etl.utils.collections import grouper import logging import hashlib import multiprocessing as mp from requests.packages.urllib3.exceptions ...
StarcoderdataPython
5070642
<reponame>huent189/crnn from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf import codecs def testCustomOp(feedMat, corpus, chars, wordChars): "decode using word beam search. Result is tuple, first entry is label string, second entry is char string." # T...
StarcoderdataPython
129670
import EmailParser.pst_parser """ if __name__ == "__main__": pass else: from EmailBoxClass import EmailBox EmailBox.main = EmailParser.pst_parser.main """
StarcoderdataPython
313936
''' ''' ############################################################################ from optparse import OptionParser import sys import re import numpy as np import os import sys import gzip from subprocess import check_call def parse_options(): parser = OptionParser() parser.add_option("-f", "--compressed_...
StarcoderdataPython
1863458
<reponame>EtcAug10/Domaineer #!/usr/bin/env python3 """ Copyright (C) 2021 Semi-Auto bot tool made by c0del1ar a.k.a <NAME> and it is licensed """ class Color: gray = "\033[30;1m" red = "\033[31;1m" green = "\033[32;1m" yellow = "\033[33;1m" blue = "\033[34;1m" pink = "\033[35;1m" cyan = "\033[36;...
StarcoderdataPython
9710299
from numpy import matrix from numpy import shape from numpy import transpose from laff.matmat.trsm_lnu import trsm_lnu from laff.matmat.trsm_utn import trsm_utn from laff.matmat.trsm_ltu import trsm_ltu from laff.matmat.trsm_unn import trsm_unn import sys def trsm(uplo, trans, diag, A, B ): """ Solve A X = ...
StarcoderdataPython
3256302
<gh_stars>0 #!/usr/bin/env python3 #coding=utf-8 class AscertainmentBias(object): """Mixin to test for Ascertainment Bias""" def test_ascertainment_character(self): sequences = self.xml.findall('./data/sequence') p = './/distribution[@id="likelihood"]/distribution/data/data' for part in...
StarcoderdataPython
154193
<reponame>8Banana/dotfiles import os import pathlib import shutil import stat import sys import time import types from enum import Enum, auto import importlib.util import socket import json from multicomputering import Packer class WorkerStates(Enum): Listening = auto() Connecting = auto() PreparingWor...
StarcoderdataPython
8003185
from pymoo.factory import get_problem, get_reference_directions, get_visualization from pymoo.util.plotting import plot x = [0.040971105531507235,0.550373235584878,0.6817311625009819,0.6274478938025135,0.9234111071427142,0.02499901960750534,0.136171616578574,0.9084459589232222,0.21089363254881652,0.08574450529306678,...
StarcoderdataPython
9704506
# Convert a Rogue Python file into a CPSW YAML file import os from collections import OrderedDict import yaml import pyrogue as pr from version import CPSW_YAML_SCHEMA_VERSION class YamlConverter: """ Convert a rogue Python device object into CPSW YAML, and write the YAML into a file. """ # Default ...
StarcoderdataPython
312717
#!/usr/bin/env python import re import sys from EPPs.common import GenerateHamiltonInputEPP, InvalidStepError class GenerateHamiltonInputSeqQuantPlate(GenerateHamiltonInputEPP): """"Generate a CSV containing the necessary information for preparing the spectramax picogreen plate. The standards locaiton is not sto...
StarcoderdataPython
8175027
<gh_stars>0 from rasa_core.agent import Agent from rasa_core.interpreter import RasaNLUInterpreter interpreter = RasaNLUInterpreter('models/current/nlu') messages = ["Hi! you can chat in this window. Type 'stop' to end the conversation."] agent = Agent.load('models/current/dialogue', interpreter=interpreter) def re...
StarcoderdataPython
4885749
# -*- coding: utf-8 -*- import re import sys import unittest from io import StringIO from iktomi.cli.sqla import Sqla, drop_everything from sqlalchemy import ( create_engine, orm, MetaData, Column, Integer, ForeignKey, ) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.dialects.mysql import...
StarcoderdataPython
5100058
from vacore import VACore import os modname = os.path.basename(__file__)[:-3] # calculating modname # функция на старте def start(core:VACore): manifest = { "name": "Акции на Московской бирже", "version": "1.2", "require_online": True, "commands": { }, "default_...
StarcoderdataPython
3501905
from glob import glob import json import os import re import yaml if os.path.exists("./savedata/config.json"): with open("./savedata/config.json") as json_file: raw_json = json_file.read() config = json.loads(raw_json) else: with open("./savedata/config.json", "w") as json_file: json_fi...
StarcoderdataPython
5043487
# Filename: notepicker.py # # Summary: reads wav files # # Author: <NAME> # # Last Updated: Oct 07 2015 import sys # exit argv import time # time import wave # open getframerate getnchannels getsampwidth getnframes readframes error import numpy # empty uint8 fromstring shape reshape view import scipy.signal # f...
StarcoderdataPython
11316321
<filename>superres/src/models/srgan.py<gh_stars>10-100 import logging from collections import OrderedDict import torch import torch.nn as nn from torch.nn.parallel import DataParallel, DistributedDataParallel import models.networks as networks import models.lr_scheduler as lr_scheduler from .base_model import BaseMod...
StarcoderdataPython
6576456
# coding: utf-8 """ Healthbot APIs API interface for Healthbot application # noqa: E501 OpenAPI spec version: 1.0.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagger_client from swagger_...
StarcoderdataPython
1744631
<reponame>evanbrumley/aoc2021 def main(): with open("input", "r") as f: numbers_raw = f.read() numbers = [int(num) for num in numbers_raw.splitlines() if num] last_num = None count = 0 for num in numbers: if last_num is not None and num > last_num: count += 1 ...
StarcoderdataPython
11210768
<filename>lib/tinygpgs/main.py """Encryption and decryption command-line tool with gpg(1) compatibility.""" import sys from tinygpgs.pyx import ensure_binary, integer_types, is_stdin_text, is_python_function, callable # Here we don't import anything from tinygpgs, to make --help and flag # parsing fast. We do lazy i...
StarcoderdataPython
3404366
from math import floor import pygame from pygame.locals import * import time from bait import Bait from snake import Snake game_height = 611 game_width = 914 BLOCK_SIZE = 23 TILE_COLOR = (195, 207, 161) BG_COLOR = (64, 64, 64) class Game: def __init__(self): pygame.init() pygame.display.set_ca...
StarcoderdataPython
1690689
<reponame>zakandrewking/theseus<gh_stars>0 from theseus.models import * import cobra import os import pytest def test_get_model_list(): model_list = get_model_list() assert 'iJO1366' in model_list assert 'iAF1260' in model_list assert 'E coli core' in model_list def test_check_for_model(): assert...
StarcoderdataPython
3346737
<reponame>rikeshtailor/Office365-REST-Python-Client import uuid from office365.teams.team import Team from tests.graph_case import GraphTestCase class TestGraphTeam(GraphTestCase): """Tests for teams""" target_team = None # type: Team @classmethod def setUpClass(cls): super(TestGraphTeam, ...
StarcoderdataPython
380565
<filename>tests/sample_apps/how_to/_achievement.py from ._integration_test_case import IntegrationTestCase from accelbyte_py_sdk.api.achievement.models import ModelsAchievementRequest class AchievementTestCase(IntegrationTestCase): exist: bool = False models_achievement_request: ModelsAchievementRequest = M...
StarcoderdataPython