id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
34268
<gh_stars>1-10 import os os.system('mkdir -p LOG') for i in range(8): os.system('./zk_proof SHA256_64_merkle_' + str(i + 1) + '_circuit.txt SHA256_64_merkle_' + str(i + 1) + '_meta.txt LOG/SHA256_' + str(i + 1) + '.txt')
StarcoderdataPython
1753732
<reponame>mkoryor/Python<filename>arrays & strings/zeroesFront.py '''(Partitioning Arrays): You are given an array of integers. Rearrange the array so that all zeroes are at the beginning of the array. For example, [4,2,0,1,0,3,0] -> [0,0,0,4,1,2,3]''' def swap(arr, i, j): arr[i], arr[j] = arr[j], arr[i] def...
StarcoderdataPython
3393431
<filename>maps/cleaner.py def get_lang(data): # maps data cleaner # function # Geocode(location) # bad arrays are bad and ireadble for x in data: if def get_long(data):
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
4822748
<reponame>changwmyung/AutoForce import numpy as np from theforce.descriptor.radial_funcs import quadratic_cutoff as radial from theforce.descriptor.sesoap import SeSoap import torch from torch.autograd import Function lmax, nmax, rc = 4, 4, 3. NumpySoap = SeSoap(lmax, nmax, radial(rc)) class TorchSoap(Function): ...
StarcoderdataPython
4824330
<filename>django_ilmoitin/utils.py import logging from collections import namedtuple from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.utils.html import strip_tags from jinja2 import DebugUndefined, StrictUndefined from jinja2.exceptions import TemplateError from jinja2.s...
StarcoderdataPython
1664515
from protocol import make_response from actions import actionnames def default_handler(request): action_target = request.url response = make_response(404, 'not found', 'ooops') for action in actionnames: # Поиск контроллера if action['actions'] == action_target: return action['contr...
StarcoderdataPython
73677
#!/usr/bin/python # # # # # <NAME> (06 Jun 2017), contact: <EMAIL> import sys import pprint pp = pprint.PrettyPrinter(indent=4) #import ccbg_pipeline.task from ccbg_pipeline import * #print task_status.SUBMITTED #pp.pprint( P ) #print ("Max retry: {}".format( P.max_retry ) ) #P.max_retry = 5 #print ("Max ret...
StarcoderdataPython
112412
<filename>MPU-6050_ct-agent_integration/setup.py<gh_stars>0 import subprocess import zipfile import os for parent, dirs, files in os.walk('ct_addons'): for filename in files: if filename.endswith('.pyc'): filepath = os.path.join(parent, filename) print('removing: ' + filepath) ...
StarcoderdataPython
82748
import sys from flask import request, url_for def test_valid_user(client): print('url_for: {}'.format(url_for('user', id=1))) resp = client.get(url_for('user',id=1)) print('resp: {}'.format(dir(resp))) assert resp.status_code == 200
StarcoderdataPython
33854
# coding: utf-8 """加密算法:公钥(私钥)加密,私钥解密""" from Crypto.PublicKey import RSA from Crypto import Random DATA = 'Hello, word!' PRIVATE_KEY_PEM = """-----<KEY>""" PUBLIC_KEY_PEM = """-----<KEY>""" def _encrypt_by_public(): random_func = Random.new().read public_key = RSA.importKey(PUBLIC_KEY_PEM) encrypted =...
StarcoderdataPython
3394519
<reponame>bahfolkoff/docker-tmuxinator #! /usr/bin/python import subprocess import signal import sys from threading import Lock, Timer from watchdog.observers import Observer from watchdog.events import RegexMatchingEventHandler class EventBurstHandler(RegexMatchingEventHandler): """ Groups filesystem event b...
StarcoderdataPython
16933
import abc import argparse import logging import pathlib from collections import namedtuple from operator import itemgetter import toml class NotConfiguredError(Exception): pass class ParseError(Exception): pass class Model(abc.ABC): """Interface for model that can save/load parameters. Each mod...
StarcoderdataPython
3389312
from multiprocessing import TimeoutError from FreeTAKServer.controllers.FederatedCoTController import FederatedCoTController from FreeTAKServer.model.FTSModel.Event import Event from FreeTAKServer.model.protobufModel.fig_pb2 import FederatedEvent import codecs import socket from FreeTAKServer.model.ServiceObjects.Feder...
StarcoderdataPython
131044
<gh_stars>100-1000 from datetime import time import numpy as np import pytest from pandas._libs.tslibs import timezones from pandas import DataFrame, Series, date_range import pandas._testing as tm class TestAtTime: @pytest.mark.parametrize("tzstr", ["US/Eastern", "dateutil/US/Eastern"]) def test_localized...
StarcoderdataPython
173528
<filename>cirq-google/cirq_google/experimental/noise_models/compare_generated_noise_to_metrics.py # coverage: ignore import cirq_google import numpy as np from cirq.devices.noise_properties import NoiseModelFromNoiseProperties from cirq_google.experimental.noise_models.calibration_to_noise_properties import ( noise...
StarcoderdataPython
3323452
<gh_stars>1-10 from IECore import * class objectDebug( Op ) : def __init__( self ) : Op.__init__( self, "Op that prints out debug information about an object parameter.", ObjectParameter( name = "result", description = "A pass through of the input object parameter.", defaultValue = NullObject(),...
StarcoderdataPython
1747513
<filename>lite/tools/dump_model_mgb.py # -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed...
StarcoderdataPython
3342776
#!/usr/bin/env python import rospy from jsk_rviz_plugins.msg import OverlayMenu rospy.init_node("test_menu") p = rospy.Publisher("test_menu", OverlayMenu) r = rospy.Rate(5) counter = 0 while not rospy.is_shutdown(): menu = OverlayMenu() menu.title = "The Beatles" menu.menus = ["<NAME>", "<NAME>", "<NAME>", ...
StarcoderdataPython
3346580
<reponame>IsaacSmith13/zegend-of-lelda import pygame from src.configuration.configuration import GLOBAL_OBJECT_SIZE class Object(pygame.sprite.Sprite): def __init__(self, collidable, image, x, y, height=GLOBAL_OBJECT_SIZE, width=GLOBAL_OBJECT_SIZE): super().__init__() self.height = height ...
StarcoderdataPython
1724051
import os import csv # Function to remove non Ascii's (Aded this to deal with odd spacing issues) def removeNonAscii(s): return "".join( i for i in s if ord(i) < 126 and ord(i) > 31) # Opens CSV file with write permissions with open('email-actual.csv', 'w') as csvfile: # Goes to lowest level of each fo...
StarcoderdataPython
3282010
from soap.semantics.functions.arithmetic import arith_eval, error_eval from soap.semantics.functions.boolean import bool_eval from soap.semantics.functions.fixpoint import ( fixpoint_eval, unroll_fix_expr, fix_expr_eval ) from soap.semantics.functions.label import label, luts, resource_eval from soap.semantics.func...
StarcoderdataPython
1704186
<gh_stars>0 import configparser import json config = configparser.ConfigParser() config.read("config.ini") def read_json(s): global config config = json.loads(s)
StarcoderdataPython
1725587
WHITELISTED_URIS = frozenset([ 'google.com', 'youtube.com', 'facebook.com', 'baidu.com', 'wikipedia.org', 'tmall.com', 'yahoo.com', 'taobao.com', 'twitter.com', 'sohu.com', 'vk.com', 'amazon.com', 'live.com', 'instagram.com', '360.cn', 'weibo.com', 's...
StarcoderdataPython
3257224
from aiogram.types import Message from aiogram_dialog import DialogManager, StartMode @dp.message_handler(commands=["start"]) async def start(m: Message, dialog_manager: DialogManager): # Important: always set `mode=StartMode.RESET_STACK` you don't want to stack dialogs await dialog_manager.start(MySG.main, mo...
StarcoderdataPython
1641709
import numpy.random as rng def create_random_sets(random_set_options): ''' Retuns a list of parameter sets, in the form of tuples that you can unpack and pass into the run_model function ''' parameter_sets = [] while len(parameter_sets) < random_set_options['Number of Random Sets']: # ...
StarcoderdataPython
1696650
<reponame>MIPS/external-chromium_org # Copyright 2013 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. import time class PageRunnerRepeatState(object): def __init__(self, repeat_options): self.pageset_start_time = N...
StarcoderdataPython
188961
<gh_stars>1-10 import logging import math from typing import Dict, Any, Optional logger = logging.getLogger("conflowgen") def normalize_distribution_with_no_dependent_variable( distribution: Dict[Any, float], context: Optional[Any] = None ) -> Dict[Any, float]: keys, fractions = zip(*distribution...
StarcoderdataPython
1639865
<reponame>lukegao/geek4geek<filename>binarytree/__init__.py<gh_stars>0 # -*- coding: utf-8 -*- """This module is about binary trees."""
StarcoderdataPython
1781632
from django.contrib import admin from gdm.models.tree import Person, Family from gdm.models.timeline import Activity, EventType, Event class PersonAdmin(admin.ModelAdmin): date_hierarchy = 'created' list_filter = ('gender', 'searchable') search_fields = [ 'given_names', 'family_name', 'display_nam...
StarcoderdataPython
157111
<filename>financepy/products/equity/FinEquityBinomialTree.py # -*- coding: utf-8 -*- """ Created on Sun Jul 21 10:04:57 2019 @author: Dominic """ from math import exp, log, sqrt from enum import Enum import numpy as np from numba import jit, njit, float64, int64 from ...finutils.FinError import FinError from ...fin...
StarcoderdataPython
3390600
import os import json import argparse import pprint import requests import xmltodict def post_to_geoevent(json_data, geoevent_url): headers = { 'Content-Type': 'application/json', } response = requests.post((geoevent_url), headers=headers, data=json_data) def main(): parser = arg...
StarcoderdataPython
3355137
<reponame>lucasrmagalhaes/seguranca_informacao-py import webbrowser from tkinter import * root = Tk( ) root.title('Abrir Browser') root.geometry('300x200') def google(): webbrowser.open('https://www.google.com.br/') mygoogle = Button(root, text='Abrir o Google', command=google).pack(pady=20) root.mainloop()
StarcoderdataPython
121327
from concurrent import futures from functools import partial from itertools import product import os import numpy as np from pyx import color, deco, graph, path, text def mandelbrot_iteration(niter, *args): nx, ny, c = args[0] z = np.zeros_like(c) for n in range(niter): z = z**2+c return nx, ny...
StarcoderdataPython
1757684
import magic from ..linktofile import TG from pyrogram.types import Message from pyrogram.errors import RPCError import time from .display import progress from .tools import video_details async def file_send(filename: str, client: TG, updates: Message, message: Message): _now = time.time() file_mime = magic.M...
StarcoderdataPython
103887
import os from pyspark_tooling.emr import EMR from pyspark_tooling.timestamp import format_timestamp, utcnow class IntegrationTest: def __init__(self): self.bucket = os.environ["INTEGRATION_TEST_BUCKET"] self.folder = f"landing_timestamp={format_timestamp(utcnow())}" self.s3_path = f"s3://...
StarcoderdataPython
3247525
import sys import numpy as np import matplotlib.pyplot as plt from collections import namedtuple def get_size(obj, seen=None): """Recursively finds size of objects""" # this is old code # size = sys.getsizeof(obj) # this is modified to properly work with ndarray views size = 0 if not isinstan...
StarcoderdataPython
1768703
import networkx as nx import graph_embeddings_library as gel from Analysis.aggregate_data.data_aggregation_tools import create_graph_from_AS_relationships graph = nx.Graph() method = 'node2vec' if method == 'example': graph = nx.Graph() graph.add_nodes_from(['a', 'b', 'c']) method = 'example' dict_arg...
StarcoderdataPython
3292002
<gh_stars>1-10 import hashlib from flask import abort from params import PI_ALLOWED_NETWORKS, PI_USE_PROXY_IP import os import sys from datetime import timedelta # Decorators def action(route, template='', methods=['GET']): """Decorator to create an action""" def real_decorator(function): function.p...
StarcoderdataPython
1722588
<filename>tasks/__init__.py from .subprocess import execute_run, scout_run from .git_config import git_config
StarcoderdataPython
1776970
# Welcome to the SmartSim setup.py # # The following environment variables represent build time # options for SmartSim. These are only relevant to when a user # or CI is invoking the setup.py script. # # # NO_CHECKS # If set to 1, the build process will not check for # build dependencies like make, gcc, etc # # SMA...
StarcoderdataPython
1704062
from . import pycodestyle if __name__ == '__main__': pycodestyle.MAX_LINE_LENGTH = 120 pycodestyle._main()
StarcoderdataPython
1645161
import numpy as np import tensorflow as tf def encoder_linear(input_shape, latent_dim): """Fully connected linear encoder.""" return tf.keras.Sequential( [ tf.keras.layers.InputLayer(input_shape=input_shape), tf.keras.layers.Flatten(), tf.keras.layers.Dens...
StarcoderdataPython
4841453
<filename>check.py e.name("put the song from the movie rx100")
StarcoderdataPython
49727
from django.apps import AppConfig from django.conf import settings class myrootConfig(AppConfig): """ Class to call our 'myroot' app structural name """ name = settings.APP_LABEL_MYROOT
StarcoderdataPython
178093
import contextlib from sqlalchemy.pool import NullPool from simpleutil.common.exceptions import InvalidArgument from simpleutil.utils import argutils from simpleutil.utils import attributes from simpleservice.ormdb.api import model_query from simpleservice.ormdb.argformater import connformater from simpleservice.ormd...
StarcoderdataPython
3251860
import pytest import os import numpy as np from autode.wrappers.G09 import G09, print_custom_basis, get_keywords, n_ecp_elements from autode.wrappers.G16 import G16 from autode.calculation import Calculation, CalculationInput, Constraints from autode.species.molecule import Molecule from autode.wrappers import keywords...
StarcoderdataPython
114481
import pycounter.sushi import datetime weekdays = {1:"Mon",2:"Tue",3:"Wed",4:"Thu",5:"Fri",6:"Sat",7:"Sun"} START = datetime.date(2015,1,1) END = datetime.date(2015,4,15) RID = "b29daa24-cc02-4760-8694-3084f90445a7" CR = "X054213" REP = "JR1" REL = 4 COUNTERREP = pycounter.sushi.get_report(wsdl_url="http://sushi4.schol...
StarcoderdataPython
5168
<reponame>dpedrosac/DBSgait<gh_stars>1-10 import numpy as np import pandas as pd from scipy.stats import f_oneway from typing import Dict, Tuple, Set def extract_significant_p(df: pd.DataFrame, p_value_limit: float): """Return a df, which replaces values that are above p_value_limit with `None`""" return ( ...
StarcoderdataPython
191554
<reponame>glosophy/Time-Series<gh_stars>0 import numpy as np def corr_coef(x,y): '''It returns the correlation coefficient for two given datasets''' x_mean = np.mean(x) y_mean = np.mean(y) numerator = np.sum((x - x_mean) * (y - y_mean)) denominator = np.sqrt(np.sum((x - x_mean)*(x - x_mean))...
StarcoderdataPython
1793071
from tvm import relay import tvm from collage.pattern_manager.utils import is_function_node from collage.pattern_manager.cost_func import * from collage.optimizer.custom_fusion_pass import CustomFusionPass from workloads.torch_workloads import get_network_from_torch from workloads.relay_workloads import get_network_fro...
StarcoderdataPython
3332639
from django import forms from django.conf import settings from django.core.exceptions import ImproperlyConfigured from .models import Company, Office from .widgets import AddressWidget if not settings.GOOGLE_ADDRESS['API_KEY']: raise ImproperlyConfigured("GOOGLE_API_KEY is not configured in settings.py") class ...
StarcoderdataPython
1676955
<reponame>richung99/digitizePlots # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Utility routines for working with points and affine transforms """ import numpy as np from functools import reduce class AffineError(ValueError): """ Errors in c...
StarcoderdataPython
1693015
<filename>gallery/tests.py from django.test import TestCase from .models import Location, Category, Image # Create your tests here. class LocationTestClass(TestCase): """ Tests Location class and its functions """ #Set up method def setUp(self): self.locale = Location(id='1',location='ugan...
StarcoderdataPython
32074
<reponame>micnncim/spinnakerbot from .handler import Handler from .pull_request_event import GetPullRequest, GetRepo format_message = ('We prefer that non-test backend code be written in Java or Kotlin, rather ' + 'than Groovy. The following files have been added and written in Groovy:\n\n' + '{}\n\n' ...
StarcoderdataPython
1761865
<gh_stars>0 """ Usage: testDocopt.py [-varh] [FILE] ... testDocopt.py (-left|-right) CORRECTION FILE Arguments: FILE optional input file CORRECTION correction angle,nedds FILE, --left or --right to be present Options: -h --help show this -v verbose mode -q quite mode...
StarcoderdataPython
8518
########################################################################## # # Copyright 2014 VMware, Inc # Copyright 2011 <NAME> # All Rights Reserved. # # 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 t...
StarcoderdataPython
1610201
from plotext._utility.plot import get_labels from plotext._utility.data import linspace, get_lim ############################################## ############ Bar Functions ############## ############################################## def update_bars(x, bars, offset): # it updates the bar coordinates using the pas...
StarcoderdataPython
1730588
''' * SEARCHABLE NODE STRUCTURE FOR MINIMAX / ALPHABETA SEARCH ''' from Evaluation.Policies import Evaluation from DepreciatedBoard.Board import Board from copy import deepcopy from math import inf ''' DEPRECIATED CLASS -- SWITCHED TO UNDOMOVE APPROACH ''' class Node(object): def __init__(self, board, colour):...
StarcoderdataPython
3399275
<reponame>ckarageorgkaneen/pybpod-api # !/usr/bin/python3 # -*- coding: utf-8 -*- import logging import math import socket import sys from confapp import conf as settings from datetime import datetime as datetime_now from pybpodapi.bpod.hardware.hardware import Hardware from pybpodapi.bpod.hardware.channels import Ch...
StarcoderdataPython
68828
#!/usr/bin/env python # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
StarcoderdataPython
3399934
# how to reload in Python, # like testapi.c does in C import testapi, traceback for i in range(5): try: reload(testapi) res = testapi.func(4, 8) except: print 'error' traceback.print_exc() else: print res if i < 4: raw_input('change testapi.py now...')
StarcoderdataPython
188123
<reponame>tohsato-lab/T-MCD import itertools import numpy as np from progressbar import progressbar import torch import torch.nn.functional as f import torch.optim as optim from torchsummary import summary from core.evaluate import Evaluate from module.torch import metrics from module.torch.logger import Logger impor...
StarcoderdataPython
50320
from async_signalr_client.models.messages.base import BaseSignalRMessage from async_signalr_client.models.messages.types import SignalRMessageType class CancelInvocationMessage(BaseSignalRMessage): def __init__(self, invocation_id: str): super().__init__(SignalRMessageType.CANCEL_INVOCATION) self....
StarcoderdataPython
186764
import pylayers.simul.simultraj as st from pylayers.measures.cormoran import * import numpy as np # load CorSer 6 (default) C = CorSer(serie=6,day=11) # create a Simulation from CorSer motion capture file S = st.Simul(C,verbose=True) # create a dictionnary from links llinks = S.N.links['ieee802154'] link={'ieee802154...
StarcoderdataPython
3259982
<filename>TemperaturesAnalysis/main.py #!/usr/bin/env python 3 # -*- coding: utf-8 -*- # открыть документ со значениями температур за промежуток времени 1tempdata.txt # найти макс., мин. и среднюю температуры # найти общее количество значений температур # найти количество уникальных значений температур # найти количес...
StarcoderdataPython
109712
#@+leo-ver=5-thin #@+node:ekr.20181009072707.1: * @file ../../run_travis_unit_tests.py # -*- coding: utf-8 -*- import os import sys import unittest from leo.core import leoBridge load_dir = os.path.abspath(os.path.dirname(__file__)) test_dir = os.path.join(load_dir, 'leo', 'test') path = os.path.join(test_dir, 'unitTe...
StarcoderdataPython
66669
# Copyright (c) 2019 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
StarcoderdataPython
3222674
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
StarcoderdataPython
1782864
import FWCore.ParameterSet.Config as cms l1RctValidation = cms.EDAnalyzer("L1RCTRelValAnalyzer", rctRegionsLabel = cms.InputTag("rctDigis"), rctEmCandsLabel = cms.InputTag("rctDigis") )
StarcoderdataPython
3218802
"""Provides conversion between polar and cartesian coordinates.""" import numpy from fframework import asfunction, OpFunction __all__ = ['Polar2Cartesian', 'Cartesian2Polar'] class Polar2Cartesian(OpFunction): """Computes cartesian 2D coordinates from 2D polar coordinates.""" def __init__(self, mesh=None): ...
StarcoderdataPython
3218325
<filename>src/spoilers/salt_pepper.py import numpy as np import PIL from dice_roller import roll_value from spoilers.abstract_filter import AbstractFilter class SaltPepper(AbstractFilter): DEF_RATIO = 0.5 DEF_AMOUNT = 0.05 def __init__(self, ratio=DEF_RATIO, amount=DEF_AMOUNT, **kwargs): super(S...
StarcoderdataPython
28974
import pandas as pd import numpy as np function2idx = {"negative": 0, "ferritin": 1, "gpcr": 2, "p450": 3, "protease": 4} input_dir = '../data/raw/' data_dir = '../data/processed/' max_seq_len = 800 def read_and_concat_data(): df_cysteine = pd.read_csv(input_dir + 'uniprot-cysteine+protease+AND+reviewed_yes.tab...
StarcoderdataPython
3215605
import logging from drf_yasg.utils import swagger_auto_schema from rest_framework import status from rest_framework.generics import CreateAPIView, DestroyAPIView from rest_framework.response import Response from safe_transaction_service.history.models import SafeContract from . import serializers from .models import...
StarcoderdataPython
3256290
<reponame>anshul2807/Automation-scripts import time import webbrowser import schedule import pyautogui url1 = "https://meet.google.com" url2 = "https://www.google.com" def attend_class(url): webbrowser.open(url1) time.sleep(3) print("Joining Class") time.sleep(2) pyautogui.hotkey('command', 'd')...
StarcoderdataPython
3390779
""" ASGI config for djangoProject project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application asgi_application = get_asgi_ap...
StarcoderdataPython
1695379
<filename>ts/metrics/metric_collector.py<gh_stars>1-10 """ Single start point for system metrics and process metrics script """ import logging import sys from ts.metrics import system_metrics from ts.metrics.process_memory_metric import check_process_mem_usage if __name__ == '__main__': logging.basicConfig(str...
StarcoderdataPython
50679
<reponame>animeshsrivastava24/OPEN_CV """Here we will create a window whose size can be controlled and changed, if we specify flag to be cv2.WINDOW_NORMAL, you can resize window. It will be helpful when image is too large in dimension and adding track bar to windows.""" import numpy as np import cv2 a=cv2.imread('/home...
StarcoderdataPython
169751
"""Bulk delete test functions.""" from unittest import TestCase from companion.api import deletebulk, util from . import create_test_data, es_url class TestDeleteByQuery(TestCase): def setUp(self): self.client = util.get_client(es_url) def test_empty_arguments(self): """It should require u...
StarcoderdataPython
1680825
<filename>table_recognition/lmdb_maker.py<gh_stars>100-1000 import os import cv2 import glob import lmdb import time import pickle import random import logging import argparse import numpy as np def line_operation(line): """ Do something of line. :param line: :return: """ return line def get_...
StarcoderdataPython
92339
# Author: <NAME> # Email: <EMAIL> # License: MIT License from functools import wraps class Checks: def __init__(self): super().__init__() self.setup_ok = False def setup(func): @wraps(func) def wrapper(self, study_id, model_id): func(self, study_id, model_id) ...
StarcoderdataPython
4828670
<reponame>Singularity-AI/FCN.tensorflow import os import cv2 import pdb import json import glob import h5py import time import random import logging import argparse import functools import threading import numpy as np import pandas as pd import tensorflow as tf from PIL import Image from PIL import Im...
StarcoderdataPython
1783931
<reponame>yoshson/workbench from django.urls import re_path from workbench import generic from workbench.accounts.features import controlling_only from workbench.invoices.forms import RecurringInvoiceForm, RecurringInvoiceSearchForm from workbench.invoices.models import RecurringInvoice from workbench.invoices.views i...
StarcoderdataPython
27640
<filename>Learn/30-Days-Of-Code/Day 28/regexdb.py N = int(input().strip()) names = [] for _ in range(N): name,email = input().strip().split(' ') name,email = [str(name),str(email)] if email.endswith("@<EMAIL>"): names.append(name) names.sort() for n in names: print(n)
StarcoderdataPython
153955
import os import json from string import Template from functools import total_ordering import argparse from os import path def generate(sitedir, siteBaseUrl, codeBaseUrl, logoPath): versions = loadVersions(sitedir) print(versions.asList()) generateVersions(sitedir, versions) generateIndex(sitedir, siteBaseUrl, ver...
StarcoderdataPython
4831550
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-09-10 20:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('whowlong', '0007_auto_20180910_2232'), ] operations = [ migrations.AlterFi...
StarcoderdataPython
1703154
<gh_stars>100-1000 import homeassistant.helpers.config_validation as cv import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_NAME, CONF_PASSWORD, CONF_RESOURCES, CONF_SCAN_INTERVAL, ...
StarcoderdataPython
1685174
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np import model import matplotlib.pyplot as plt import matplotlib.image as mpimg import datetime import tensorflow as tf from tensorflow.python.platform import gfile flags = tf.app.fla...
StarcoderdataPython
1717893
<filename>data_construction/check_links.py import pandas as pd from tqdm import tqdm import urllib.request import requests tqdm.pandas() dataset_good = pd.read_csv('./malicious_urls_2.csv').sample(frac=1, random_state=42).iloc[40000: , :].head(21000).drop_duplicates() # .iloc[200000: , :] def check_if_url_is_active(u...
StarcoderdataPython
1779364
""" Tests for execution module of NSX-T Segment """ from unittest.mock import patch import saltext.vmware.modules.nsxt_policy_segment as nsxt_policy_segment from saltext.vmware.utils import nsxt_request _mock_segment = { "type": "DISCONNECTED", "overlay_id": 75005, "transport_zone_path": "/infra/sites/def...
StarcoderdataPython
3280919
from flask import Blueprint, request, make_response, jsonify from flask.views import MethodView from functools import wraps import datetime from project.server import bcrypt, db from project.server.models import User, Work, Version, BlacklistToken from flask_cors import cross_origin work_blueprint = Blueprint('work',...
StarcoderdataPython
175537
<filename>Fuzzy/fuzzy.py import torch import numpy as np from skfuzzy.membership import trimf class Activations: """ Regular activation functions used in the module are defined here. The activation functions used are: * Sigmoid * Relu * Swish * Leaky Relu * tanh ...
StarcoderdataPython
1654309
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
StarcoderdataPython
151144
"""BERT finetuning runner.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import logging import glob import math import json import argparse from tqdm import tqdm, trange from pathlib import Path import numpy as np import torch from...
StarcoderdataPython
3351513
<gh_stars>1-10 #!/usr/bin/env python # # Copyright 2001 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
StarcoderdataPython
1631856
<reponame>laiy/rdir<gh_stars>1-10 #!/usr/bin/python # coding: utf-8 __author__ = 'lhfcws' from setuptools import setup, find_packages setup( name="rdir", version="0.45", description="More powerful recursive dir. Support HTML pretty view in tree structure.", author="<NAME>", author_email=...
StarcoderdataPython
99472
import logging import sys from cliff.command import Command from ActivityEvent import ActivityEvent this = sys.modules[__name__] this.types = ["cycle","sleep","run"] this.units = ["km","min"] this.timeout = 86400 # 1 day class Start(Command): "Start an activity. Give activity type as argument. Only one activity ...
StarcoderdataPython
1771632
<gh_stars>0 from datetime import timedelta from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.utils.dates import days_ago # These args will get passed on to each operator # You can override them on a per-task basis during operator initialization task_default_args = { 'ow...
StarcoderdataPython
196464
<gh_stars>10-100 from django.shortcuts import redirect, render, get_object_or_404 from django.views import View from django.contrib import messages from classroom.models import ClassRoom, MemberShip from profiles.models import Teacher, Student from django.utils.decorators import method_decorator from django.contrib.aut...
StarcoderdataPython
89332
<gh_stars>1-10 class Solution: def numIslands(self, grid: 'List[List[str]]') -> 'int': if not grid: return 0 no_lines = len(grid) no_cols = len(grid[0]) def solve(line_idx, col_idx): grid[line_idx][col_idx] = '-1' queue = [(line_idx, col_idx)] ...
StarcoderdataPython