id
stringlengths
1
265
text
stringlengths
6
5.19M
dataset_id
stringclasses
7 values
129318
<reponame>Epihaius/panda3dstudio<gh_stars>10-100 from ..base import * class DummyEdge: def __init__(self, dummy, axis, corner_index, picking_col_id): self._dummy = dummy self.axis = axis self._corner_index = corner_index self.picking_color_id = picking_col_id def __del__(sel...
StarcoderdataPython
1637676
<reponame>ParikhKadam/frankenstein<filename>core/patch_symbols.py<gh_stars>100-1000 import lief import sys import json import shutil """ Patches the symbol table of a compiled emulator to export symbols This is required to load the firmware back in to a reverse engineering software TODO symbol types are currently not ...
StarcoderdataPython
1775560
from functools import wraps from timeit import default_timer from typing import Any, Iterable, List, Dict ''' timer - 1.0 此版本调用起来不够优雅,以及类型注解等一些细节没做好 故重构为 1.1 版本,该版本源码留作纪念 ''' funcs: List[Any] = [] times: List[float] = [] funcs_times: Dict[str, float] = {} def timer(flag: str = None, input: Iterable = None): i...
StarcoderdataPython
1758289
from itertools import combinations import numpy as np from sklearn.utils import as_float_array, check_array from sklearn.utils.validation import check_is_fitted from sklearn.base import clone from sklearn.preprocessing import scale from scipy.sparse import triu, coo_matrix import joblib from joblib import Parallel, de...
StarcoderdataPython
1612039
<filename>yocto/poky/bitbake/lib/bb/ui/crumbs/runningbuild.py<gh_stars>10-100 # # BitBake Graphical GTK User Interface # # Copyright (C) 2008 Intel Corporation # # Authored by <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public...
StarcoderdataPython
3354442
<filename>venv/Lib/site-packages/psychopy/hardware/labhackers.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2019 <NAME> # Distributed under the terms of the GNU General Public License (GPL). """This provides basic LabHackers (www.labhackers.com) device classes. """ f...
StarcoderdataPython
30675
<reponame>Iciclelz/leetcode class Solution: def lemonadeChange(self, bills: List[int]) -> bool: money = [0, 0, 0] for x in bills: if x == 5: money[0] += 1 if x == 10: if money[0] >= 1: money[1] += 1 ...
StarcoderdataPython
3263476
<reponame>mverleg/imgarray<filename>imgarray/__init__.py<gh_stars>1-10 from .saveload import save_array_img, load_array_img
StarcoderdataPython
1664986
#Reddit Config file reddit = {'accessCode': 'Downtown-Regular2393', 'secretCode': 'Crashfire123@123'}
StarcoderdataPython
3363053
from PyQt5.QtWidgets import * import sys,pickle from PyQt5 import uic, QtWidgets ,QtCore, QtGui from sklearn.preprocessing import LabelEncoder import linear_reg,svm_model,table_display,data_visualise,SVR,logistic_reg,RandomForest import KNN,mlp,pre_trained,add_steps,gaussian class error_window(QMainWindow): def...
StarcoderdataPython
3380534
<reponame>Yepoleb/blog import re # Finds pairs like 'item = "WScri",' or 'permission = -135782688;' ASSIGN_RE = re.compile(r'(\w+) = ("[^"]+"|.\d+)') # Finds a word inserted in the middle, the ([^\w]) make sure it's not part of # another word. I know this is really ugly. MAGIC2 = r'([^\w])({})([^\w])' # Find the var...
StarcoderdataPython
1607728
<filename>dags/alpha_vantage_dag.py # from os import environ # # import psycopg2 # import requests # from airflow.models import DAG # from airflow.operators.python import PythonOperator # from airflow.utils.dates import days_ago # from db_connectors import StockMarketDBConnector # from utils.models import ( # Balan...
StarcoderdataPython
3240472
"""Vocola""" __version__ = '2.9.5' # make ready for improved pip # '2.9.4' # bugfix, check for correct directories (VocolaUserDirectory, VocolaGrammarsDirectory) # '2.9.3' # bugfix, typo # '2.9.2' # bugfix, normpath changed into abspath # '2.9.1' # initial version w...
StarcoderdataPython
1653028
<reponame>cdbethune/d3m-primitives from tslearn.clustering import TimeSeriesKMeans, GlobalAlignmentKernelKMeans from tslearn.metrics import sigma_gak, cdist_gak class KMeans(): def __init__(self, n_clusters, algorithm='GlobalAlignmentKernelKMeans', random_seed = 0): ''' initialize KMeans cluste...
StarcoderdataPython
129065
<reponame>gouthampacha/manila # Copyright (c) 2015 <NAME>, 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/LICE...
StarcoderdataPython
3313305
<reponame>Raghvender1205/Advance-Python<filename>ConcurringAndParallelism/IObound_Program/Using_Asyncio.py<gh_stars>0 """ We will Asyncio for this task to see the output for the same code and task """ import asyncio import time import aiohttp async def download_site(session,url): async with session.get(url...
StarcoderdataPython
179919
<filename>django/core/management/commands/spawnhelpers.py from optparse import make_option import os import re import sys import socket import Pyro4, time from django.core.management.base import BaseCommand, CommandError from django.core.handlers.wsgi import WSGIHandler from django.core.servers.basehttp import AdminMe...
StarcoderdataPython
1654184
<filename>data/contacts.py from model.contact import Contact import random import string testdata = [ Contact(firstname="name1", middlename="test", lastname="test1", address="address1") ] #def random_string(prefix, maxlen): #symbols = string. ascii_letters + string.digits + " "*3#+ string.punctuation# #...
StarcoderdataPython
110165
<reponame>mukaiu/PaddleNLP # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
StarcoderdataPython
1673236
from collections import defaultdict from django.apps import apps from django.db import models from django.utils.translation import gettext_lazy as _ class ContentTypeManager(models.Manager): use_in_migrations = True def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Cac...
StarcoderdataPython
3357269
<filename>rbapi/apps/api/forms.py from django import forms class SearchCheck(forms.Form): check_id = forms.CharField()
StarcoderdataPython
1602872
import numpy as np from chatbot import clean_up_sentence from chatbot import bow from chatbot import classify from chatbot import chat_response def test_clean_up_hello_sentence_(): assert clean_up_sentence("Hi, HoW are you?!") == ['hi', ',', 'how', 'ar', 'you', '?', '!'] def test_bow_with_no_equality_(): a...
StarcoderdataPython
3264677
""" Copyright 2016-2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
StarcoderdataPython
1682908
# I declare that my work contains no examples of misconduct, such as plagiarism, or collusion. # Any code taken from other sources is referenced within my code solution. # Student ID: UOW - w1811026 , IIT 20201217 # Date: 2020 / 12 / 11 def progress_outcome(pass_credits, defer_credits): if pass_credits ...
StarcoderdataPython
3294919
#!/usr/bin/env python3 from setuptools import setup, find_packages exec(open('simplesimple/__init__.py').read()) setup( name='simplesimple', version=__version__, description='A simple Building Energy Model.', maintainer='<NAME>', maintainer_email='<EMAIL>', url='https://www.github.com/timtroe...
StarcoderdataPython
3209471
#!/usr/bin/env python """ push-based asynchronous TCP This is a generic library for building event-based / asynchronous TCP servers and clients. It uses a push model; i.e., the network connection pushes data to you (using a 'data' event), and you push data to the network connection (using the write method). """ __a...
StarcoderdataPython
38516
<gh_stars>10-100 # Copyright (C) <NAME> 2021. # Distributed under the MIT License (see the accompanying README.md and LICENSE files). import numpy as np import utils.ranking as rnk def sample_rankings(log_scores, n_samples, cutoff=None, prob_per_rank=False): n_docs = log_scores.shape[0] ind = np.arange(n_samples)...
StarcoderdataPython
1721474
## Documentation channels / binary ##https://media.readthedocs.org/pdf/channels/latest/channels.pdf ##http://www.devdungeon.com/content/working-binary-data-python from time import time from struct import pack, unpack class Packet(): """Class for constructing binary data based on a common API between client / serve...
StarcoderdataPython
3286424
# -*- coding: utf-8 -*- # $Id: wuihlpform.py $ """ Test Manager Web-UI - Form Helpers. """ __copyright__ = \ """ Copyright (C) 2012-2017 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/o...
StarcoderdataPython
14448
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
StarcoderdataPython
3282138
import sys # from sklearn.linear_model import Ridge from sklearn.neural_network import MLPRegressor import numpy as np from utils import * class BBRegressor: def __init__(self, img_size, alpha=1000, overlap=[0.6, 1], scale=[1, 2]): self.img_size = img_size self.alpha = alpha self.overlap_...
StarcoderdataPython
1179
<filename>escola/teste_get.py import requests headers = { 'content-type': 'application/json', 'Authorization': 'Token <PASSWORD>' } url_base_cursos = 'http://127.0.0.1:8000/api/v2/cursos' url_base_avaliacoes = 'http://127.0.0.1:8000/api/v2/avaliacoes' resultado = requests.get(url=url_base_cursos, headers=hea...
StarcoderdataPython
3333583
<reponame>xtofl/hidice<filename>hidice_server.py #!/usr/bin/env python3 # from flask import * app = Flask(__name__) class State: def __init__(self): self.bumped = 0 def bump(self): self.bumped += 1 return self.bumped def bumps(self) -> int: return self.bumped state...
StarcoderdataPython
3355431
<reponame>LL06-Reports-Analysis-Dowell/100043-exhibitorlist from django.shortcuts import render, redirect from .models import Details from django.contrib import messages from django.http import HttpResponse, HttpResponseRedirect from django.urls import reverse # from django.core.files.storage import FileSystemStorage f...
StarcoderdataPython
1648269
<gh_stars>10-100 import abc import collections.abc import importlib import io import pkgutil import pandas as pd class LabelAggregator(abc.ABC): """LabelAggregator provides general methods for working with nPrint data, such as attaching labels, compressing nPrint data, and generating new columns for flat...
StarcoderdataPython
1673959
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== import remove_hairs from remove_hairs import remove_hairs as remove_hairs_fn from remove_hairs import remove_hairs_decorator from .serializer import MARCX...
StarcoderdataPython
99948
#Copyright 2016 <NAME>. #Distributed under the MIT License. See LICENSE in root of project. """ This module bootstraps the central messagegin system in Kervi. Include this module in all modules where communication is needed. Usage: from kervi.spine import Spine myValue=10 spine = Spine() spine.sendCommand("SetMyVal...
StarcoderdataPython
1683251
import json import logging import ssl import time import requests from flask import make_response, jsonify from jwcrypto import jwk, jwt, jws from jwcrypto.common import json_encode from jwcrypto.jws import InvalidJWSSignature from ldap3 import Server, Connection, ALL, Tls, SAFE_RESTARTABLE from loggerPrefix import L...
StarcoderdataPython
3345201
import numpy as np from ..core import Bullet from ..robots import Panda from contextlib import contextmanager class PandaDualArm: def __init__( self, bullet:Bullet, panda1_position=[0,0.2,0], panda2_position=[0,-0.2,0], ): #name = "panda_dualarm" self.bullet = ...
StarcoderdataPython
3394043
<reponame>kennnyshiwa/cooey-tools<filename>cooey-bot/embedcreator/utils.py import json import traceback from typing import Optional from io import StringIO import discord from redbot.core import commands from redbot.core.utils.chat_formatting import humanize_list, pagify from redbot.core.utils.menus import DEFAULT_CON...
StarcoderdataPython
195759
<filename>trackon.py import json import logging import os.path as path import pickle import sqlite3 import sys from collections import deque from ipaddress import ip_address, IPv4Address from threading import Lock from time import time, sleep from urllib.parse import urlparse from tracker import Tracker max_input_len...
StarcoderdataPython
51157
# For importing keys import sys sys.path.append("../") sys.path.append("DONOTPUSH/") import api_keys # My modules import database as db # Libraries import json from time import sleep # from github import Github from alpha_vantage.timeseries import TimeSeries import logging # Constants REPO_NAME = "My-All-Weather-Str...
StarcoderdataPython
1651011
<reponame>green-mercury/P13pt<filename>P13pt/mascril/modules/vna_capa_RohdeSchwarz_newprober.py ''' This script uses the following driver for the Rohde and Schwarz VNA: https://github.com/Terrabits/rohdeschwarz ''' from __future__ import print_function from P13pt.mascril.measurement import MeasurementBase from P13...
StarcoderdataPython
1795048
import yaml import os from hubit.model import HubitModel THISPATH = os.path.dirname(os.path.realpath(__file__)) def get_model() -> HubitModel: """Create a HubutModel instance from a model file. Args: render (bool, optional): Render the model. Defaults to True. Returns: [HubitModel]: A h...
StarcoderdataPython
4837018
from app import app import config from typing import Dict from model.notif import Notification from model.post_stats import post_stats_do_comment from model.topic import Topic from slim.base.ws import WSRouter from slim.ext.decorator import timer from slim.utils.customid import CustomID from model.comment import Commen...
StarcoderdataPython
1682113
"""Symbols representing commonly used strings. Feel free to `from strings import *`, your linter might not like you though.""" HABITAT = 'Habitat' AYSE = 'AYSE' SUN = 'Sun' EARTH = 'Earth' MODULE = 'Module' SUN = 'Sun' OCESS = 'OCESS' RADS1 = 'RAD-S1' RADS2 = 'RAD-S2' AGRAV = 'A GRAV' RCON1 = 'R-CON1' RCON2 = 'R-CON2...
StarcoderdataPython
3305598
<gh_stars>0 import argparse import os import re import sys import yaml from expandvars import UnboundVariable, expandvars from six import StringIO class RunTimeError(Exception): def __init__(self, reason): self.reason = reason def compile(env_line, is_strict=True): regex = r"(export\s*)?([^=]+)=(.*...
StarcoderdataPython
1670951
<reponame>sbworth/getnoc #!./bin/python # ---------------------------------------------------------------------- # datastream service # ---------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # -------------------------------------------...
StarcoderdataPython
12680
<reponame>metaMMA/Flexget from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.utils import PY3 import logging import csv from requests import RequestException from flexget import plugin from flexget.entry impor...
StarcoderdataPython
3368685
import os data_dir = '../data' dataset_name = 'cifar10' BATCH_SIZE = 32
StarcoderdataPython
3205140
""" To solve this problem we have used the software The Full Whiskas Model example in the package PuLP for python. I have no clue about linear optimization... so this package has been intinitely helpful. The code do not require much explanation and there is no much time remaining in the contest... so I wont comment a...
StarcoderdataPython
174571
# -*- coding: utf-8 -*- import random import itertools import numpy as np import numbers from .. import indexing def genindexing(dim, advanced=False, eco=False): if dim > 1: a = random.randint(-dim, dim - 1) i = random.randint(1, dim - 1) j = random.randint(-dim, -1) k = random....
StarcoderdataPython
1782379
from rest_framework import serializers from pokemon.models import Pokemon from pokemon.serializers.abilities import AbilitySerializer from pokemon.serializers.types import PokemonTypeSerializer class PokemonSimpleSerializer(serializers.ModelSerializer): class Meta: model = Pokemon fields = ( ...
StarcoderdataPython
46584
#! /usr/bin/python # -*- coding: utf-8 -*- import re from subprocess import Popen, PIPE def getIP(interface): p = Popen('ifconfig %s' % interface, stdout=PIPE, stderr=PIPE, shell=True) stdout = p.communicate()[0] r = re.search('inet addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', stdout) ip = r.group(1) ...
StarcoderdataPython
63953
<reponame>gjyaiya/mysqlmonitor #!/usr/bin/env python # coding:utf-8 import json import sys from server.monitor import start_monitor, set_mysql_config, list_charts, set_charts, stop_monitor from server.my_util import patch_json, get_time from server.web_socket import start_ws, clients fp_log = open(sys.path[0] + "/re...
StarcoderdataPython
3325414
<filename>nagatoro.py import logging import sys import asyncio from tortoise import Tortoise from discord import Activity from nagatoro import Bot from nagatoro.objects import Config from nagatoro.db import init_database logging.basicConfig( stream=sys.stdout, level=logging.INFO, format="%(levelname)s:%...
StarcoderdataPython
1635962
<reponame>matumaros/BomberApe<filename>models/tilemap/__init__.py from .tilemap import TileMap
StarcoderdataPython
1678845
from collections import defaultdict from Input import Input, AnnotatedInput from collections import Counter import Classifier, Logger, math class PerceptronClassifier(Classifier.Classifier): def __init__(self, features): Classifier.Classifier.__init__(self) self.features = features self.weights = ...
StarcoderdataPython
1629670
<gh_stars>0 from .algos import ga, es, ga_moo def get_algo_from_exp(exp): assert type(exp.policy.handler) is str, "Invalid policy type" if exp.policy.handler == 'ga_moo': return ga_moo.GAMoo() if exp.policy.handler == 'GA': return ga.GA() if exp.policy.handler == 'ES': return ...
StarcoderdataPython
4824144
import importlib import os import sys import jinja2 from flask import Flask from flask import send_from_directory from flask_admin import Admin from flask_admin.menu import MenuLink from flask_login import current_user from shopyo.api.file import trycopy base_path = os.path.dirname(os.path.abspath(__file__)) sys.path...
StarcoderdataPython
1789069
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2020 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
StarcoderdataPython
4816641
from django.urls import path from core.projects.views.members import MemberApi, MembersApi from core.projects.views.projects import ProjectsApi, ProjectApi from core.projects.views.roles import RolesApi, RoleApi from core.projects.views.settings import ProjectSettingsApi from core.projects.views.tasks import ProjectTa...
StarcoderdataPython
22483
<filename>src/import_hook/__init__.py from .import_track import * from .reimportable import *
StarcoderdataPython
76483
<filename>mlab_api/models/server_models.py # -*- coding: utf-8 -*- ''' Models for definging return value of Server specific calls ''' from flask_restplus import fields from mlab_api.rest_api import API from mlab_api.format_utils import meta_results_to_csv, \ meta_data_in_row_to_csv, meta_data_to_csv from mlab_ap...
StarcoderdataPython
14624
<gh_stars>0 print("RUnning!!!") print("Updated!!!")
StarcoderdataPython
1725679
<filename>src/ResNet/CASIA_WEB_FACE.PyTorch/calculate_image_mean.py import os import torch import torchvision import torch.utils.data import torchvision.transforms as transforms import torchvision.datasets as datasets import yaml import tqdm here = os.path.dirname(os.path.abspath(__file__)) # output folder is located...
StarcoderdataPython
115892
<gh_stars>0 import pandas as pd from deezer import Client, Track, Album, Genre from app.columns import Column class Deezer: client: Client def __init__(self): self.client = Client( headers={'Accept-Language': 'en'} ) def update_genres(self, tracks: pd.DataFrame) -> pd.DataFr...
StarcoderdataPython
3376145
<gh_stars>100-1000 # - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Data.TextLoader """ from ..utils.entrypoints import EntryPoint from ..utils.utils import try_set, unlist def data_textloader( input_file, arguments=0, data=None, **params): """ **Descrip...
StarcoderdataPython
1785795
################################################################################# # Author: <NAME> # Username: Wilkensley # # Assignment: A03: https://docs.google.com/document/d/1udKfPXWjc56TSu-2bG3ixT7X8meiO6lJ4gh6ltglXp8/edit# # Purpose: Learning how to define and call functions. #####################################...
StarcoderdataPython
3340931
from django.contrib import admin from lojas.models import Departamento, Loja, Area class LojaAdmin(admin.ModelAdmin): list_display = ['nome', 'slug', 'ativo'] class DepartamentoAdmin(admin.ModelAdmin): list_display = ['nome', 'loja', 'slug', 'ativo'] list_filter = ['loja', 'nome'] class AreaAdmin(adm...
StarcoderdataPython
4839752
import os import sys import re import getopt from git.exc import InvalidGitRepositoryError from git.cmd import Git from tools.validation import is_valid_branch from tools.user_interface import prompt_enter_value, prompt_yesno_question from tools.config import Config from tools.github import GitHub from tools.git_repo...
StarcoderdataPython
1714285
""" usage: count_dim.py foo.snt bar.ptn count M-scheme dimension Author: <NAME> Modified by: https://github.com/GaffaSnobb """ from functools import lru_cache import sys, math, time, multiprocessing from typing import TextIO, Tuple def _readline_sk( fp: TextIO, ) -> list: """ Skips lines starting with ...
StarcoderdataPython
1785812
<reponame>kodemore/opyapi<filename>tests/validators/test_combining_validators.py import pytest from opyapi import build_validator_for def test_validate_if_then_validator() -> None: # given validate = build_validator_for( { "if": {"type": "object"}, "then": { "p...
StarcoderdataPython
3285753
<reponame>mxl1n/CodeGen # Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( l , b , h ) : return ( ( l * b * h ) / 2 ) #TOFILL if __name__ == '__main__': pa...
StarcoderdataPython
3344773
<reponame>aeroabir/recommenders<gh_stars>1000+ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import random import logging import json import numpy as np import re from tqdm import tqdm from nltk.tokenize import RegexpTokenizer from recommenders.datasets.downlo...
StarcoderdataPython
14894
# -*- coding: utf-8 -*- import pytest def test_translator(): def translator(string): translations = {'String value is too long.': 'Tamanho de texto muito grande.'} return translations.get(string, string) from schematics.translator import register_translator register_translator(translator...
StarcoderdataPython
64817
<reponame>WachterJud/qaul.net_legacy # $Id: 140_sdp_with_direction_attr_in_session_2.py 3086 2010-02-03 14:43:25Z nanang $ import inc_sip as sip import inc_sdp as sdp # Offer contains "inactive" attribute in the session, however the media # also has "sendonly" attribute. Answer should appropriately respond # direction...
StarcoderdataPython
3388591
from .types import name_to_type as _name_to_type aa3_to_aa1 = { 'ALA': 'A', # Alanine 'ARG': 'R', # Arginine 'ASN': 'N', # Asparagine 'ASP': 'D', # Aspartic Acid 'CYS': 'C', # Cysteine 'GLU': 'E', # Glutamic Acid 'GLN': 'Q', # Glutamine 'GLY': 'G', # Glyc...
StarcoderdataPython
4808039
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
StarcoderdataPython
1722564
<gh_stars>0 import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["mydatabase"] mycol = mydb["costomers"] mycol.drop()
StarcoderdataPython
3381426
from __future__ import unicode_literals __author__ = 'luissaguas' from frappe import _ import frappe import json, os from frappe.utils import cint from jasper_erpnext_report.utils.file import write_file, get_extension import jasper_erpnext_report.utils.utils as utils import JasperServer as Js, JasperLocal as Jl, Jasp...
StarcoderdataPython
133028
<reponame>victorcesc/sistema-gerador-avaliacoes import random from flask import render_template, flash, request from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_nav.elements import Navbar, View, Subgroup, Link from werkzeug.utils import redirect from forms import * from models import * boos...
StarcoderdataPython
107747
<filename>query/plans/tpch3cfg.py { 2 : { "operator" : "selection", "selectivity" : 0.2 }, 4 : { "operator" : "selection", "selectivity" : 0.5 }, 5 : { "operator" : "join", "selectivity" : 0.19, "multimatch" : False }, 7 : { ...
StarcoderdataPython
1633772
<filename>SFUltraDiff/src/diff.py import bac,bcm import json import sys import util import difflib from collections import OrderedDict OUT = "../../../sf4tools-gh-pages/" BASE = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Super Street Fighter IV - Arcade Edition\\" HEADER = '''--- layout: default --- ''' FOOT...
StarcoderdataPython
1730365
<gh_stars>1000+ # amachine.py # a tiny stack machine for our new language A, nothing special. import math, os, re, operator, sys end=[] def run(l): stack=[[]] for i in l: if i is end: f=stack.pop() i=f[0](*f[1:]) if callable(i): stack.append([i]) else:...
StarcoderdataPython
3393148
<reponame>awoh/tetris_game # from .gym_tetris import *
StarcoderdataPython
1602573
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import pulumi import pulumi.runtime class IAMBinding(pulumi.CustomResource): """ Allows creation and management of a single bi...
StarcoderdataPython
3266289
import unittest from hearstPatterns.hearstPatterns import HearstPatterns class TestHearstPatterns(unittest.TestCase): def test_hyponym_finder(self): h = HearstPatterns() hyps1 = h.find_hyponyms("Forty-four percent of patients with uveitis had one or more identifiable signs or symptoms, such as red eye, ocular p...
StarcoderdataPython
1633907
<gh_stars>1-10 #example 9.7 #myclasses.py from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String base=declarative_base() class Product(Base): __tablename__ = 'Products' ProductID = Column(Integer, primary_key=True) name = Column(String) price = Column(Integer...
StarcoderdataPython
1715449
import decimal from discord.ext import commands from cogs.fitness.db_interfaces.fitness_iface import FitnessUserInterface class Fitness(commands.Cog): def __init__(self, casper): self.casper = casper @staticmethod async def calc_wilks(gender, bodyweight, bench, squat, dead): # test value...
StarcoderdataPython
1784776
<reponame>karnaker/extract-email-from-url from bs4 import BeautifulSoup import requests import requests.exceptions from urllib.parse import urlsplit from collections import deque import re import datetime import csv # user is prompted for a queue of urls to be crawled user_input_yes_no = "y" user_urls = deque([]) whil...
StarcoderdataPython
141812
from rest_framework import serializers from groups.models import AppGroup from django.contrib.auth import get_user_model User = get_user_model() class AppGroupSerializer(serializers.ModelSerializer): class Meta: model = AppGroup fields = ( 'id', 'owner', 'name', 'group_category', ...
StarcoderdataPython
3307018
<filename>gnes/preprocessor/io_utils/helper.py # Tencent is pleased to support the open source community by making GNES available. # # Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in c...
StarcoderdataPython
1747407
# coding: utf-8 # ## Exercises # # This will be a notebook for you to work through the exercises during the workshop. Feel free to work on these at whatever pace you feel works for you, but I encourage you to work together! Edit the title of this notebook with your name because I will ask you to upload your final no...
StarcoderdataPython
1761380
<gh_stars>0 swagger_config = { 'openapi': '3.0.2', 'doc_dir': './app/docs/' } swagger_template = { "info": { "description": "SWMaestro 11th, Team urillbwa, Goodpoopee. \ \n Maintainer: <NAME>.\ \n API versioning V[major].[minor]", "version": "2.0", # API version "ter...
StarcoderdataPython
1638716
import Adafruit_DHT def get_temperature_info(sensor=Adafruit_DHT.DHT11, pin=4): humidity, temperature = Adafruit_DHT.read_retry(sensor, pin) return humidity, temperature
StarcoderdataPython
1665013
import bz2 import json import re from decimal import Decimal from servicelayer.cache import make_key # from pprint import pprint CAMEL_RE = re.compile(r"([A-Z]+)") STEPS_TYPE_1 = { "step_2": "relatives", "step_3": "real_estate", "step_4": "real_estate_construction", "step_5": "movable_property", ...
StarcoderdataPython
1798963
<filename>src/tutorial/employee.py """ Automatically generated by Zserio Python extension version 2.4.0. Generator setup: writerCode, pubsubCode, serviceCode, sqlCode. """ from __future__ import annotations import typing import zserio import tutorial.experience import tutorial.role class Employee: def __init__(...
StarcoderdataPython
1773858
from teleftp.telegram import TelegramBot from telegram import ReplyKeyboardMarkup from telegram.ext import CommandHandler, MessageHandler, Filters, ConversationHandler import tempfile import os.path from teleftp.ftp.filesystem import FTPDriver, LocalDriver, FilesystemDriver, FilesystemError, FilesystemAuthError cl...
StarcoderdataPython
1702533
<reponame>gdmcbain/quadpy # -*- coding: utf-8 -*- # from .stenger import Stenger from .stroud import Stroud from .stroud1967a import Stroud1967a from .stroud1967b import Stroud1967b from .stroud_secrest import StroudSecrest from .tools import integrate __all__ = [ "Stenger", "Stroud", "Stroud1967a", "...
StarcoderdataPython