id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
4863462
<filename>nucleus/templates/executor_template.py # BSD 3-Clause License # # Copyright (c) 2018, <NAME> All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # # Redistributions of source code must retain ...
StarcoderdataPython
12860461
import unittest import orca from setup.settings import * from pandas.util.testing import * class SeriesStrTest(unittest.TestCase): def setUp(self): self.PRECISION = 5 @classmethod def setUpClass(cls): # connect to a DolphinDB server orca.connect(HOST, PORT, "admin", "123456") @p...
StarcoderdataPython
1669008
"""Contains helper functions for train.py used for train and evaluating model """ import torch.nn as nn import torch import numpy as np import itertools import matplotlib.pyplot as plt import seaborn as sn import pandas as pd from sklearn.metrics import precision_recall_fscore_support from sklearn.metrics import confus...
StarcoderdataPython
9645320
<filename>datastructures/hashmap/check_hashmaps_subsets.py from typing import List from collections import Counter """ Given 2 strings s1 and s2 - check if s2 can be formed from s1, no duplication allowed -> Check if 1 hashmap is a subset of another hashmap """ def check_hashmap_subset(s1: List, s2: List) -> bool: ...
StarcoderdataPython
6439664
""" rules.py Describes and manages rules that define how IRC commands are triggered. Copyright (c) 2018 The <NAME>, All rights reserved. Licensed under the BSD 3-Clause License. See LICENSE.md """ import logging import re from typing import Callable, NamedTuple, Pattern, List, Tuple, Optional LOG = logging.getLogg...
StarcoderdataPython
5123305
<gh_stars>1-10 # Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> import os import jinja2 DEBUG = False TESTING = False PRODUCTION = False GOOGLE_INTERNAL = False # Flask-SQLAlchemy fix to be less than `wait_time` in /etc/mysql/my.cnf SQLALCHEMY_POOL_RECYC...
StarcoderdataPython
5127500
# coding=utf-8 import argparse from covid.utils import url2soup def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--adv', default=90, type=int) parser.add_argument('--trade', default=90, type=int) parser.add_argument('--battle', default=90, type=int) return parser.parse_a...
StarcoderdataPython
11349730
def find_clustering(points, epsilon, min_pts, query_object): """ For every point in our dataset we find the set of it's neighbors N A neighbor is a point with distance smaller than or equal to epsilon If | N | < minPts it is not a core point and we move to the next point :param points a...
StarcoderdataPython
11251471
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_evaluation.core.ipynb (unless otherwise specified). __all__ = ['get_mean_probs', 'find_parens', 'mean_dist_probs', 'token_taxonomy', 'non_wordy', 'get_error_rates', 'get_error_rates_df', 'get_last_token_error_df', 'get_mean_cross_entropy', 'get_mean_probs',...
StarcoderdataPython
1771452
"""Task to run """ from . import strict_ga from . import random_solution from . import ground_truth from . import search_accurate_rooms from . import room_combination_exhaustive from . import brute_force from . import consecutive_room TASKS = { 'strict_ga': strict_ga, 'random_solution': random_solution, 'g...
StarcoderdataPython
9634194
<filename>bluebottle/projects/migrations/0012_merge.py # -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-10-20 14:30 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('projects', '0011_auto_20161006_1149'), ...
StarcoderdataPython
1731279
<reponame>RevansChen/online-judge # Python - 3.6.0 quote = lambda fighter: 'I am not impressed by your performance.' if fighter.lower() == 'george saint pierre' else "I'd like to take this chance to apologize.. To absolutely NOBODY!"
StarcoderdataPython
3474203
# --------------------------------------------------------------------- # Qtech.QFC.get_capabilities # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # NOC ...
StarcoderdataPython
3347983
import os from django.core.exceptions import ImproperlyConfigured marker = object() def get_env_variable(var_name, default=marker): """ Get the environment variable or return exception """ try: return os.environ[var_name] except KeyError: if default is not marker: return defaul...
StarcoderdataPython
3386151
<reponame>janiversen/supervisor<filename>tests/resolution/evaluation/test_evaluate_dns_server.py """Test DNS server evaluation.""" from unittest.mock import patch from supervisor.const import CoreState from supervisor.coresys import CoreSys from supervisor.resolution.const import ContextType, IssueType from supervisor...
StarcoderdataPython
5093485
# Object Oriented Pygame Initializer import pygame from pygame.locals import * class App: def __init__(self): self._running = True self._display_surf = None self.size = self.width, self.height = 1280, 720 def on_init(self): pygame.init() self._display_surf = pygame.display.set_mode(self.size,...
StarcoderdataPython
11346220
<filename>BPNN.py<gh_stars>1-10 from keras.datasets import boston_housing from keras import models from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import p...
StarcoderdataPython
6488738
""" Credits: Copyright (c) 2017-2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2019-2020 <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME> (Sinergise) This source code is licensed under the MIT license fou...
StarcoderdataPython
11298355
""" Team Mongols: <NAME> and <NAME> SoftDev2 pd07 K05 -- Import/Export Bank 2018-02-25 Name of Dataset: American movies scraped from Wikipedia Description: A List of American Movies scraped from the popular online encyclopedia known as Wikipedia Download: https://raw.githubusercontent.com/prust/wikipedia-movie-data/ma...
StarcoderdataPython
5030409
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import json import logging from typing import Sequence from urllib.parse import urlparse from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult from opentelemetry.sdk.util import ns_to_iso_str from opentele...
StarcoderdataPython
357024
import asyncio import logging import abattlemetrics as abm import aiohttp PLAYER_ID = 1234 log = logging.getLogger('abattlemetrics') log.setLevel(logging.DEBUG) handler = logging.FileHandler('abattlemetrics.log', encoding='utf-8', mode='w') handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: ...
StarcoderdataPython
3569212
from aiogram.dispatcher import FSMContext from other.config import app_config, DBKeys async def get_data(state: FSMContext): """ Get data from FSM and also initialize missing values with default values :param state: current context """ data = await state.get_data() has_changes = False for...
StarcoderdataPython
128057
__all__ = [] import datetime import re def _safe_getitem(dct, *keys): for key in keys: try: dct = dct[key] except (KeyError): return None return dct class _dict(dict): # pragma: no cover """ A simple dict subclass for use with Creds modelling. No surprises """ ...
StarcoderdataPython
1730902
# -*- coding: utf-8 -*- """ @author:HuangJie @time:18-9-17 下午2:48 """ import os import h5py import numpy as np from BackEnd.CNN_retrieval.extract_cnn_vgg16_keras import VGGNet ''' ap = argparse.ArgumentParser() ap.add_argument("-database", required=True, help="Path to database which contains images to be indexed") ...
StarcoderdataPython
3412041
<gh_stars>1-10 import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.model_selection import train_test_split import os import json def scale(data): # Rescales the data into the interval [-pi, pi] for i in range(data.shape[1]): col_min = np.min(...
StarcoderdataPython
6541910
<reponame>dbradf/dsfs import dsfs.linalg.matrix as under_test def test_shape(): assert under_test.shape([[1, 2, 3], [4, 5, 6]]) == (2, 3) def test_identity(): assert under_test.identity_matrix(5) == [ [1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], ...
StarcoderdataPython
1766168
#!/usr/bin/env python """ pycwp: Userful numerical routines for computational wave physics in Pyhon The pycwp library is maintained by <NAME> to provide useful software in Python for computational wave physics and the manipulation of binary matrix files. """ # Copyright (c) 2015 <NAME>. All rights reserved. # Restrict...
StarcoderdataPython
8000775
# -*- coding: utf-8 -*- """ audiotsm.base ~~~~~~~~~~~~~ This module provides base classes for the implementation of time-scale modification procedures. """ from .tsm import TSM from .analysis_synthesis import AnalysisSynthesisTSM, Converter
StarcoderdataPython
4911112
<filename>transportation.py from flask import Flask, render_template, flash, request from wtforms import Form, TextField, TextAreaField, validators, StringField, SubmitField, SelectField, DateField # App config. DEBUG = True app = Flask(__name__) app.config.from_object(__name__) app.config['SECRET_KEY'] = '<KEY>' cl...
StarcoderdataPython
8139262
<filename>docker/app/main.py<gh_stars>0 """process flutter app request and send generated questions along with it's answer to user's firestore document """ import random # pylint: disable=no-name-in-module from pydantic import BaseModel from fastapi import FastAPI, BackgroundTasks from src.models.question_gen_m...
StarcoderdataPython
66701
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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
3558308
import sys s = sys.argv try: num1 = open(s[1]) num2 = num1.read() num3 = num2.strip() num4 = num3.split() for i in num4: print(i) finally: num1.close()
StarcoderdataPython
4872212
import urllib.parse import requests from . import common class DNSPodDns(common.BaseDns): """ """ dns_provider_name = "dnspod" def __init__(self, DNSPOD_ID, DNSPOD_API_KEY, DNSPOD_API_BASE_URL="https://dnsapi.cn/"): self.DNSPOD_ID = DNSPOD_ID self.DNSPOD_API_KEY = DNSPOD_API_KEY ...
StarcoderdataPython
9773716
<reponame>royn5618/Medium_Blog_Codes from wordcloud import WordCloud import matplotlib.pyplot as plt def show_wordcloud(list_of_tokens): wc = WordCloud(background_color="black", max_words=100, width=1000, height=600, random_state=1).generate(lis...
StarcoderdataPython
8123408
<reponame>alexander-sidorov/qap-05<gh_stars>1-10 from hw.maria_saganovich.lesson5.task5 import func5 def test_function5() -> None: str1 = "santa claus is coming to town" assert func5(str1) == "Santa Claus Is Coming To Town"
StarcoderdataPython
3431768
"""Author: <NAME>.""" from logging import warning import uuid import warnings import numpy as np import distutils.version from pathlib import Path from typing import Union, Optional, List from warnings import warn from collections import defaultdict import pynwb from spikeinterface import BaseRecording, BaseSorting fr...
StarcoderdataPython
6528139
<filename>gp_mpc/gp_functions.py<gh_stars>10-100 # -*- coding: utf-8 -*- """ Gaussian Process functions Copyright (c) 2018, <NAME>, <NAME> """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import casadi as ca import matplotlib.pyplot as...
StarcoderdataPython
1785543
import arcade class Resource(arcade.Sprite): def __init__(self, name: str, tier: int, path: str, x: int, y: int): """ This is the class that all resources will be. :param name: The name of the resource :param tier: The tier of the resource :param path: Path to the texture ...
StarcoderdataPython
4861434
<reponame>swarmer/cfglib-py import pytest import cfglib from cfglib import validation as val def test_value_type_multiple(): field = cfglib.Setting(name='a', validators=[val.value_type((str, bytes))]) field.validate_value('string') field.validate_value(b'bytes') with pytest.raises(cfglib.Validation...
StarcoderdataPython
3342239
<reponame>kayabaNerve/Currency<gh_stars>10-100 from typing import Tuple, List, Optional, Any from ctypes import c_char_p, byref from ctypes import Array, c_char, create_string_buffer from e2e.Libs.Milagro.PrivateKeysAndSignatures import MilagroCurve, Big384, FP1Obj, G1Obj from e2e.Libs.HashToCurve.Elements import Fi...
StarcoderdataPython
8040278
<filename>tests/unit/csv_upload/parties/organisation.py import unittest import csv import random from amaasutils.random_utils import random_string from amaascore.csv_upload import Uploader class OrganisationUploaderTest(unittest.TestCase): def setUp(self): self.longMessage = True # Print complete error ...
StarcoderdataPython
1639448
from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, TextAreaField, FieldList from wtforms.validators import DataRequired, ValidationError # from flask_blog.models import Tag class EditPostForm(FlaskForm): # note: we can add profanity filters in the validation step title = StringFiel...
StarcoderdataPython
1619014
from sqlite_utils import Database def test_tracer(): collected = [] db = Database( memory=True, tracer=lambda sql, params: collected.append((sql, params)) ) db["dogs"].insert({"name": "Cleopaws"}) db["dogs"].enable_fts(["name"]) db["dogs"].search("Cleopaws") assert collected == [ ...
StarcoderdataPython
11367340
class BaseAppConfig(): CURATOR_ADDRESS = '0xda4a4626d3e16e094de3225a751aab7128e96526' ETHERSCAN_WEBSOCKET_URL = 'wss://socket.etherscan.io/wshandler'
StarcoderdataPython
1713649
# -*- test-case-name: wokkel.test.test_ping -*- # # Copyright (c) 2003-2009 <NAME> # See LICENSE for details. """ XMPP Ping. The XMPP Ping protocol is documented in U{XEP-0199<http://xmpp.org/extensions/xep-0199.html>}. """ from zope.interface import implements from twisted.words.protocols.jabber.error import Stanz...
StarcoderdataPython
6558584
<reponame>fmarberg/optking from math import sqrt, fabs, acos import logging import numpy as np import qcelemental as qcel from . import frag, stre, bend, tors from . import v3d from . import intcosMisc from . import orient from .exceptions import OptError from .printTools import print_mat_string from . import optpara...
StarcoderdataPython
1713145
from datetime import datetime import unittest from pybacklogpy.Category import Category from tests.utils import get_project_id_and_key, response_to_json class TestCategory(unittest.TestCase): @classmethod def setUpClass(cls): cls.category = Category() cls.project_id, cls.project_key = get_pro...
StarcoderdataPython
33915
from pyrouge.base import Doc, Sent from pyrouge.rouge import Rouge155
StarcoderdataPython
1996361
<reponame>Dahk/triggerflow-examples import json import sys import platform from uuid import uuid4 from datetime import datetime from redis import StrictRedis TOPIC = 'pywren' def produce_events(node, nodes): red = StrictRedis(host='127.0.0.1', port=6379, password="<PASSWORD>", db=0) if 1000 % nodes != 0: ...
StarcoderdataPython
279179
<gh_stars>1-10 print(f'Loading {__file__}...') import math from ophyd import (Device, PVPositionerPC, EpicsMotor, Signal, EpicsSignal, EpicsSignalRO, Component as Cpt, FormattedComponent as FCpt, PseudoSingle, PseudoPositioner, ) from ophyd.pseudopos import (re...
StarcoderdataPython
6608125
from .tts import * from .url import Url import tts import zipfile import json import urllib.error PAK_VER=2 def importPak(filesystem,filename): log=tts.logger() log.debug("About to import {} into {}.".format(filename,filesystem)) if not os.path.isfile(filename): log.error("Unable to find mod pak {}".format(...
StarcoderdataPython
3289844
<gh_stars>10-100 import os import sys import cv2 import time import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable ###focal_l set by default to 160 degrees over 1024x1024 footprint fl = 90.27941412273405 class A2P(nn.Module): def __init__(self, ...
StarcoderdataPython
8075869
#!/usr/bin/env python """ Export oncodrive results to biomart database * Configuration parameters: - The ones required by intogen.data.entity.EntityManagerFactory * Input: - id: The mrna.oncodrive_gene ids to export * Entities: - mrna.oncodrive_genes """ from wok.task import Task from intogen.repository.serve...
StarcoderdataPython
1740533
<reponame>mohsinkhansymc/mindsdb<filename>mindsdb/libs/phases/stats_generator/stats_generator.py import random import time import warnings import imghdr import sndhdr import logging from collections import Counter #import multiprocessing import numpy as np import scipy.stats as st from dateutil.parser import parse as ...
StarcoderdataPython
140754
<reponame>ncsa/sels #!/usr/bin/python # Created by: SELS Team # # Description: Email Utilities used by SELSModerator.py # # License: This code is a part of SELS distribution under NCSA/UIUC Open Source License (refer NCSA-license.txt) ###############################################################################...
StarcoderdataPython
3351887
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 clowwindy # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
StarcoderdataPython
6665255
<reponame>tobiasrenkin/sublime-console<filename>run_pty.py #!/usr/bin/env python from __future__ import print_function import os, sys, select, signal, termios, fcntl, tty, pty, subprocess, atexit, argparse, struct, time print('Sublime LinkedTerminal') parser = argparse.ArgumentParser(description='Sublime LinkedTermi...
StarcoderdataPython
6634690
<reponame>gillesdegottex/percival-tts ''' An optimizer class that print and plot information during training that is mainly dedicated to TTS. Copyright(C) 2017 Engineering Department, University of Cambridge, UK. License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file e...
StarcoderdataPython
4948241
import httpagentparser from django.conf import settings from manti_by.apps.blog.models import Post WEBP_VALID_BROWSERS = ["Chrome", "Opera", "Opera Mobile"] def is_supports_webp(request): if "webp" in request.META.get("HTTP_ACCEPT", ""): return True data = httpagentparser.detect(request.META.get("...
StarcoderdataPython
11365695
<reponame>alanfranz/pydenji<filename>pydenji/test/test_importer.py #!/usr/bin/env python # -*- coding: utf-8 -*- # (C) 2010 <NAME> import unittest import sys from pydenji.importer import NI, import_or_reload, get_by_fqdn class TestImporter(unittest.TestCase): def test_importer_imports_required_object(self): ...
StarcoderdataPython
3448230
# -*- coding: utf-8 -*- """ @date: 2020/8/20 下午8:50 @file: test_visdrone_anno.py @author: zj @description: """ from pnno.config import cfg from pnno.anno.visdrone_anno import VisDroneAnno class TestVisdroneAnno(object): def test_process(self): config_file = 'tests/visdrone_anno_test/process_config.yam...
StarcoderdataPython
6537544
<filename>netbox_agent/vendors/hp.py import netbox_agent.dmidecode as dmidecode from netbox_agent.server import ServerBase from netbox_agent.inventory import Inventory class HPHost(ServerBase): def __init__(self, *args, **kwargs): super(HPHost, self).__init__(*args, **kwargs) self.manufacturer = "...
StarcoderdataPython
8195073
<gh_stars>0 class Bytes(bytearray): @staticmethod def from_int( n, size=4, big_endian=True, signed=False ): if not signed and n <0: raise ValueError("if not signed n cannot be negative") if n<0: max_n_for_size = 2 ** (size * 8) - 1 n= max_n_for_size+n+1 curr_byte_i= 0 ret= Bytes(size) while curr_byte...
StarcoderdataPython
6477403
import numpy as np import os import os.path as osp import sys import google.protobuf as pb from argparse import ArgumentParser pycaffe_dir = osp.dirname(__file__) if osp.join(pycaffe_dir) not in sys.path: sys.path.insert(0, pycaffe_dir) import caffe from caffe.proto import caffe_pb2 def main(args): caffe.set...
StarcoderdataPython
5119556
import fiona import numpy as np import pandas as pd from shapely.geometry import shape, MultiPolygon from shapely import speedups from matplotlib.collections import PatchCollection from descartes import PolygonPatch import pickle if speedups.available: speedups.enable() # location of data refDataCSV = 'data/EU-re...
StarcoderdataPython
4985403
intervals = [] def sort_contained_intervals(n): n.intervals_start = sorted(n.intervals_start, key=lambda x: x[0]) n.intervals_end = sorted(n.intervals_end, key=lambda x: x[1]) if n.left: sort_contained_intervals(n.left) if n.right: sort_contained_intervals(n.right) class Node: d...
StarcoderdataPython
12866585
<filename>books/init_api.py from flask_restplus import Api API = Api( title="Book API", version='1.0', description="This Api provides endpoint for accessing books and their reviews." )
StarcoderdataPython
1739242
#!/usr/bin/env python # coding: utf-8 # In[ ]: get_ipython().run_line_magic('matplotlib', 'inline') import numpy as np import matplotlib.pyplot as plt # In[ ]: x = np.linspace(0, 2*np.pi, 1000) # In[ ]: y = 5.5 * np.cos(2*x) + 5.5 z = 0.02 * np.exp(x) w = 0.25 * x**2 + 0.1* np.sin(10*x) fig = plt.figure(fig...
StarcoderdataPython
5191503
import json import logging from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.views import password_reset from django.contrib.sites.models import Site from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ObjectDoesNotE...
StarcoderdataPython
9780418
''' @File : build_language_model.py @Author : <NAME> @Version : 1.0 @Contact : <EMAIL> @Desc : None ''' import numpy as np import jieba import math from load_data import * def build_one_gram_LM(): """ 利用训练集构建一元语法模型,并将模型保存在one_gram_likelihood.npy中 """ labels, texts = load_tsv_data(...
StarcoderdataPython
6524193
<reponame>bbengfort/memorandi # memoro.settings.development # Configuration for a development environment. # # Author: <NAME> <<EMAIL>> # Created: Sat Nov 28 16:40:07 2020 -0500 # # Copyright (C) 2020 Bengfort.com # For license information, see LICENSE # # ID: development.py [] <EMAIL> $ """ Configuration for a dev...
StarcoderdataPython
12831144
while True: n=input() if(n == 42): break else: print n
StarcoderdataPython
6410872
class Solution(object): def XXX(self, intervals): intervals.sort(key=lambda x : x[0] ) l=len(intervals) res=[] i=0 while i < l : if i==l-1 : res.append(intervals[i]) break while intervals[i][1]>=intervals[i+1][0] : ...
StarcoderdataPython
132398
<reponame>David29595/NUIG-Online-Timetable<gh_stars>0 from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout admin.autodiscover() urlpatterns = patterns('map.views', # url(r'^login/$', 'django_test.views.login'), ...
StarcoderdataPython
1660707
<filename>deprecated/simulation/sub8_montecarlo/montecarlo_tests/test_montecarlo_pd_controller.py #!/usr/bin/env python import sys import unittest import rospy import rostest from sub8_montecarlo_tools import VerifyController PKG = 'sub8_montecarlo' NAME = 'test_controller' class TestController(unittest.TestCase): ...
StarcoderdataPython
8001171
# import unittest # from app.models import source # class SourceTest(unittest.TestCase): # ''' # Test Class to tests if the methods/functions used return the expected result # ''' # def setUp(self): # ''' # Set up method that will run before every Test method # ''' # s...
StarcoderdataPython
3322536
<gh_stars>0 from django.db.models.signals import post_save, post_delete from django.core.files.storage import default_storage from django.dispatch import receiver from .models import Product, Catalog @receiver(post_save, sender=Product) def generate_product_id(sender, instance=None, **kwargs): if not instance or ...
StarcoderdataPython
1954162
import os if __name__ == '__main__': os.system("scrapy crawl weiboVipInfo")
StarcoderdataPython
4985388
<reponame>jmcollis/GitSavvy from .open_on_remote import * # from .commit import * from .configure import * # from .create_fork import * # from .add_fork_as_remote import * from .merge_request import *
StarcoderdataPython
261443
import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing process = cms.Process("SeedMultiplicity") #prepare options options = VarParsing.VarParsing("analysis") options.register ('globalTag', "DONOTEXIST", VarParsing.VarParsing.multiplicity.sing...
StarcoderdataPython
11294342
# ***************************************************************************** # Copyright (c) 2021, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions ...
StarcoderdataPython
3224463
import asyncio from collections.abc import Hashable import weakref class ResourceLock: """ Manage a set of locks for some set of hashable resources. """ _locks: 'weakref.WeakKeyDictionary[Hashable, asyncio.Lock]' def __init__(self) -> None: self._locks = weakref.WeakKeyDictionary() d...
StarcoderdataPython
187877
from .bundle import BazaarBundle
StarcoderdataPython
6646999
from PyQt5.QtCore import Qt from PyQt5 import QtCore, QtGui, QtWidgets """from PyQt4.QtCore import QRegExp, Qt from PyQt4.QtGui import QGridLayout, QDialog, QCheckBox, QPushButton, QLabel, QTextDocument, QLineEdit """ import re class FindReplaceDialog(QtWidgets.QDialog): def __init__(self, parent = None): super...
StarcoderdataPython
3489745
import numpy as np # ------------------------------------------------------------------------- def get_geom(): fname = 'geom.txt' print 'Reading:', fname f = open(fname, 'r') geom = [] for line in f: parts = line.split() if len(parts) == 2: r = float(parts[0]) ...
StarcoderdataPython
6424003
<reponame>hiyouga/cryptography-experiment import hashlib def vary_msg(m:str, d:int) -> list: mlist = [m] words = m.split(' ') r = len(words) - 1 counter = [(0, [0] * r)] while len(mlist) < d: k, count = counter.pop(0) for i in range(k, r): if len(mlist) == d: ...
StarcoderdataPython
38020
<reponame>Qi-max/amlearn import os import numpy as np import pandas as pd import matplotlib.pyplot as plt __author__ = "<NAME>" __email__ = "<EMAIL>" def column_hist(data, bins=None, density=True, fraction=True, save_figure_to_dir=None, save_data_to_dir=None, fmt=None, ylim=None, yscal...
StarcoderdataPython
6447796
<reponame>jjmrocha/liteDB import json import sqlite3 from typing import Dict, List, Tuple, Callable, Any, Iterable from litedb.erros import InvalidSchemaChange from litedb.model import Field class DB: def __init__(self, file_name: str): self.conn = sqlite3.connect(file_name) with self.conn: ...
StarcoderdataPython
12848555
# Generated by Django 3.0.14 on 2021-05-09 17:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tools', '0007_auto_20210429_1427'), ] operations = [ migrations.AlterField( model_name='tool', name='quantity', ...
StarcoderdataPython
5177408
""" Mini-Project Demo Group 2,68,71 """ from bs4 import BeautifulSoup import urllib3 redditFile = urllib3.connection_from_url("http://www.reddit.com") redditHtml = redditFile.read() redditFile.close() soup = BeautifulSoup(redditHtml) redditAll = soup.find_all("a") for links in soup.find_all('a'): ...
StarcoderdataPython
4901525
<gh_stars>0 # Copyright 2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
StarcoderdataPython
4997147
<reponame>AisinoPythonTeam/PythonAiniso<filename>ic_crawler/gsgj_phone/gsgj_phone/util/time_handler.py # -*- coding:utf-8 -*- import time def get_current_date(): currtime = time.localtime(time.time()) date = time.strftime('%Y-%m-%d',currtime) timer = time.strftime('%H:%M:%S') T = date + " " + timer ...
StarcoderdataPython
6481241
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #Description: Project in robotic and simulation 2020 # University Innsbruck #Author: <NAME> & <NAME> #Date: Created on Thu May 19 12:22:52 2020 #PYTHON version = 3.6.10 #EXUDYN version = 0.1.342 # # Copyright:This file is p...
StarcoderdataPython
4956385
<filename>amd64-linux/lib/python/simics_2_0_api.py from cli import * import sim_core from simics_2_2_api import * def SIM_object_by_id(id): return sim_core.OLD_object_by_id(id) def SIM_hap_install_callback(hap, cb, data): return sim_core.OLD_hap_install_callback(hap, cb, data) def SIM_hap_install_callback_i...
StarcoderdataPython
4877507
#!/usr/bin/env python from distutils.core import setup setup(name='Keras', version='0.0.1', description='Theano-based Deep Learning', author='<NAME>', author_email='<EMAIL>', url='https://github.com/fchollet/keras', license='MIT', packages=[ 'keras', 'keras.l...
StarcoderdataPython
228753
GRID_SIZE = 5 # Bingo numbers and grids. def get_b_and_g(lines): bingo_numbers = [] grids = [] is_first = True for line in lines: if is_first: bingo_numbers = [int(s) for s in line.split(",") if s.isdigit()] is_first = False continue if line == "": ...
StarcoderdataPython
3572566
<gh_stars>0 from datetime import timedelta from airflow import DAG from airflow.models import Variable from airflow.providers.docker.operators.docker import DockerOperator from airflow.utils.dates import days_ago HOST_DATA_DIR = Variable.get("HOST_DATA_DIR") default_args = { "owner": "airflow", "email": ["<...
StarcoderdataPython
3265237
<gh_stars>10-100 from Projectiles_drawable import Projectiles_Drawable def monkeyLetGo(monkey, space=False): print("monkeyLetGo") assert isinstance(monkey, Projectiles_Drawable) if space: filename = "static/images/spaceMonkeyLetGo.png" else: filename = "static/images/monkeyLetGo.png" ...
StarcoderdataPython
8126150
<filename>hackerearth/Algorithms/Special graphs/solution.py """ # Sample code to perform I/O: name = input() # Reading input from STDIN print('Hi, %s.' % name) # Writing output to STDOUT # Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail """ # Writ...
StarcoderdataPython
12818039
#!/usr/bin/python # Copyright (c) 2018, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for detail...
StarcoderdataPython