id
stringlengths
1
7
text
stringlengths
6
1.03M
dataset_id
stringclasses
1 value
1687251
<filename>sport_activities_features/tests/test_data_analysis.py import os from unittest import TestCase from sport_activities_features import DataAnalysis class TestDataAnalysis(TestCase): def setUp(self): self.__data_analysis = DataAnalysis() def test_run_analysis(self): pipeline = self.__dat...
StarcoderdataPython
1755728
# 16. Take integer inputs from user until he/she presses q # ( Ask to press q to quit after every integer input ). # Print average and product of all numbers. allnumbers = list() while True: user = input("Enter a number (q to Quit):") if "q" in user.lower(): break else: allnumbers.append(in...
StarcoderdataPython
157628
<filename>pyobs/images/processors/detection/daophot.py from typing import Tuple from astropy.table import Table import logging import numpy as np from .sourcedetection import SourceDetection from pyobs.images import Image log = logging.getLogger(__name__) class DaophotSourceDetection(SourceDetection): """Detec...
StarcoderdataPython
117035
<gh_stars>0 # -*- coding: utf-8 -*- import dateutil.parser from geonode.people.models import Profile from bims.models.profile import Profile as BimsProfile from sass.scripts.fbis_importer import FbisImporter class FbisUserImporter(FbisImporter): content_type_model = Profile table_name = 'User' def proce...
StarcoderdataPython
1702206
from pynwb import TimeSeries class SampleCountTimestampCorespondenceBuilder: def __init__(self, data): self.data = data def build(self): return TimeSeries(name="sample_count", description="acquisition system sample count", data=self.data[:, ...
StarcoderdataPython
3365458
""" This is a combination of facets and wstacks. The outer iteration is over facet and the inner is over w. """ import numpy from arl.data.data_models import Visibility, Image from arl.imaging.wstack import predict_wstack, invert_wstack from arl.image.iterators import image_raster_iter from arl.imaging.iterated ...
StarcoderdataPython
3398849
<filename>util/Gpio.py import logging import RPi.GPIO as GPIO log = logging.getLogger(__name__) class Gpio: def __init__(self, debug, pin=4): self.debug = debug self.pin = pin if not self.debug: GPIO.setmode(GPIO.BCM) GPIO.setup(self.pin, GPIO.IN) def add_eve...
StarcoderdataPython
3241308
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
StarcoderdataPython
3372245
import sys import urllib2 from redash.query_runner import * class Url(BaseQueryRunner): @classmethod def configuration_schema(cls): return { 'type': 'object', 'properties': { 'url': { 'type': 'string', 'title': 'URL base ...
StarcoderdataPython
3314542
"""lib/netbox/ansible.py""" class NetBoxToAnsible: """Main NetBox to Ansible class""" def __init__(self, netbox_data): self.netbox_data = netbox_data self.ansible_data = {} def data(self): """Translate NetBox data to Ansible constructs""" # DCIM self.dcim_translat...
StarcoderdataPython
3370464
import numpy as np import sys def find_ids(passes): ids = set() for p in passes: rows = [0, 127] columns = [0, 7] for r in p[:8]: if r == 'F': rows[1] = (rows[1] - rows[0] - 1) / 2 + rows[0] else: rows[0] = (rows[1] - rows[0] + 1)...
StarcoderdataPython
104573
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import pytz import datetime BASEDIR = os.path.realpath(os.path.dirname(__file__)) ### Core Settings DB_URL = 'postgresql+psycopg2://compiler2017:mypassword@localhost/compiler2017' # DB_URL = 'sqlite:///data/compiler.db' TIMEZONE = pytz.timezone(...
StarcoderdataPython
52186
<reponame>157239n/k1lib<gh_stars>1-10 # AUTOGENERATED FILE! PLEASE DON'T EDIT from .callbacks import Callback, Callbacks, Cbs import k1lib, os, torch __all__ = ["Autosave", "DontTrainValid", "InspectLoss", "ModifyLoss", "Cpu", "Cuda", "DType", "InspectBatch", "ModifyBatch", "InspectOutput", "ModifyOutput", ...
StarcoderdataPython
3353740
<reponame>djf604/django-alexa from __future__ import absolute_import import json from ..base import AlexaBaseCommand from ...internal import IntentsSchema class Command(AlexaBaseCommand): help = 'Prints the Alexa Skills Kit intents schema for an app' def do_work(self, app): data = IntentsSchema.gener...
StarcoderdataPython
46523
<reponame>apaniukov/workbench """ OpenVINO DL Workbench Script to getting system resources: CPU, RAM, DISK Copyright (c) 2020 Intel Corporation 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...
StarcoderdataPython
4827505
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import argparse, pickle import shutil from keras.models import load_model import tensorflow as tf import os sys.path.append('../') import keras from keras import Input from deephunter.coverage imp...
StarcoderdataPython
1711104
import threading import typing import nacl.signing import time import typing as tp import logging.config from .istation import IStation, StationData, STATION_VERSION, Measurement from ..drivers.sds011 import SDS011_MODEL, SDS011 from collections import deque from connectivity.config.logging import LOGGING_CONFIG logg...
StarcoderdataPython
1664816
<filename>algorithms/dfs/find_all_paths_dfs_style.py def paths(root): if not root: return [] stack = [(root, [root.val])] paths = [] while stack: node, path = stack.pop() if not node.left and not node.right: paths.append(path) if node.left: stack....
StarcoderdataPython
4818394
<filename>mopidy_gpiocont/__init__.py from __future__ import unicode_literals import logging import os from mopidy import config, ext __version__ = '0.2.2' logger = logging.getLogger(__name__) class Extension(ext.Extension): dist_name = 'Mopidy-GPIOcont' ext_name = 'gpiocont' version = __version__ ...
StarcoderdataPython
1645530
from django.conf.urls import patterns, url from frontend import views """ URL setup (kinda like htaccess) """ urlpatterns = patterns( '', url(r'^$', views.main, name="main"), )
StarcoderdataPython
3346189
<reponame>KanChiMoe/rforms<filename>mod.py from flask import Blueprint, abort, jsonify, render_template, request from decorators import mod_required, api_disallowed from models import User from sqlalchemy import func import json mod = Blueprint('mod', __name__, template_folder='templates') @mod.route('/settings') @m...
StarcoderdataPython
52974
<filename>Library_Manage_System/login.py # -*- coding: utf-8 -*- import pymssql import tkinter as tk import re r1=re.compile(r'.*') import tkinter.messagebox import tkinter.messagebox as messagebox from tkinter import StringVar #sql服务器名,这里(127.0.0.1)是本地数据库IP serverName = 'localhost' #登陆用户名和密码 userName = 'sa' passWord...
StarcoderdataPython
179156
<gh_stars>0 import uvicorn from fastapi import FastAPI, Request, status from fastapi.exceptions import RequestValidationError from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles from src.c...
StarcoderdataPython
128155
<reponame>MattToul/CycleGAN import argparse import os from util import util import torch import models import data class BaseOptions(): def __init__(self): self.initialized = False def initialize(self, parser): parser.add_argument('--dataset', type=str,default='./datasets/cityscapes') ...
StarcoderdataPython
3319771
<filename>tests/conftest.py<gh_stars>10-100 import time import collections import threading import pytest import pysoem def pytest_addoption(parser): parser.addoption('--ifname', action='store') class PySoemTestEnvironment: """Setup a basic pysoem test fixture that is needed for most of tests""" BEC...
StarcoderdataPython
172084
<filename>app/db/db_users.py from app.db import update_entry import uuid import logging from typing import List, Dict, Optional from .. import schema logger = logging.getLogger("yatb.db.users") # logger.debug(f"GlobalUsers, FileDB: {_db}") async def get_user(username: str) -> Optional[schema.User]: from . impo...
StarcoderdataPython
1751210
<gh_stars>0 """ Pairwise "noise" correlations among neurons. """ import pickle import numpy as np from scipy.io import savemat import matplotlib.pyplot as plt import seaborn as sns from src.data_utils import get_per_mouse_boutons from src.corr_utils import compute_noise_corrs, compute_response_integral sns.set_palette(...
StarcoderdataPython
32239
#!/usr/bin/python import elasticsearch from elasticsearch_dsl import Search, A, Q #import logging import sys import os #logging.basicConfig(level=logging.WARN) #es = elasticsearch.Elasticsearch( # ['https://gracc.opensciencegrid.org/q'], # timeout=300, use_ssl=True, verify_certs=False) es = elasticsea...
StarcoderdataPython
1687442
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of pyunicorn. # Copyright (C) 2008--2019 <NAME> and pyunicorn authors # URL: <http://www.pik-potsdam.de/members/donges/software> # License: BSD (3-clause) # # Please acknowledge and cite the use of this software and its authors # when results are used in p...
StarcoderdataPython
4840915
"""unzip the dataset""" import zipfile def main(): with zipfile.ZipFile("img_align_celeba.zip","r") as zip_ref: zip_ref.extractall() if __name__ == "__main__": main()
StarcoderdataPython
76580
<reponame>mludolph/fogmsg import hashlib import os import time from typing import List import zmq from fogmsg.node.config import NodeConfig from fogmsg.node.receiver import NodeReceiver from fogmsg.node.sensor import Sensor from fogmsg.utils import messaging from fogmsg.utils.errors import NoAcknowledgementError from ...
StarcoderdataPython
1628566
<reponame>YeemBoi/django-remote-submission """Provide default config when installing the application.""" # -*- coding: utf-8 -*- from django.apps import AppConfig import logging logger = logging.getLogger(__name__) # pylint: disable=C0103 class DjangoRemoteSubmissionConfig(AppConfig): """Provide basic configur...
StarcoderdataPython
3281852
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import import pandas as pd from os import path, environ import pytest import bluepandas from test.secrets import secret_conn_string test_assets_path = path.abspath(path.join(path.dirname(__file__), "data")) my_urls = ...
StarcoderdataPython
1756922
<gh_stars>1000+ import duckdb import pytest import tempfile import numpy import pandas import datetime try: import pyarrow as pa can_run = True except: can_run = False def parquet_types_test(type_list): temp = tempfile.NamedTemporaryFile() temp_name = temp.name for type_pair in type_list: ...
StarcoderdataPython
76341
import tkinter as tk from tkinter import ttk class Subject_window(): def __init__(self, parent): self.frame = ttk.Frame(parent) self.parent = parent self.children = {} def grid(self): self.frame.grid() def add_children(self, **kwargs): for child in kwargs: ...
StarcoderdataPython
1613219
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import pandas as pd from covsirphy.util.error import SubsetNotFoundError, deprecate from covsirphy.cleaning.cbase import CleaningBase from covsirphy.cleaning.country_data import CountryData from covsirphy.cleaning.jhu_complement import JHUDataComplementH...
StarcoderdataPython
1636648
<reponame>sleepingAnt/viewfinder # Copyright 2012 Viewfinder Inc. All Rights Reserved. """Secrets test. Test secrets module. user vs shared, encrypted vs plain. """ __author__ = '<EMAIL> (<NAME>)' import getpass import json import logging import mock import os import shutil import tempfile import unittest from t...
StarcoderdataPython
3315547
<reponame>FZJ-INM5/JuHPLC<filename>JuHPLC/API/Calibration.py from django.http import HttpResponse, JsonResponse from django.contrib.auth.decorators import permission_required from django.contrib.auth.models import Permission, User from django.shortcuts import get_object_or_404 from JuHPLC.models import * def delete...
StarcoderdataPython
3369627
<gh_stars>0 import logging import os import subprocess import sys import threading import time import traceback import datetime import requests import spur from requests.exceptions import ConnectTimeout, ConnectionError FNULL = open(os.devnull, 'w') __LAUNCH_EXTERNAL_VIEWER__ = [True] def quote_if_necessary(s): ...
StarcoderdataPython
1742035
<reponame>velocist/TS4CheatsInfo # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\interactions\generic_affordance_chooser.py # Compiled at: 2015-01-1...
StarcoderdataPython
3263924
<filename>orthogonal/topologyShapeMetric/OrthogonalException.py class OrthogonalException(Exception): pass
StarcoderdataPython
1745313
<gh_stars>0 from functools import lru_cache from os.path import realpath, join, dirname import json PROJECT_PATH = realpath(join(dirname(__file__), './../')) @lru_cache(maxsize=1) def get_config(): with open(join(PROJECT_PATH, 'config.json'), 'r') as f: return json.load(f) def _value(key): return ...
StarcoderdataPython
3254075
<filename>meiduo/meiduo/apps/meiduo_admin/views/image.py from django.conf import settings from rest_framework.viewsets import ModelViewSet from rest_framework.views import APIView from rest_framework.response import Response from goods.models import SKUImage, SKU from meiduo_admin.utils import PageNum from meiduo_admin...
StarcoderdataPython
193117
<gh_stars>10-100 import pytest import autofit as af from autofit.exc import PriorLimitException @pytest.fixture( name="prior" ) def make_prior(): return af.GaussianPrior( mean=3.0, sigma=5.0, lower_limit=0.0 ) def test_intrinsic_lower_limit(prior): with pytest.raises( ...
StarcoderdataPython
1714268
<reponame>yarenty/mindsdb from mindsdb.api.mongo.classes import Responder import mindsdb.api.mongo.functions as helpers class Responce(Responder): when = {'getFreeMonitoringStatus': helpers.is_true} result = { 'state': 'undecided', 'ok': 1 } responder = Responce()
StarcoderdataPython
1748393
<reponame>ashleycampion/p-and-s # Programme for calculating BMI # BMI formula is: weight-in-kgs / height-in-metres ** 2 # First store the user's input into variables height = float(input("Enter height in centimetres:")) weight = float(input("Enter weight in kgs:")) # then plug them into the formula bmi = weight / (hei...
StarcoderdataPython
3354421
"""Define a fake kvstore This kvstore is used when running in the standalone mode """ from .. import backend as F class KVClient(object): ''' The fake KVStore client. This is to mimic the distributed KVStore client. It's used for DistGraph in standalone mode. ''' def __init__(self): self...
StarcoderdataPython
1719166
<gh_stars>1-10 # coding: utf-8 input = ["red", "green", "blue", "yellow"] # del input[2:] # del input[-5:] # del input[0:] # del input[1:2] # input[1:len(input)] = ["orange"] input[-1:1] = ["black", "maroon"] print(input)
StarcoderdataPython
1600920
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import print_function, division import os import numpy as np import warnings from PIL import Image import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils # Ignore warnings warnings.filterwarnings("ignore") class ...
StarcoderdataPython
3205067
<reponame>sarveshwar-s/stockcast from textblob import TextBlob import tweepy as tw import requests as req import os import pandas as pd consumer_key= 'YOUR_CONSUMER_KEY' consumer_secret= 'YOUR_CONSUMER_SECRET_KEY' access_token= '<PASSWORD>_ACCESS_TOKEN' access_token_secret= 'YOUR_SECRET_ACCESS_TOKEN' def twitter_anal...
StarcoderdataPython
3320329
<reponame>jpoirierlavoie/Diplomacy turns = { 'spring_1901':1 } turn_history = { 'spring_1901': { 'Deadline': '2022-02-19', 'Austria': { 'Vienna': 'A', 'Budapest': 'A', 'Trieste': 'F'}, 'England': { 'London': 'F', 'Edinburgh': '...
StarcoderdataPython
104548
class Luhn: def __init__(self, card_num: str): self._reversed_card_num = card_num.replace(' ', '')[::-1] self._even_digits = self._reversed_card_num[1::2] self._odd_digits = self._reversed_card_num[::2] def valid(self) -> bool: if str.isnumeric(self._reversed_card_num) and len(s...
StarcoderdataPython
4816243
"""Handles RNG""" import random from typing import Sequence RNG = True def choice(sequence: Sequence): if RNG: return random.choice(sequence) return sequence[0]
StarcoderdataPython
3392952
<gh_stars>1-10 # Autogenerated file. Do not edit. from jacdac.bus import Bus, SensorClient from .constants import * from typing import Optional class AirQualityIndexClient(SensorClient): """ The Air Quality Index is a measure of how clean or polluted air is. From min, good quality, to high, low quality. ...
StarcoderdataPython
3208221
#!/usr/bin/env python # -*- coding: utf-8 -*- # # coderdojo_library.py # # Copyright 2015 CoderDojo - GPL Licence # # This program 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 2 of t...
StarcoderdataPython
147973
""" Module with functions and methods for NEXUS files. Parsing and writing of NEXUS files is currently done with a very simple, string manipulation strategy. """ # TODO: allow to output taxa and character names between quotes, if necessary # TODO: sort using assumptions (charset) if provided # TODO: support comments ...
StarcoderdataPython
1678989
<reponame>ezragoss/typewriter from __future__ import absolute_import, print_function import json import shlex import subprocess from lib2to3.pytree import Node from typing import Any, Dict, List, Optional, Tuple from .fix_annotate_json import BaseFixAnnotateFromSignature class FixAnnotateCommand(BaseFixAnnotateFrom...
StarcoderdataPython
99848
import tensorflow as tf import numpy as np from tqdm import tqdm from tf_metric_learning.utils.index import AnnoyDataIndex class AnnoyEvaluatorCallback(AnnoyDataIndex): """ Callback, extracts embeddings, add them to AnnoyIndex and evaluate them as recall. """ def __init__( self, mod...
StarcoderdataPython
188423
''' May 2020 by <NAME> <EMAIL> https://www.github.com/sebbarb/ ''' import sys sys.path.append('../lib/') import numpy as np import pandas as pd from lifelines import CoxPHFitter from utils import * import feather from hyperparameters import Hyperparameters from pdb import set_trace as bp def mai...
StarcoderdataPython
1650117
# -*- coding: utf-8 -*- """ This module contains the core of the optimization model, containing the definiton of problem (variables,constraints,objective function,...) in CVXPY for planning and operation modes. """ import pandas as pd import cvxpy as cp import numpy as np from collections import namedtuple from hypatia...
StarcoderdataPython
1697322
<reponame>dasyad00/talking-color from .camera import Camera from .pi import PiCamera from .webcam import Webcam __all__ = ['Webcam', 'Camera', 'PiCamera']
StarcoderdataPython
1655622
<filename>back/bookclub/db/queries/books.py GET_ALL_BOOKS = """ SELECT b.title, b.author, b.slug, g.name as "genre" FROM books b INNER JOIN genres g on b.genre_id = g.id """ INSERT_BOOK = """ INSERT INTO books (title, author, slug, genre_id) SELECT :title, :author, :slug, id FROM genres WHERE name = :genre """ GET_BO...
StarcoderdataPython
3217681
<filename>Plot/text2files.py #!../../anaconda2/bin/python import pickle txtList = pickle.load(open("cessation_submissionTXT_2013-2018.p","rb")) print(txtList[0]) for i in range(len(txtList)): fp = open('cessation/'+str(i)+'.txt','w') fp.write(txtList[i].encode('utf-8')) fp.close()
StarcoderdataPython
4802819
from stp_core.common.log import getlogger from plenum.test.helper import sendReqsToNodesAndVerifySuffReplies from plenum.test.node_catchup.helper import waitNodeDataEquality, \ waitNodeDataInequality, checkNodeDataForEquality from plenum.test.pool_transactions.helper import \ disconnect_node_and_ensure_disconne...
StarcoderdataPython
3329422
<reponame>williamshen-nz/predicators """An approach that learns predicates from a teacher.""" from typing import Set, List, Optional, Tuple, Callable, Sequence import dill as pkl import numpy as np from gym.spaces import Box from predicators.src import utils from predicators.src.approaches import NSRTLearningApproach,...
StarcoderdataPython
1742321
<gh_stars>1-10 import os.path from keras.callbacks import TensorBoard, ModelCheckpoint from keras.models import load_model from data import * from seq2seq_tool_wear.model import * import numpy as np import matplotlib.pyplot as plt model = None INPUT_NUMBER = 2 OUTPUT_NUMBER = 5 # ---- PREPARATION ---- # ---- need...
StarcoderdataPython
3226920
# -*- coding: utf-8 -*- """ Created on Sun Nov 3 11:36:51 2019 @author: <NAME> """ #brute force #on the report i will also tell that we can achieve the result of this brute force by searching in B only import numpy as np from itertools import combinations q=0.7 #default failure probability per component p=...
StarcoderdataPython
3317345
"""Code for recognising disk drives.""" from .structs import DiskInfo, DiskType, DiskUUID from .type_calculator import DiskTypeCalculator __all__ = [ "DiskInfo", "DiskType", "DiskTypeCalculator", "DiskUUID", ]
StarcoderdataPython
1615023
<filename>Verlet_IC_EMS.py # -*- coding: utf-8 -*- """ Created on Thu Nov 24 22:29:44 2016 @author: Admin """ from __future__ import division import numpy as np AU = 149597871000 Ms = 1.989e30 Me = 5.972e24 Mm = 7.342e22 "Defining Variables" N = 2 t_max = 3.1556e7; t = 0 dt_max = t_max/5000 v = (2*np.pi*AU)/t_max...
StarcoderdataPython
3370298
from dataclasses import dataclass from .t_event_definition import TEventDefinition __NAMESPACE__ = "http://www.omg.org/spec/BPMN/20100524/MODEL" @dataclass class TTerminateEventDefinition(TEventDefinition): class Meta: name = "tTerminateEventDefinition"
StarcoderdataPython
1710006
<reponame>ndalsanto/pyorb<filename>pyorb_core/pde_problem/fom_problem.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 11 12:02:21 2018 @author: <NAME> @email : <EMAIL> """ import pyorb_core.error_manager as em import numpy as np import pyorb_core.algebraic_utils as alg_ut def default_theta_f...
StarcoderdataPython
1683331
''' Created on 12 April 2017 @author: <NAME> Setup script ''' #from setuptools import setup, find_packages from distutils.core import setup setup(name='tools21cm', version='2.0.1', author='<NAME>', author_email='<EMAIL>', package_dir = {'tools21cm' : 't2c'}, packages=['tools21cm'], ...
StarcoderdataPython
3201750
<reponame>Jasha10/pyright<filename>packages/pyright-internal/src/tests/samples/loops5.py<gh_stars>1000+ # This sample tests a case where a potential type alias # ("a") is involved in a recursive type dependency # ("a" depends on "test" which depends on "a"). # pyright: strict test = {"key": "value"} while True: ...
StarcoderdataPython
3277276
import sys from PyQt4 import QtCore, QtNetwork, QtGui import os from win32file import CreateFile, ReadDirectoryChangesW import win32con PORT = 8000 DEFAULT_PATH = r"C:\ProgramData\FAForever\bin" class FileWatcherThread(QtCore.QThread): fileChanged = QtCore.pyqtSignal(str) def __init__(self): QtCor...
StarcoderdataPython
172458
# placeholder to make setup(..., include_package_data=True) include this folder
StarcoderdataPython
1765915
<gh_stars>0 while True: tab = int(input('Quer ver a tabuada de qual valor? ')) print('-' * 50) if tab < 0: break for t in range(1, 11): print(f'{tab} X {t} = {tab * t}') print('-' * 50) print('PROGRAMA TABUADA ENCERRADO. Volte sempre!')
StarcoderdataPython
3306470
<reponame>sanchitcop19/web-api-async<filename>vizier/api/webservice/task.py # Copyright (C) 2017-2019 New York University, # University at Buffalo, # Illinois Institute of Technology. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
StarcoderdataPython
3288373
# # Copyright 2022 Logical Clocks AB # # 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 ag...
StarcoderdataPython
4804253
<filename>tools/dump_database.py import os import sys import django sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings") django.setup() from museum.private import DATABASES # noqa: E402 def main(): user = DATABASES["def...
StarcoderdataPython
3352932
<gh_stars>0 #!/usr/bin/env python2.7 # -*- coding: utf-8 -*- from pandas import read_csv, DataFrame, Series, concat from sklearn.preprocessing import LabelEncoder from sklearn import cross_validation, svm, grid_search from sklearn.neighbors import KNeighborsClassifier from sklearn.ensemble import RandomForestClassifi...
StarcoderdataPython
173348
from Crypto.Util.number import * from math import gcd import json ct = 17320751473362084127402636657144071375427833219607663443601124449781249403644322557541872089652267070211212915903557690040206709235417332498271540915493529128300376560226137139676145984352993170584208658625255938806836396696141456961179529532070976...
StarcoderdataPython
11305
<filename>python/paddle/fluid/tests/unittests/ir/inference/test_trt_transpose_flatten_concat_fuse_pass.py # Copyright (c) 2020 PaddlePaddle 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 obtai...
StarcoderdataPython
54264
<gh_stars>0 import requests import os TARGETS = [ "spigot2srg", "spigot2srg-onlyobf", "spigot2mcp", "spigot2mcp-onlyobf", "obf2mcp", "mcp2obf" ] BASE_URL = "http://localhost:8000" MCP_VERSION = "snapshot_nodoc_20180925" MINECRAFT_VERSION = "1.13" def main(): request = { "minecraft...
StarcoderdataPython
40937
<reponame>martinsnathalia/Python<gh_stars>0 # Desenvolva um programa que leia o comprimento de três retas e diga ao usuário se elas podem ou não formar um triângulo. print('Suas retas formam um triângulo?') r1 = float(input('Digite a primeira reta: ')) r2 = float(input('Digite a segunda reta: ')) r3 = float(input('Dig...
StarcoderdataPython
24166
from typing import List import torch from detectron2.structures import ImageList, Boxes, Instances, pairwise_iou from detectron2.modeling.box_regression import Box2BoxTransform from detectron2.modeling.roi_heads import ROI_HEADS_REGISTRY, StandardROIHeads from detectron2.modeling.roi_heads.cascade_rcnn import CascadeR...
StarcoderdataPython
3348009
# Copyright (c) 2015 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
StarcoderdataPython
1740031
import re import requests import urllib from urllib3.util.retry import Retry from requests.adapters import HTTPAdapter from .util import Util from .version import VERSION from .api_config import ApiConfig from nasdaqdatalink.errors.data_link_error import ( DataLinkError, LimitExceededError, InternalServerError, ...
StarcoderdataPython
1611938
<reponame>lefevre-fraser/openmeta-mms<gh_stars>0 from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (TestCase, assert_almost_equal, assert_equal, assert_, assert_raises, run_module_suite, assert_allclo...
StarcoderdataPython
3259094
import asyncio def sync(f): def wrapper(*args, **kwargs): asyncio.get_event_loop().create_task(f(*args, **kwargs)) return wrapper
StarcoderdataPython
119887
<gh_stars>1-10 """ get_ORFs retrieves all putative ORFs in transcriptome. This only has to be done once per gtf/genome usage: python get_ORFs.py --gtf <gtf-file> --fa <genome fasta file> --output <output-file> By default, any ORFs less than 90 nts (30 amino acid) are discarded, but this is set by the --min_aa_length...
StarcoderdataPython
1757974
<gh_stars>1-10 import os import tempfile import re import shutil import requests import io import urllib from mitmproxy.net import tcp from mitmproxy.test import tutils from pathod import language from pathod import pathoc from pathod import pathod from pathod import test from pathod.pathod import CA_CERT_NAME def...
StarcoderdataPython
57269
''' Date: 01/08/2019 Problem description: =================== This problem was asked by Google. Given an array of integers where every integer occurs three times except for one integer, which only occurs once, find and return the non-duplicated integer. For example, given [6, 1, 3, 3, 3, 6, 6], return 1. Given [1...
StarcoderdataPython
17141
<filename>WeLearn/M3-Python/L3-Python_Object/pet.py pet = { "name":"Doggo", "animal":"dog", "species":"labrador", "age":"5" } class Pet(object): def __init__(self, name, age, animal): self.name = name self.age = age self.animal = animal self.hungry = False self.mood= "happy"...
StarcoderdataPython
158045
<reponame>zevaverbach/epcon from django.conf import settings from django import template register = template.Library() @register.inclusion_tag("assopy/stripe/checkout_script.html") def stripe_checkout_script(order, company_name=None, company_logo=None): """ Template tag that renders the stripe checkout sc...
StarcoderdataPython
43766
<filename>src/zc/sourcefactory/mapping.py<gh_stars>1-10 ############################################################################## # # Copyright (c) 2006-2007 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A ...
StarcoderdataPython
1773640
<filename>sfdata/posts/migrations/0002_post_story_id.py<gh_stars>1-10 # Generated by Django 2.1.4 on 2018-12-21 22:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0001_initial'), ] operations = [ migrations.AddField( ...
StarcoderdataPython
167576
<gh_stars>1-10 import os import yaml import logging import tempfile import requests from rasa_core.events import UserUttered, BotUttered, SlotSet from requests.exceptions import RequestException logger = logging.getLogger(__name__) def load_from_remote(endpoint, type, temp_file=True): try: response = endp...
StarcoderdataPython
3234567
#!/usr/bin/env python import binascii, sys, re import sploit pattern = re.compile(r"\s+") def show_help(): def show_help(): printsys.argv[0] + " imput.hex output.bin" print "\tinput.hex - file" print "\toutput.bin" def hextobin(infile, outfile); if infile ...
StarcoderdataPython
1601461
from parameterized import parameterized from cinemanio.api.helpers import global_id from cinemanio.api.schema.movie import MovieNode from cinemanio.api.schema.person import PersonNode from cinemanio.api.tests.base import ListQueryBaseTestCase from cinemanio.core.factories import MovieFactory, PersonFactory from cinema...
StarcoderdataPython
4832908
<gh_stars>0 # Create an empty dictionary people = {} name = 'jon' age = 20 name2 = 'aly' age2 = 21 # Insert an entry into dict. people[name] = age people[name2] = age2 print(people) # Add an entry. people.update({'fred': 24}) print(people) # Iterate the dictionaries keys and values. print('\nDisplaying dictionary da...
StarcoderdataPython