id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
1817679
from setuptools import setup # install localy: # python3 -m pip install -e . # This call to setup() does all the work setup( name="ctfpwn", version="3.0.1", description="Framework for making CTFs, bug bounty and pentesting Python scripting easier", long_description="README.md", long_description_con...
StarcoderdataPython
6571373
<filename>application/src/pytest/python/modules/notifications/schema_admin_test.py from copy import copy import pytest from app import create_app from config import Config from modules.notifications.schema_admin import NotificationAdminSchema from modules.notifications.model import Notification from fixtures import F...
StarcoderdataPython
3305170
<reponame>welfare-state-analytics/pyriksprot from __future__ import annotations import sqlite3 from contextlib import nullcontext from functools import cached_property import pandas as pd from . import utility as mdu DATA_TABLES: dict[str, str] = { 'protocols': 'document_id', 'utterances': 'u_id', 'unkn...
StarcoderdataPython
4981477
namelist = 'wav', 'mp3'
StarcoderdataPython
1926845
<reponame>mudkipmaster/gwlf-e from gwlfe.AFOS.GrazingAnimals.Losses.GRStreamN import AvGRStreamN from gwlfe.AFOS.GrazingAnimals.Losses.GRStreamN import AvGRStreamN_f def NFENCING(PctStreams, PctGrazing, GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN, n42, n45, n69): grsn = AvGRStreamN(PctStreams, PctGrazi...
StarcoderdataPython
9672342
<reponame>ayoubBouziane/TrainingSpeech<gh_stars>1-10 import os import pytest from training_speech import ffmpeg CURRENT_DIR = os.path.dirname(__file__) @pytest.mark.parametrize('kwargs, expected_call', [ (dict(from_='foo.mp3', to='foo.wav'), 'ffmpeg -y -i foo.mp3 -loglevel quiet foo.wav'), (dict(from_='foo....
StarcoderdataPython
9618483
""" Simple, non parallel optimization set up example. """ import sys,os sys.path.insert(0,'../../../') from glennopt.helpers import mutation_parameters, de_mutation_type, parallel_settings from glennopt.base import Parameter from glennopt.optimizers import NSGA3 from glennopt.DOE import FullFactorial, CCD, LatinHy...
StarcoderdataPython
4915742
<gh_stars>0 import cv2 ## TEST # Initializing the Histograms of Oriented Gradients person detector hog = cv2.HOGDescriptor() hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) cap = cv2.VideoCapture("test_assets/test2.mp4") while cap.isOpened(): # Reading the video stream ret, image = cap...
StarcoderdataPython
40569
# Copyright (c) 2020 Samplasion <<EMAIL>> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT TARGET = 2020 def main(): print("=============") print("= AoC Day 1 =") print("=============") print() with open("input.txt") as f: file = f.read() ...
StarcoderdataPython
3403583
<reponame>tfwcn/Mask_RCNN import os import argparse import re parser = argparse.ArgumentParser() parser.add_argument("images_dir") args = parser.parse_args() index = 0 for file_name in os.listdir(args.images_dir): full_path = os.path.join(args.images_dir, file_name) if os.path.isfile(full_path): ...
StarcoderdataPython
1691529
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass from fairseq.dataclass import FairseqDataclass from fairseq.optim.lr_scheduler import FairseqLRSche...
StarcoderdataPython
3436725
# -*- coding: utf-8 -*- # Copyright CERN since 2012 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
StarcoderdataPython
6644395
# coding: utf-8 from .analyze import CZSC, CzscTrader from .utils.ta import SMA, EMA, MACD, KDJ from .data.jq import JqCzscTrader from . import aphorism __version__ = "0.7.8" __author__ = "zengbin93" __email__ = "<EMAIL>" __date__ = "20210925" print(f"欢迎使用CZSC!当前版本标识为 {__version__}@{__date__}\n") aphorism.print_one...
StarcoderdataPython
8018110
# 公用配置 DEBUG = True SQLALCHEMY_ECHO = False SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ENCODING = "utf8mb4" SECRET_KEY = "root"
StarcoderdataPython
5187519
from datapackage_pipelines_knesset.common.base_processors.base_resource import BaseResourceProcessor class AddResourceBaseProcessor(BaseResourceProcessor): def _get_new_resource_descriptor(self): # you can use this to add attributes (other then schema / path / name - which are added automatically) ...
StarcoderdataPython
12826091
# -*- coding: utf-8 -*- from zmq.eventloop.zmqstream import ZMQStream from zmq import Context,PULL,PUSH from program_top.utilities.ip_and_socket import get_local_ip from program_top.components import component_base class zmq_listen_connection(object): '''zmq监听连接''' def __init__(self,port_number,callback_function): ...
StarcoderdataPython
6469527
/Users/NikhilArora/anaconda3/lib/python3.6/re.py
StarcoderdataPython
5081016
<reponame>duykienvp/sigspatial-2020-spatial-privacy-pricing import numpy from scipy.stats import rv_continuous from pup.algorithms import util from pup.common.checkin import Checkin from pup.common.grid import Grid from pup.common.rectangle import Rectangle class NoisyCheckin(Checkin): """ Noisy version of a che...
StarcoderdataPython
9756734
# Copyright 2020 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
StarcoderdataPython
8069052
import numpy as np import scipy.sparse as sp import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.init import xavier_uniform_ device = 'cuda' if torch.cuda.is_available() else 'cpu' def normt_spm(mx, method='in'): if method == 'in': mx = mx.transpose() rows...
StarcoderdataPython
5076701
from django.contrib.staticfiles.templatetags.staticfiles import static from django.utils.html import format_html from wagtail.core import hooks @hooks.register('insert_editor_js') def editor_js(): return format_html( """ <script src="{}"></script> """, static('wagtailrelated/j...
StarcoderdataPython
91647
# The MIT License (MIT) # # Copyright (c) 2017 <NAME> for Adafruit Industries. # # 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
8049392
import math from tkinter import * import random from itertools import permutations from scipy.spatial import distance root = Tk() root.title("Найду Вам оптимальный путь") N = 9 root.geometry(str(N*100) + "x" + str(N*100)) my_canvas = Canvas(root, width=N*100, height=N*100, bg="black") my_canvas.pack(pady=1) record...
StarcoderdataPython
5063639
<gh_stars>0 """Provides classes to build arbitrary waveforms.""" import json import numpy as np class KeyFrameList(object): """Basic timing element. Holds a list of keyframes. Each keyframe is a position in time relative to a parent keyframe. If parent keyframe is None, then the time is relative to...
StarcoderdataPython
12842202
from collections import defaultdict from datetime import datetime from typing import Any, Dict, List, Optional from pyproj import Geod from pystac.utils import str_to_datetime from stactools.core.io import ReadHrefModifier from stactools.core.io.xml import XmlElement from stactools.core.projection import transform_fro...
StarcoderdataPython
11247263
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from twircbot.twircbot import * from twircbot.botmodule import * from twircbot.logger import * from twircbot.twitchtools import *
StarcoderdataPython
1924027
<gh_stars>0 """ Оповещение администратора о возникших ошибках """ from traceback import format_exception, format_exc from contextlib import contextmanager from lib.config import emergency_id from lib.commands import vk, api from logging import getLogger logger = getLogger("GM.lib.errors") @contextmanager def ErrorM...
StarcoderdataPython
223604
<reponame>AnttiHaerkoenen/grand_duchy import os import subprocess def remove_whitespaces(directory): directory = os.path.expandvars(os.path.expanduser(directory)) os.chdir(directory) for fname in os.listdir(directory): if fname.find(" ") >= 0: new_fname = fname.replace(" ", "_") ...
StarcoderdataPython
86646
<filename>tests/llvm/test_llvm_lite.py #!/bin/env python3 # Short example/demonstrator how to create and compile native code using # LLVM MCJIT just-in-time compiler from llvmlite import binding,ir import ctypes import pytest try: import pycuda from pycuda import autoinit as pycuda_default # Import this a...
StarcoderdataPython
3302350
<filename>scripts/coco_label.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import json import os def main(opt): # TRAIN_INS = '../data/COCO/annotations/instances_train2014.json' # VALID_INS = '../data/COCO/annotat...
StarcoderdataPython
1817973
<filename>7kyu/youre_a_square.py # http://www.codewars.com/kata/54c27a33fb7da0db0100040e/ def is_square(n): return n > 0 and (n ** 0.5).is_integer()
StarcoderdataPython
6604999
<gh_stars>1-10 import pytest from .day_9 import parse_input, get_non_composable, get_key @pytest.fixture() def example_input(): return parse_input( """35 20 15 25 47 40 62 55 65 95 102 117 150 182 ...
StarcoderdataPython
63294
<reponame>jpbelleau/hdfs-over-ftp-slider #!/usr/bin/env python import sys from resource_management import * class HDFSFTP(Script): def install(self, env): self.install_packages(env) def configure(self, env): import os import params env.set_params(params) keystore_path = params.app_root + "/"...
StarcoderdataPython
3465456
<gh_stars>1-10 #!/usr/bin/python3 ''' Convert Gend scores from the PYM dataset to values between -1(most masculine) and +1 (most feminine) ''' import re num_re = re.compile("^\d+(\.\d+)?$") with open("pym_data.txt", "r") as pym_data_f: for line in pym_data_f: line = line.strip() parameters = l...
StarcoderdataPython
1798324
<filename>Short Text Classification/Text_Classification/data_helpers.py # encoding: UTF-8 import numpy as np import re import itertools from collections import Counter import os import word2vec_helpers import time import pickle def load_data_and_labels(input_text_file, input_label_file, num_labels): x_text = rea...
StarcoderdataPython
4838183
<gh_stars>1-10 # Attributes: # FLASH_STATUSES (list): Description # SOCR_SIG_RES_ID (str): Description # SOCR_SIG_STAT_RES_ID (str): Description import os import pdb import sys import arrow import kitsutil import datautil import emailutil import jobutil import logutil import socratautil import _setpath f...
StarcoderdataPython
4847767
import os # Local directory of CypherCat API VARGAN_DIR = os.path.dirname(os.path.abspath(__file__)) # Local directory containing entire repo REPO_DIR = os.path.split(VARGAN_DIR)[0] # Local directory for datasets DATASETS_DIR = os.path.join(REPO_DIR, 'datasets') # Local directory for runs RUNS_DIR = os.path.join(RE...
StarcoderdataPython
3265026
__author__ = '<NAME> <<EMAIL>>' import unittest from sudoku import solver import time class TestSudoku(unittest.TestCase): def setUp(self): self.sudoku = solver.Sudoku(max_iterations=1000, debug_print=False) easy = ('830076042' '600300097' '000082100' ...
StarcoderdataPython
3462959
<reponame>pwgbots/presto<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-08-18 13:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('presto', '0058_auto_201...
StarcoderdataPython
6634317
<filename>HW4/q3.py #!/usr/bin/python import os, socket import q2 import assemble HOST = '127.0.0.1' SERVER_PORT = 8000 LOCAL_PORT = 1337 ASCII_MAX = 0x7f def get_raw_shellcode(): return q2.get_shellcode() def get_shellcode(): # sorry for solve this in morrom method, I dont have time to think on...
StarcoderdataPython
3285825
# -*- coding: utf-8 -*- # @Author : William # @Project : TextGAN-william # @FileName : LeakGAN_G.py # @Time : Created at 2019-04-25 # @Blog : http://zhiweil.ml/ # @Description : # Copyrights (C) 2018. All Rights Reserved. import math import time import torch import torch.nn...
StarcoderdataPython
4998351
import mock from unittest import TestCase from ncssl_api_client.services.crypto.csr_generator import CsrGenerator class CsrGeneratorTest(TestCase): @mock.patch('ncssl_api_client.services.crypto.csr_generator.Utils') def test_generates_private_key(self, utils_mock): crypto_config_mock = mock.MagicMock...
StarcoderdataPython
8195852
<gh_stars>0 n = int(input()) # dp 생성 dp = [0] * (n+1) # dp 값 update for i in range(2,n+1): # dp 기본 값 생성 dp[i] = dp[i-1] + 1 # 2와 3 모두 나누기가 가능한 경우 3가지 case 비교 if i % 6 == 0: dp[i] = min(dp[i//3]+1, dp[i//2]+1, dp[i]) # 3 나누기 가능한 경우 2가지 case 비교 elif i % 3 == 0: dp[i] = min(dp[i//3...
StarcoderdataPython
1939082
import torch import torch.nn as nn import numpy as np def get_corrcoef(x): if type(x) is torch.Tensor: x = x.detach().cpu().numpy() corr_mat = np.corrcoef(x, rowvar=False) np.fill_diagonal(corr_mat, 0) return np.abs(corr_mat).mean() class MemoryWhitening1d(nn.Module): def __init__(self...
StarcoderdataPython
3574500
<filename>dassl/data/datasets/base_dataset.py import os import tarfile import zipfile from dassl.utils import check_isfile import gdown import os.path as osp class Datum: """Data instance which defines the basic attributes. Args: impath (str, list, tuple): image path. label (int): class labe...
StarcoderdataPython
11373436
import rclpy from sensor_battery import battery_data_publisher_node as node def main(args=None): rclpy.init(args=args) # Construct the publisher battery_data_publisher = node.BatteryDataPublisher() # Reading and publishing data at defined rate (2 seconds) rclpy.spin(battery_data_publisher) ...
StarcoderdataPython
1998591
<filename>CSCE/12.8.20/BankAccount.py<gh_stars>1-10 class BankAccount(): def __init__(self, accountnumber, balance): self.accountnumber = accountnumber self.balance = balance def Check(self): user = int(input('Enter the Account Number: ')) if(user == self.accountnumber): ...
StarcoderdataPython
5099756
<filename>client/commands.py from enum import Enum class Command(Enum): ADD_USER = "adduser" PASSWORD = "<PASSWORD>" LIST = "list" LEADERS = "leaders" LOGIN = "login" LOGOUT = "logout" BEGIN = "begin" SEND = "send" DELAY = "delay" END = "end" EXIT = "exit" DEFAULT = "de...
StarcoderdataPython
9699262
# -*- coding: utf-8 -*- """ Created on Thu Nov 19 18:04:12 2020 @author: hamil """ #Importação das Bibliotecas necessaria para criação do algoritmo from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import ...
StarcoderdataPython
4813129
<gh_stars>10-100 import sys sys.path.insert(0, '../') import unittest import lib.base as sinon from lib.matcher import SinonMatcher from lib.spy import SinonSpy from lib.stub import SinonStub """ ====================================================== FOR TEST ONLY START ==============================...
StarcoderdataPython
351710
"""Test for event_manager.py.""" from datetime import datetime, timedelta, timezone from googleapiclient.http import HttpMock from showroomeventscheduler.google.calendar.event import Event from showroomeventscheduler.google.calendar.event_manager import EventManager class TestEventManager: """Test for EventMana...
StarcoderdataPython
4867375
#!/usr/bin/env python2 import os import shutil DIR='build' BUILD_ID_MK = '/'.join((DIR, 'core', 'build_id.mk')) VERSION_MK = '/'.join((DIR, 'core', 'version_defaults.mk')) def checkout(tag): os.system('(cd %s; git checkout %s)'%(DIR, tag)) def get_level(): for line in open(VERSION_MK): line = line.st...
StarcoderdataPython
5146662
<gh_stars>1-10 # Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os.path from edalize.edatool import Edatool from edalize.nextpnr import Nextpnr from edalize.yosys import Yosys from edalize.flows.icestorm import Icestorm...
StarcoderdataPython
8098152
<filename>tests/test_upload.py<gh_stars>0 import os import requests def test_upload_image(): test_dir = "./tests/test_img" filename = "living-room.jpg" file = { "image": (os.path.basename(filename), open(os.path.join(test_dir, filename), 'rb')) } response = requests.post(url='http://localh...
StarcoderdataPython
129553
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
StarcoderdataPython
3213948
#!/usr/bin/env python import my_module2 print 'Hello from my_modules.py'
StarcoderdataPython
11271800
"""Collection of all exception classes """ class HdtopException(Exception): """Based type for all exceptions""" class ConfigValueError(HdtopException, ValueError): """Config value is not allowed.""" def __str__(self) -> str: msg = f"Invalid configuration value: {self.args[0]}" if len(s...
StarcoderdataPython
8179053
<gh_stars>1-10 # -*- coding: utf-8 -*- import logging logging.warning('% s before you %s', 'look', 'leap')
StarcoderdataPython
1975627
<filename>scripts/uniq_hash.py #!/usr/bin/python3 import fileinput import sys f = fileinput.input() header = next(f) sys.stdout.write(header) h_index = header.split(',').index('hash') seen = set() for line in f: h = line.split(',')[h_index] if h in seen: continue seen.add(h) sys.stdout.write(line)
StarcoderdataPython
1811602
nums = [1, 2, 3, 4] new_nums = [0] * len(nums) # initialize a new list with the same length as nums for i in range(len(nums)): new_nums[i] = new_nums[i - 1] + nums[i] print(new_nums)
StarcoderdataPython
6519812
<reponame>seekindark/helloworld import sys from PyQt5.QtWidgets import QApplication ,QWidget ,QFormLayout , \ QLineEdit, QLabel, QPushButton,QRadioButton from PyQt5.QtCore import Qt class Winform(QWidget): def __init__(self, parent=None): super(Winform, self).__init__(p...
StarcoderdataPython
358509
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
StarcoderdataPython
6629148
#! /usr/bin/env python ############################################################################## ## DendroPy Phylogenetic Computing Library. ## ## Copyright 2010-2015 <NAME> and <NAME>. ## All rights reserved. ## ## See "LICENSE.rst" for terms and conditions of usage. ## ## If you use this work or any portio...
StarcoderdataPython
1942960
<reponame>drewsilcock/docker-centos7-slurm<filename>tests/test_slurm.py<gh_stars>1-10 import time import pytest @pytest.mark.parametrize("partition", ["normal", "debug"]) def test_partitions_are_up(host, partition): partition_status = host.check_output(f"scontrol -o show partition {partition}") assert "State=...
StarcoderdataPython
8026353
import sys import argparse import numpy as np import cv2 import time from PIL import Image try: from tflite_runtime.interpreter import Interpreter except: from tensorflow.lite.python.interpreter import Interpreter fps = "" framecount = 0 time1 = 0 LABEL_CONTOURS = [(0, 0, 0), # 0=background ...
StarcoderdataPython
11349557
import asyncio from aiohttp import ClientSession import settings from interfaces import * async def setup_search_interface(app): await asyncio.sleep(0) setattr(app, 'search', AzureSearchInterface( emails=AzureSearchIndexInterface( settings.db.AZURE_SEARCH_EMAILS_INDEX_URL, set...
StarcoderdataPython
5148140
from typing import Iterable class SearchRetryException(Exception): pass class DataStoreException(Exception): pass class SearchException(Exception): pass class SearchDepthException(Exception): pass class UndefinedFunction(Exception): pass class ILMException(Exception): pass class Mu...
StarcoderdataPython
11323030
"""API Blueprint This is a subclass of Flask's Blueprint It provides added features: - Decorators to specify Marshmallow schema for view functions I/O - API documentation registration Documentation process works in several steps: - At import time - When a MethodView or a view function is decorated, relevant in...
StarcoderdataPython
1972365
<reponame>qianhk/FeiPython #!/usr/bin/env python3 # coding=utf-8 from PIL import Image, ImageDraw import os import time import math under_game_score_y = 200 piece_base_height_1_2 = 13 piece_body_width = 49 def find_piece_and_board(im): w, h = im.size print("size: {}, {}".format(w, h)) piece_x_sum = pi...
StarcoderdataPython
5184448
from dataset_walker import DatasetWalker import sys import json import argparse slot_keys = [ ("restaurant", "book", "people"), ("restaurant", "book", "day"), ("restaurant", "book", "time"), ("restaurant", "semi", "food"), ("restaurant", "semi", "pricerange"), ("restaurant", "semi", "name"), ...
StarcoderdataPython
3581555
import os import tensorflow as tf from tensorflow.python.tools.inspect_checkpoint import print_tensors_in_checkpoint_file def jaccard_distance(text1, text2): """ Measure the jaccard distance of two different text. ARGS: text1,2: list of tokens RETURN: score(float): distance between two tex...
StarcoderdataPython
12823540
#!/usr/bin/env python import os from setuptools import setup, find_packages sdict = dict( name = 'django-govuk-template', packages = find_packages(), version = '0.16.0', description = 'Django packaged version of the GOV.UK template', long_description = 'A base template for Government Digital Services', ur...
StarcoderdataPython
12819951
<filename>dcs_kneeboard_creator/widgets/scene.py import sys import logging logging.basicConfig(level=logging.INFO) from PySide6.QtWidgets import * from PySide6.QtGui import * from PySide6.QtCore import * import ez_utils.general as utils import ez_utils.io_utils as io_utils from ..graphics.waypoint import Waypoint c...
StarcoderdataPython
1870308
# Generated by Django 3.0.4 on 2020-04-19 20:22 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('auth', '0011_update_proxy_permissions'), ('YourJobAidApi', '0023_userprofile_bio'), ] operations = [ ...
StarcoderdataPython
3373889
############################################################################## # Copyright 2016-2021 Rigetti Computing # # 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...
StarcoderdataPython
9673928
__source__ = 'https://leetcode.com/problems/continuous-subarray-sum/' # Time: O(n^2) # Space: O(n) # # Description: Leetcode # 523. Continuous Subarray Sum # # Given a list of non-negative numbers and a target integer k, write a function to check if # the array has a continuous subarray of size at least 2 that sums up...
StarcoderdataPython
11355261
<filename>todo/__init__.py import os from flask import Flask def create_app(): app = Flask(__name__) app.config.from_mapping( SECRET_KEY='mykey', DATABASE_HOST=os.environ.get('FLASK_DATABASE_HOST'), DATABASE=os.environ.get('FLASK_DATABASE'), DATABASE_USER=os.environ.get('FLA...
StarcoderdataPython
3444100
<filename>src/test/test_tools.py import sys sys.path.append('../') import unittest from cog_abm.extras.tools import calc_auc class TestAucCalculations(unittest.TestCase): def setUp(self): pass def test_auc(self): test_data = [ ([(0, 0), (1, 2), (2, 0)], 2.), ([(0, 1...
StarcoderdataPython
3301152
from django.contrib import admin # Register your models here. from .models import tag_store, stat_store admin.site.register(tag_store) admin.site.register(stat_store)
StarcoderdataPython
359717
<filename>src/model_selection_monk_test.py from utility import read_monk_dataset from model_selection import grid_search, get_best_models if __name__ == '__main__': # read dataset tr_ds_name = "monks-3.train" ts_ds_name = "monks-3.test" # grid search parameters gs_params = {'units_per_layer': ([4,...
StarcoderdataPython
6680540
# -*- coding: utf-8 -*- from annohub import app from flask import flash, render_template, abort, redirect, url_for #from flask import request, session from annohub.lib.db import Db as DbImport import annohub.lib.user as user from annohub import login_manager #from bson import DocumentTooLarge # flash can take the foll...
StarcoderdataPython
3433419
# Copyright (c) ZenML GmbH 2022. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
StarcoderdataPython
12860399
""" Ensures there is no data past the deactivation date for deactivated participants. Original Issue: DC-686 The intent is to sandbox and drop records dated after the date of deactivation for participants who have deactivated from the Program This test will mock calling the PS API and provide a returned value. Every...
StarcoderdataPython
1639877
<filename>algorithms/algo.py<gh_stars>0 import sys import numpy as np import argparse import copy import random import json import torch from torch.autograd import grad from torch import nn, optim from torch.nn import functional as F from torchvision import datasets, transforms from torchvision.utils import save_image...
StarcoderdataPython
87014
<filename>pychron/canvas/canvas2D/scene/primitives/dumper_primitives.py # =============================================================================== # Copyright 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
StarcoderdataPython
326636
# (C) Copyright 1996- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernment...
StarcoderdataPython
4968682
<reponame>leglars/ThinkingofYou<filename>AM-flask/app/send_sms.py # from twilio.rest import TwilioRestClient # # account_sid = 'ACd7a0898f812377ef06121f8611f11b1e' # auth_token = '<PASSWORD>' # client = TwilioRestClient(account_sid, auth_token) import plivo import ENV_VAR as ENV auth_id = ENV.PLIVO["id"] auth_token =...
StarcoderdataPython
339830
<gh_stars>100-1000 from __future__ import absolute_import, division, print_function from six.moves import range # LIBTBX_SET_DISPATCHER_NAME xpp.beamcenter # LIBTBX_PRE_DISPATCHER_INCLUDE_SH export PHENIX_GUI_ENVIRONMENT=1 # LIBTBX_PRE_DISPATCHER_INCLUDE_SH export BOOST_ADAPTBX_FPE_DEFAULT=1 import sys,os from scitbx....
StarcoderdataPython
11316149
<reponame>smartalecH/BYUqot<gh_stars>1-10 # Material dispersion example, from the Meep tutorial. Here, we simply # simulate homogenous space filled with a dispersive material, and compute # its modes as a function of wavevector k. Since omega/c = k/n, we can # extract the dielectric function epsilon(omega) = (ck/omeg...
StarcoderdataPython
5084822
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from infra.libs.gerrit_api.gerrit_api import ( AccessViolationException, Gerrit, RevisionConflictException, UnexpectedResponseException) from infra....
StarcoderdataPython
5084535
# To use the instance return type from static methods from __future__ import annotations from datetime import datetime from pathlib import Path from toolz import curry, partition_all, get from typing import Mapping, Union, Iterator from uuid import UUID from uuid import uuid4 from mmlp.Config import Config from mmlp....
StarcoderdataPython
11231177
import numpy as np from tqdm import tqdm import pandas as pd import uproot from sklearn.preprocessing import MinMaxScaler Run2_MC = '/eos/lhcb/wg/FlavourTagging/tuples/development/IFT/data_Feb2021/fttuple_data_2016_28r2_TrT.root' tree = 'Bd2JpsiKstarDetached/DecayTree' # there are two indexes in this data-set: B-c...
StarcoderdataPython
5198047
<gh_stars>0 #!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() requirements = [ 'Click>=7.0', 'gevent>=1.4.0', 'jsonobject>=0.9.9', 'sh>=1.0.9', 'PyYAML>=5.1', 'contextlib2>=0.5.5',...
StarcoderdataPython
5081528
import pandas as pd import argparse from matplotlib_venn import venn3 import matplotlib.pyplot as plt import math def get_args(): desc = 'Given sj files, see which splice junctions are shared/unique between datasets' parser = argparse.ArgumentParser(description=desc) parser.add_argument('-sj_1', dest='sj_1', h...
StarcoderdataPython
6532727
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging import os from sis_provisioner.dao.pws import get_person from sis_provisioner.dao.hrp import get_worker from sis_provisioner.util.log import log_exception from sis_provisioner.util.settings import ( get_csv_file_n...
StarcoderdataPython
3253745
from vk.types.events.community.events_list import Event from vk.bot_framework.dispatcher.rule import BaseRule from vk import types import typing import logging import asyncio logger = logging.getLogger(__name__) class SkipHandler(Exception): pass class Handler: def __init__( self, event_type: Even...
StarcoderdataPython
3242288
<reponame>RosettaCommons/jade2<filename>jade2/basic/sequence/SequenceInfo.py #<NAME> class SequenceInfo: """ Simple class for holding + accessing sequence metadata Original class for sequence info. Basically deprecated by SequenceStats and PDBConsensusInfo. """ def __init__(self): self.s...
StarcoderdataPython
194201
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import da...
StarcoderdataPython
3428024
<filename>spark2-streaming-python/app-package/src/main/resources/sparkStreaming/example/job.py<gh_stars>1-10 # # Name: Job.py # Purpose: Application entry point to create, configure and start spark streaming job. # Author: PNDA team # # Created: 22/01/2018 # # # # Copyright (c) 2018 Cisco and/or its aff...
StarcoderdataPython
200940
from misc_utils import get_config, get_logger, tokenize from discourse_relation import DiscourseRelation from collections import Counter, defaultdict import json import abc import numpy as np from os.path import join import os logger = get_logger(__name__) class Resource(metaclass=abc.ABCMeta): def __init__(self,...
StarcoderdataPython