id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
129547
from opera.parser.yaml.node import Node from .constraint_clause import ConstraintClause from .property_definition import PropertyDefinition from ..entity import TypeEntity from ..list import List from ..map import Map from ..reference import DataTypeReference class DataType(TypeEntity): REFERENCE = DataTypeRefere...
StarcoderdataPython
3262300
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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 a...
StarcoderdataPython
35614
<reponame>imesut/alfred-yeelight-pbc import json, yeelight, sys from utils import get_alfred_object, bulb, bulb_properties, current_brightness current_brigthness_index = round(int(current_brightness)/10) brightness_list = [0,10,20,30,40,50,60,70,80,90,100] brightness_list = brightness_list[current_brigthness_index:] +...
StarcoderdataPython
3280512
<reponame>jotelha/dtool-ecs import os from . import TEST_SAMPLE_DATA from . import tmp_uuid_and_uri # NOQA from . import tmp_uuid_and_uri_from_second_namespace # NOQA def test_basic_workflow_on_first_namespace(tmp_uuid_and_uri): # NOQA uuid, dest_uri = tmp_uuid_and_uri from dtoolcore import ProtoDataSet,...
StarcoderdataPython
1749752
dict( source= ['/home/lvapeab/smt/tasks/emea/fren/NMT/DATA/fr.binarized_text.shuffled.h5'], target= ['/home/lvapeab/smt/tasks/emea/fren/NMT/DATA/en.binarized_text.shuffled.h5'], indx_word= '/home/lvapeab/smt/tasks/emea/fren/NMT/DATA/fr.ivocab.pkl', indx_word_target='/home/lvapeab/smt/tasks/emea/fr...
StarcoderdataPython
3214716
from collections import deque def bfs(graph, start = None): if(graph): if(not start): start = next(iter(graph)) explored_nodes = {} dq = deque([start]) while(dq): current_node = dq.popleft() print(current_node) if(current_node in explo...
StarcoderdataPython
59036
<filename>fileCleaner.py import os import time import send2trash import subprocess import argparse import sys import getpass import mysql.connector class Bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\03...
StarcoderdataPython
82255
<reponame>sparkfun/Qwiic_AS6212_Py<gh_stars>0 #!/usr/bin/env python #----------------------------------------------------------------------------- # Example_01_BasicReadings.py # # Simple Example for the Qwiic AS6212 Device #------------------------------------------------------------------------ # # Written by <NAME>,...
StarcoderdataPython
123241
import time from oeqa.oetest import oeRuntimeTest from oeqa.utils.helper import shell_cmd_timeout class RebootTest(oeRuntimeTest): '''Reboot target device @class RebootTest ''' def setUp(self): '''pre condition check @fn setUp @param self @return ''' self...
StarcoderdataPython
1798092
# Generated by Django 2.1.8 on 2019-06-24 10:04 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('api', '0017_unityobject_type'), ] operations = [ migrations.AlterField( model_name='imperium', ...
StarcoderdataPython
3209168
from django.urls import include, path from rest_framework import routers from rest_framework.urlpatterns import format_suffix_patterns # local imports from . import views router = routers.DefaultRouter() app_name = 'profiles' urlpatterns = [ path('profiles/', views.ProfileApiView.as_view(), name='profile'), ...
StarcoderdataPython
3315647
<reponame>mheanng/PythonNote<filename>docs/02.AI_ML/code-1905/day07/demo11_star.py """ demo11_star.py star特征点检测器 """ import cv2 as cv original = cv.imread('../ml_data/table.jpg') cv.imshow('Original', original) gray = cv.cvtColor(original, cv.COLOR_BGR2GRAY) cv.imshow('Gray', gray) star = cv.xfeatures2d.StarDetector_c...
StarcoderdataPython
50028
<filename>PBO_ 18130/tugas_4.1.py a = [1,2,3] print(a) a.append(5) print(a) list1=[1,2,3,4,5] list2=['rambutan','langsa','salak','durian','apel'] list1.extend(list2) c = [1,2,3] print(c) c.insert(0,12) print(c) ### Perbedaan antara fungsi Append,extend,dan insert # append berfungsi untuk menambahkan elemen ke da...
StarcoderdataPython
4801282
<reponame>gaocegege/treadmill """Implementation of allocation API. """ import collections import errno import glob import logging import os import tarfile import threading import json from treadmill import exc from treadmill import appenv from treadmill import logcontext as lc from treadmill import rrdutils _LOGGER...
StarcoderdataPython
3394429
<reponame>exepulveda/gslibutils<gh_stars>0 from typer.testing import CliRunner from gslibutils.gslib2csv import app runner = CliRunner() def test_app_stdout(): inputfile = "data/simple.gslib" result = runner.invoke(app, [inputfile]) assert result.exit_code == 0 csv_content = result.stdout.splitlines...
StarcoderdataPython
3263811
# -*- coding: utf-8 -*- # see LICENSE.rst """Tests for :mod:`~trackstream`.""" __all__ = [ "init_tests", "streamtrack_tests", "trackstream_tests", ] ############################################################################## # IMPORTS # LOCAL from . import test_init as init_tests from . import test_...
StarcoderdataPython
170942
<reponame>advancedxy/bigflow_python # # Copyright (c) 2015 Baidu, 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
3206045
<filename>Python3/462.minimum-moves-to-equal-array-elements-ii.py # # @lc app=leetcode id=462 lang=python3 # # [462] Minimum Moves to Equal Array Elements II # # @lc code=start class Solution: def minMoves2(self, nums: List[int]) -> int: l = 0 r = len(nums) - 1 ans = 0 nums.sort() ...
StarcoderdataPython
3205215
<filename>haveaniceday/tables_of_month/models.py from django.db import models # Create your models here. class TableOfMonth(models.Model): author = models.CharField(max_length=20) confirm = models.CharField(max_length=20, blank=True) date = models.DateField() notes = models.TextField(blank=True, defau...
StarcoderdataPython
1740780
<reponame>dascw/velib_python<gh_stars>0 PATH = 0 VALUE = 1 MINIMUM = 2 MAXIMUM = 3 # Simulates the SettingsSevice object without using the D-Bus (intended for unit tests). Values passed to # __setitem__ (or the [] operator) will be stored in memory for later retrieval by __getitem__. class MockSettingsDevice(object):...
StarcoderdataPython
198003
# Copyright 2018 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
3260567
import decimal from rply import ParserGenerator from propose.ast import * class Parser: def __init__(self): self.pg = ParserGenerator( ['->', '<->', '+', '*', '!', '(', ')', 'false', 'true', 'xor', 'LITERAL'], precedence=[ ('left', ['<->']), ('left'...
StarcoderdataPython
3320280
<reponame>talhakoylu/SummerInternshipBackend from school.models.school_model import School from rest_framework import serializers from rest_framework.serializers import ModelSerializer from school.models.class_model import Class from account.models.instructor_model import InstructorProfile from django.contrib.auth impo...
StarcoderdataPython
129131
import unittest import numpy as np import time import uuid from arch.api import session from federatedml.param.intersect_param import IntersectParam class TestRsaIntersectGuest(unittest.TestCase): def setUp(self): self.jobid = str(uuid.uuid1()) session.init(self.jobid) from feder...
StarcoderdataPython
60846
import functools def intersection(group): return len( functools.reduce( lambda acc, cur: acc.intersection(set(cur)), group, set(group[0]) ) ) with open("input/06.input") as f: all = [line.split("\n") for line in f.read().strip().split("\n\n")] groups = [intersection(group...
StarcoderdataPython
4808336
<gh_stars>0 from graphic_coloring_engine.core import Color, Coordinate, DominantColor, Layer, Layout from shapely.geometry.multipolygon import MultiPolygon from shapely.geometry.polygon import Polygon from snapshottest import TestCase class TestLayout(TestCase): bg_coord = Coordinate( xmin=0, xmax...
StarcoderdataPython
1697467
# -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2014 Kozea # # This library is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version...
StarcoderdataPython
1632965
<gh_stars>1-10 """Set of constructs for making Serverless based Relational DBs """ from enum import Enum from typing import Any from core.constructs.resource import ( Resource, ResourceModel, ResourceOutputs, update_hash, PermissionsAvailableMixin, ) from core.constructs.cloud_output import Cloud...
StarcoderdataPython
3242743
SECRET_KEY = 'SECRET' STATIC_ROOT = '.'
StarcoderdataPython
1615271
from ...core.repository.uow import UnitOfWorkManager from ..repository.uow import SQLAUnitOfWorkManager from ._helpers import GamenightModule class RepositoryModule(GamenightModule): def configure(self, binder): binder.bind(UnitOfWorkManager, SQLAUnitOfWorkManager)
StarcoderdataPython
3282258
# -*- encoding: utf-8 -*- # ----- # Created Date: 2020/12/11 # Author: <NAME> # ----- # Last Modified: # Modified By: # ----- # Copyright (c) 2020 MARL @ SJTU # ----- from .base_io_wrapper import BaseIOWrapper from multiprocessing import Queue class QueueIOWrapper(BaseIOWrapper): def __init__(self, in_queue: Que...
StarcoderdataPython
85916
"""This is a somewhat delicate package. It contains all registered components and preconfigured templates. Hence, it imports all of the components. To avoid cycles, no component should import this in module scope.""" import logging import typing from typing import Any, Dict, List, Optional, Text, Type from rasa.nlu ...
StarcoderdataPython
3342104
# -*- coding: utf-8 -*- from os.path import abspath, dirname import re from shellstreaming import api from shellstreaming.istream import RandSentence from shellstreaming.operator import ShellCmd from shellstreaming.ostream import Null, LocalFile OUTPUT_FILE = '/tmp/52_enju.txt' NUM_RECORDS = 100 RECORDS_IN_BATC...
StarcoderdataPython
10207
<filename>tests/test_minimize.py import pytest from iminuit import minimize import numpy as np from numpy.testing import assert_allclose, assert_equal opt = pytest.importorskip("scipy.optimize") def func(x, *args): c = args[0] if args else 1 return c + x[0] ** 2 + (x[1] - 1) ** 2 + (x[2] - 2) ** 2 def grad...
StarcoderdataPython
3281206
<gh_stars>0 # Generated by Django 2.0.3 on 2018-10-23 16:03 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Subway', fields=[ ('id', models...
StarcoderdataPython
1697520
<reponame>LauraCollard/pandas<filename>pandas/tests/test_compat.py """ Testing that functions from compat work as expected """
StarcoderdataPython
3251103
""" Synaplexus Base Model API """ from __future__ import absolute_import import os import sys import json import logging from time import time from datetime import datetime from importlib import import_module from . util import snpx_create_dir, DictToAttrs class SNPXModel(object): """ Base model The base cl...
StarcoderdataPython
3314183
<reponame>sohonisaurabh/robotic-projects<gh_stars>1-10 import matplotlib.pyplot as plt def main(): first_timestamp = -1 x_axis = [] y_axis_laser = [] y_axis_radar = [] laser_ninety_five_line = 5.991 radar_ninety_five_line = 7.815 laser_above_ninety_five_count = 0 radar_above_ninety_five...
StarcoderdataPython
1694022
"""Check for method without self as first argument""" # pylint: disable=useless-object-inheritance from __future__ import print_function class NoSelfArgument(object): """dummy class""" def __init__(truc): # [no-self-argument] """method without self""" print(1) def abdc(yoo): # [no-self-...
StarcoderdataPython
4805167
from .base import * from .blocks import * __all__ = [ "BaseBlock", "MarkdownBlock", "DividerBlock", "FileBlock", "HeaderBlock", "ListBlock", "TableBlock", "KubernetesFieldsBlock", "CallbackBlock", ]
StarcoderdataPython
3346450
<gh_stars>0 from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse from interview.models import Interview from .stats import StatCalculator from .forms import select_form_factory, ListFilterForm import json import logging logger = logging.getLogger(__name__) def detail(request,...
StarcoderdataPython
1691449
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. __all__ = ['read_ini'] import os def read_ini(fp, variables=None, default='DEFAULT', defaults_only=False, ...
StarcoderdataPython
1662522
<gh_stars>0 import os while True: command = input() if command == "End": break data = command.split("-") action, file_name = data[0], data[1] if action == "Create": created_file = open(file_name, "w") created_file.close() elif action == "Add": content = data[2]...
StarcoderdataPython
97606
def get_id(): return 0
StarcoderdataPython
3246308
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # S_Ba...
StarcoderdataPython
3384932
<reponame>acoular/spectacoular # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup ----------------------------------------...
StarcoderdataPython
85774
<filename>det3d/torchie/trainer/hooks/logger/base.py from abc import ABCMeta, abstractmethod from ..hook import Hook class LoggerHook(Hook): """Base class for logger hooks Args: interval (int) ignore_last (bool) reset_flag (bool) """ __metaclass__ = ABCMeta def __init__...
StarcoderdataPython
74221
#!/usr/bin/python # -*-coding:utf-8 -*- u""" :创建时间: 2020/5/18 23:57 :作者: 苍之幻灵 :我的主页: https://cpcgskill.com :QQ: 2921251087 :爱发电: https://afdian.net/@Phantom_of_the_Cang :aboutcg: https://www.aboutcg.org/teacher/54335 :bilibili: https://space.bilibili.com/351598127 """ from .__OpenMaya__ import * from .__OpenMaya_it__ i...
StarcoderdataPython
3279993
<gh_stars>100-1000 from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration import os class RmluiConan(ConanFile): name = "rmlui" description = "RmlUi - The HTML/CSS User Interface Library Evolved" homepage = "https://github.com/mikke89/RmlUi" url = "https://githu...
StarcoderdataPython
20632
import os,sys, re from math import ceil, floor class Gazette: """ Loads and parses municipal gazettes. Attributes: file_path: The string path to a gazette. file: The string containing a gazette's content. city: A string for the city (or cities) of the gazette. date: A st...
StarcoderdataPython
67848
from netbox.tables import columns class PluginButtonsColumn(columns.ActionsColumn): pass
StarcoderdataPython
97777
from flask import Blueprint, render_template, abort HomeController = Blueprint('HomeController', __name__) @HomeController.route('/') def home(): return render_template( 'home.html', title='PythonFlask.Vue.Vuetify1 Template' ) #using System; #using System.Collections.Generic; #using System....
StarcoderdataPython
1778463
from django.contrib import admin from .models import Single_Event, Grouped_Events # Register your models here. admin.site.register(Single_Event) admin.site.register(Grouped_Events)
StarcoderdataPython
125294
<filename>rcsystem/migrations/0025_auto_20200827_1328.py # Generated by Django 3.0.3 on 2020-08-27 10:28 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('rcsystem', '0024_newbooksrating'), ] operations = [ ...
StarcoderdataPython
3370730
# Copyright 2019 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
3218128
import torch from fairseq.models.bart import BARTModel import argparse from pprint import pprint from tqdm import tqdm import os from os.path import join import shutil import time import re import logging import numpy as np import json import random import string import shutil import files2rouge import time def test_...
StarcoderdataPython
1655171
<gh_stars>1-10 from __future__ import division, print_function import sys, argparse, copy, os, re import numpy as np import pandas as pd import json if 'DISPLAY' not in os.environ: import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import seaborn as sns if __name__ == "__main__": #...
StarcoderdataPython
128921
<filename>key_meter_estimation/key_profiles.py """ An assorted collection of Key Profiles """ import numpy as np from scipy.linalg import circulant ### Definitions # List of labels for each key (Use enharmonics as needed) KEYS = ["C","C#","D","Eb","E","F","Gb","G","Ab","A","Bb","B", "Cm","C#m","Dm","D#m","Em"...
StarcoderdataPython
3215410
# Copyright 2015 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
3248705
import pytest from dialogflow_fulfillment import Context def test_get(session): contexts = [ { 'name': f'projects/PROJECT_ID/agent/sessions/{session}/contexts/__system_counters__', # noqa: E501 'parameters': { 'no-input': 0, 'no-match': 0 ...
StarcoderdataPython
3252382
<filename>musicCrawler/baidu.py #!/usr/bin/python # -*- coding: utf-8 -*- import requests, re from bs4 import BeautifulSoup from biplist import * #去除括号及其内容 def handleString(str): out = re.sub('([\(|(][\s\S]+?[\)|)])', '', str) return out pass def handleSongDic(dic, handleDic): singer = handleString...
StarcoderdataPython
3284704
<reponame>felipeek/bullet3<filename>examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py """This file implements the functionalities of a minitaur using pybullet. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path....
StarcoderdataPython
3313230
#Licensed under Apache 2.0 License. #© 2020 Battelle Energy Alliance, LLC #ALL RIGHTS RESERVED #. #Prepared by Battelle Energy Alliance, LLC #Under Contract No. DE-AC07-05ID14517 #With the U. S. Department of Energy #. #NOTICE: This computer software was prepared by Battelle Energy #Alliance, LLC, hereinafter the Cont...
StarcoderdataPython
1772182
<filename>build.py #!/usr/bin/env python3 import os import sys import subprocess sys.dont_write_bytecode = True def run_build(base_folder, build_args=[]): cmd_args = ['mvn', 'package'] + build_args subprocess.call(cmd_args, cwd=base_folder) def rename_jar(new_jar_suffix): curr_script_dir = os.path.dirname(os.path...
StarcoderdataPython
3382514
###################################################################### ## TFL_Prepare_Review_Package.py ## Purpose: 1. Create polygon features for the areas of change ## 2. Create a TFL review map from template that highlights line and ## area changes ## 3. Request summary text and create...
StarcoderdataPython
3270106
<reponame>themech/Tensorflow-Image-Classification DATASETSDIR = 'datasets'
StarcoderdataPython
89452
<reponame>DanielSola/bitcoin-analysis import unittest from utils import get_all_block_transactions from .expected_values import expected_number_of_transactions class TestGetAllBlockTransactions(unittest.TestCase): def setUp(self): self.blocks_file_path = './data/blocks.json' self.result_dict = get_all...
StarcoderdataPython
1662529
<filename>parflow_data_management/transport/connections/connection.py<gh_stars>0 # Abstract representation of a connection to a cluster class Connection(object): def execute(self, command): raise NotImplementedError("Implemented by subclass") def __enter__(self): raise NotImplementedError("Impl...
StarcoderdataPython
96833
<reponame>wtayyeb/hikaru # # Copyright (c) 2021 Incisive Technology Ltd # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use...
StarcoderdataPython
3364482
import json import pathlib import sys from google.protobuf import json_format sys.path = [p for p in sys.path if not p.endswith('bazel_tools')] from tools.config_validation import validate_fragment from tools.protodoc import manifest_pb2 from tools.protodoc.protodoc_manifest_untyped import data as protodoc_manifest_...
StarcoderdataPython
1781166
from grpc.beta import implementations import numpy as np import tensorflow as tf from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_service_pb2 hostport = 'localhost:9000' def do_prediction(hostport): # Create connection host, port = hostport.split(':') channel = im...
StarcoderdataPython
1744464
# Copyright (c) 2019 NVIDIA Corporation from typing import Optional, List from pytorch_transformers import (BertConfig, BertModel, BERT_PRETRAINED_MODEL_ARCHIVE_MAP, BERT_PRETRAINED_CONFIG_ARCHIVE_MAP) from nemo.back...
StarcoderdataPython
104547
<reponame>litrin/Tornado-Fram-Work __all__ = ['cFRIENDSEARCH', 'cDEFAULT']
StarcoderdataPython
4833238
<reponame>finswimmer/clikit<filename>src/clikit/__init__.py from .api.config.application_config import ApplicationConfig from .config.default_application_config import DefaultApplicationConfig from .console_application import ConsoleApplication __version__ = "0.4.1"
StarcoderdataPython
1773825
<filename>dnsbrute.py #!usr/bin/python #DNS Brute Forcer, uses wordlist to find subdomains. #http://www.darkc0de.com #d3hydr8[at]gmail[dot]com import threading, time, random, sys, socket from copy import copy if len(sys.argv) !=3: print "Usage: ./dnsbrute.py <server> <wordlist>" sys.exit(1) try: words = open(sy...
StarcoderdataPython
3270452
<reponame>FormatMemory/django_api_backend<gh_stars>0 from django.shortcuts import get_object_or_404 from rest_framework.response import Response from rest_framework.views import APIView from v1.accounts.models.user import User from v1.credits.models.wallet import Wallet from v1.credits.serializers.wallet import WalletS...
StarcoderdataPython
64265
import os target_path = 'groundtruths' mirror_path = 'detections' files = [] for (dirpath, dirnames, filenames) in os.walk(target_path): if len(dirnames) == 0: files.extend([f_name for f_name in filenames]) # print(files[:10]) for filename in files: mirror = os.path.join(mirror_path, filename) if...
StarcoderdataPython
1691334
#insert token here token = '<insert token here>'
StarcoderdataPython
118747
r""" ***** Array ***** .. autofunction:: is_all_equal .. autofunction:: is_all_finite .. autofunction:: is_crescent """ from numpy import asarray, isfinite, mgrid, prod, rollaxis from numpy import sum as _sum from numpy import unique as _unique try: from numba import boolean, char, float64, int32, int64, jit ...
StarcoderdataPython
3235203
from django.urls import path from . import views urlpatterns = [ path('', views.overview, name='overview'), path('similarity', views.similarity, name='similarity'), ]
StarcoderdataPython
3308669
<gh_stars>1000+ # Copyright (c) 2010. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) #!/bin/env python from sys import argv from time import sleep import httplib2 as httplib from subprocess...
StarcoderdataPython
3323121
#!/usr/bin/env python3 import click import os import pytest @pytest.fixture() def ctx(): command = click.command() ctx = click.Context(command, allow_extra_args=True, allow_interspersed_args=True, ignore_unknown_options=True) return ...
StarcoderdataPython
3251128
# Generated by Django 4.0.3 on 2022-03-20 14:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Myneighbor', '0007_business_user'), ] operations = [ migrations.DeleteModel( name='Business', ), ]
StarcoderdataPython
155535
import multiprocessing from collections import deque import threading def execute_block(session, args): try: env = session.env except: session.env = Environment(session) env = session.env env.deque.append(args) print(threading.enumerate()) print(threading.current_thre...
StarcoderdataPython
109025
<reponame>SuperIlu/jSH import sys import re if len(sys.argv) < 3: print("Usage:\n {} <template> <infile> <outfile>".format(sys.argv[0])) exit(1) fd = re.compile(r"(js_\w*)\([^;]*;") with open(sys.argv[1], "r") as template: with open(sys.argv[2], "r") as infile: with open(sys.argv[3], "w") as out...
StarcoderdataPython
1732780
<filename>problems/401.Binary_Watch/li_daily.py<gh_stars>0 # Han, Python 35ms beats 99% # Brute Force class Solution(object): dict = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: []} for h in range(12): for m in range(60): dict[(bin(h) + bin(m)).count('1')].append('%d:%02d' %...
StarcoderdataPython
3330073
<gh_stars>1000+ # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import numpy as np import matplotlib.pyplot as plt from HelperClass.NeuralNet_1_2 import * from Level3_ShowBinaryResult import * file_name = "../../data...
StarcoderdataPython
106656
<gh_stars>1-10 import logging from functools import wraps red = '\x1b[31m{}\x1b[0m' def makeSimpleLogger(name, level=logging.INFO): logger = logging.getLogger(name) logger.setLevel(level) ch = logging.StreamHandler() # FileHander goes to disk fmt = ('[%(asctime)s] - %(levelname)8s - ' '%(...
StarcoderdataPython
1726255
<filename>djangorestproject/languages/views.py from django.shortcuts import render from rest_framework import viewsets, permissions from django.http import HttpResponse from django.shortcuts import get_object_or_404 from rest_framework.views import APIView from rest_framework.response import Response from rest_framewor...
StarcoderdataPython
170252
<gh_stars>0 # Generated by Django 3.2.9 on 2021-11-02 22:27 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
StarcoderdataPython
128395
from selenium.webdriver import Firefox url = 'http://selenium.dunossauro.live/aula_05_c.html' firefox = Firefox() firefox.get(url) def melhor_filme(browser, filme, email, telefone): """Preenche o formulário do melhor filme de 2020.""" browser.find_element_by_name('filme').send_keys(filme) browser.find...
StarcoderdataPython
3339746
<reponame>jdvelasq/techMiner<filename>techminer/gui/associaation_analysis.py def APP(app_title, tab_titles, tab_widgets, tab=None): """Jupyter Lab dashboard. """ if tab is not None: return AppLayout( header=widgets.HTML( value="<h1>{}</h1><hr style='height:2px;border-wid...
StarcoderdataPython
3373941
<filename>overlay_on_map.py<gh_stars>1-10 import matplotlib.pyplot as plt import numpy as np from gaussian_plume_model import x,y,C1 def overlay_on_map(): import scipy.io as sio # Overlay concentrations on map plt.ion() mat_contents = sio.loadmat('map_green_lane') plt.figure() plt.imshow(mat_c...
StarcoderdataPython
1710323
<filename>threesum_closest_16.py class Solution(object): def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ length = len(nums) if length <= 3: return sum(nums) nums.sort() print nums...
StarcoderdataPython
14078
<reponame>lucaschatham/lambdata<filename>helper_functions_class.py """ Here are two different functions used for common data cleaning tasks. You can use these functions to load data into a pandas Dataframe. """ import numpy as np import pandas as pd from sklearn.utils import shuffle class CleanData: ...
StarcoderdataPython
73660
<filename>src/__init__.py import argparse import datetime import time import botconfig import src.settings as var from src import logger from src.logger import stream, stream_handler, debuglog, errlog, plog from src import db # Import the user-defined game modes # These are not required, so failing to import it doesn...
StarcoderdataPython
1704699
<reponame>cpitts1/snakeplane<gh_stars>10-100 # Copyright (C) 2019 Alteryx, 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/LIC...
StarcoderdataPython
3259973
<gh_stars>0 """Ensure that the database is available.""" import sqlite3 from sqlite3 import Connection import click from flask import current_app, Flask, g from flask.cli import with_appcontext def get_db() -> Connection: """Returns a connetion to the database. Returns: Connection: The sqlite3 datab...
StarcoderdataPython
13494
<reponame>kirank0220/api-examples ######################################################################### # _________ ___. ______________________ ___ # \_ ___ \___.__.\_ |__ ___________ / _____/\______ \ \/ / # / \ \< | | | __ \_/ __ \_ __ \/ \ ___ | _/\ ...
StarcoderdataPython
1726581
# Author: <NAME> <<EMAIL>> # My imports from lhvqt.lvqt_real import LVQT as LVQT_R from lhvqt import LHVQT from compare_utils import * # Regular imports from time import time import numpy as np import librosa import torch def main(): """ Compare the real variant with different max pooling settings to lib...
StarcoderdataPython