id
stringlengths
1
8
text
stringlengths
6
1.05M
dataset_id
stringclasses
1 value
182005
<reponame>s3q/andrunlook-apy<filename>andr.py import requests import os import sys import uuid class api: def __init__(self): self.API = "http://localhost:8800/" def savePublicProgress(self, aid, pin): try: data = {"aid": aid, "pin": pin} req = requests.post(f"{self.A...
StarcoderdataPython
11246375
import logging from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.exceptions import ModbusException from python_utilities import utilities def handle_response_error(response, request=None): if hasattr(response, "registers"): return error = f"Modbus Response {response}" ...
StarcoderdataPython
278841
""" byceps.services.user.log_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 <NAME> :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from datetime import datetime from typing import Optional from sqlalchemy import select from ...database import db from ......
StarcoderdataPython
11263604
<filename>ROS/service_client.py #!/usr/bin/env python3 import rospy from word_count.srv import WordCount import sys # le damos un nombre al node rospy.init_node('service_client') rospy.wait_for_service('word_count') word_counter = rospy.ServiceProxy('word_count', WordCount) words = ' '.join(sys.argv[1:]) word_count =...
StarcoderdataPython
8146190
# Generated by Django 2.0.6 on 2018-10-30 01:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('news', '0005_article_user'), ] operations = [ migrations.RemoveField( model_name='comment', name='comdate', ...
StarcoderdataPython
1776499
class PageNotFoundException(Exception): ...
StarcoderdataPython
190892
# name='sopel_modules.idlerpg', # version='0.1.0', # description='A rewrite of the original IdleRPG to work as a module for Sopel. It incorporates some of the features of Shocky\'s IdleRPG system, though is much more in-depth.', # long_description=readme + '\n\n' + history, # author='<NAME>', # ...
StarcoderdataPython
4957399
import sys # 参考: http://w.livedoor.jp/met-python/d/matplotlib import numpy as np import matplotlib.pyplot as plt import formula if __name__ == '__main__': if len(sys.argv) < 2: rate = 2 else: rate = int(sys.argv[1]) print('rate =', rate) print() # n_blocks * block = slot # n_...
StarcoderdataPython
12816581
''' Author: <NAME> (@mirmirik) Twitter API'sine bağlanıp, belirli bir tweet'i RT edenleri takipten çıkarmak ya da bloklamak için yazılmış deneme / sandbox kodu. myTwitter.cfg dosyası içine ilgili değerlerin eklenmesi gerekmektedir. Konfigürasyon dosyası değerleri: [auth] ACCOUNT = <bilgilerine erişilecek size...
StarcoderdataPython
6589034
version = __version__ = "0.1.4"
StarcoderdataPython
3423246
<reponame>sakshigupta87/ml_algo_prac<filename>bar.py #!/usr/bin/python3 import matplotlib.pyplot as plt y=[200,40,60,59] x=["sam","om","anu","eva"] y1=[30,50,67,89] x1=["ss","oo","aa","ee"] plt.xlabel("time") plt.ylabel("distance") #plt.bar(x,y, c='y') #plt.bar(x1,y1, c='r') #pltscale(to set scale) plt.bar(x,y,label="r...
StarcoderdataPython
4940397
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
StarcoderdataPython
3475725
<reponame>TechPenguineer/Python-Exercises # What will the output of this be? name = input("What is your name? \n") upperCaseName = name.upper(); print(f"HELLO, {upperCaseName}!")
StarcoderdataPython
3434390
<gh_stars>100-1000 #!/usr/bin/env python3 # The MIT License # Copyright (c) 2016 Estonian Information System Authority (RIA), Population Register Centre (VRK) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
StarcoderdataPython
1617439
<filename>zstacklib/zstacklib/utils/concurrentlog_handler.py # Copyright 2013 <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 # # Unl...
StarcoderdataPython
5017088
import json from tkinter import PhotoImage, Tk from classes import ( CalculatableItem, Field, MainFrame, Manager, Resulter, ResultsFrame ) # Creation of calculatable items with open("items.json") as file_with_items: items = json.load(file_with_items) cs_calculatable_items = [] for cross_se...
StarcoderdataPython
176460
<reponame>stastnypremysl/ftputil # Copyright (C) 2006-2018, <NAME> <<EMAIL>> # and ftputil contributors (see `doc/contributors.txt`) # See the file LICENSE for licensing terms. """ ftp_stat_cache.py - cache for (l)stat data """ import time import ftputil.error import ftputil.lrucache # This module shouldn't be use...
StarcoderdataPython
3540459
import copy import itertools import os import os.path as osp import shutil from collections import OrderedDict from xml.dom.minidom import Document import detectron2.utils.comm as comm import torch from detectron2.evaluation import COCOEvaluator from detectron2.utils.file_io import PathManager from .table_evaluation....
StarcoderdataPython
6702595
from .cleaner import Cleaner from .capitalizationcleaner import CapitalizationCleaner from .characterencodingcleaner import CharacterEncodingCleaner from .diacriticcleaner import DiacriticCleaner from .emoticoncleaner import EmoticonCleaner from .hashtagcleaner import HashtagClener from .htmlcleaner import HtmlCleaner ...
StarcoderdataPython
5066308
<gh_stars>0 #!/usr/bin/env python import sqlite3 def generate_sqlite(csv_path, sqlite_path): with open(csv_path, 'rb') as f: data = f.read().decode('utf8') db = sqlite3.connect(sqlite_path) cursor = db.cursor() cursor.execute('CREATE TABLE resource_types (pid TEXT NOT NULL UNIQUE, resource_type...
StarcoderdataPython
3360470
# -*- coding: utf8 -*- from django.contrib.sites.models import Site from django.test import TestCase import factory from .models import Family, Name, Person, PersonFamily # pylint: disable=no-member class NameFactory(factory.django.DjangoModelFactory): class Meta: model = Name name = factory.Seque...
StarcoderdataPython
3290883
<filename>tests/test_args_opts/conftest.py # pylint: disable = redefined-outer-name, protected-access import inspect import pytest from arger import Arger, Argument from arger.docstring import ParamDocTp from arger.main import FlagsGenerator @pytest.fixture def param_doc(hlp=''): return ParamDocTp.init('', hlp...
StarcoderdataPython
1912732
<gh_stars>100-1000 # # Copyright (C) 2020 GreenWaves Technologies # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
StarcoderdataPython
9649746
<filename>piexif/_transplant.py<gh_stars>1000+ import io from ._common import * def transplant(exif_src, image, new_file=None): """ py:function:: piexif.transplant(filename1, filename2) Transplant exif from filename1 to filename2. :param str filename1: JPEG :param str filename2: JPEG """ ...
StarcoderdataPython
5027134
# Python 3.6.1 with open("input.txt", "r") as f: puzzle_input = [int(i) for i in f.read()[0:-1]] total = 0 puzzle_inputc = len(puzzle_input) // 2 for cur_index in range(len(puzzle_input)): current = puzzle_input[cur_index] pnext = puzzle_input[(cur_index + puzzle_input) % len(puzzle_input)] if curren...
StarcoderdataPython
265027
import datetime from decimal import Decimal from django.db import models from django.contrib.auth.models import User from django.utils import timezone from .signals import user_matches_update from .utils import calculate_match from django.contrib.auth.signals import user_logged_in from django.dispatch import receive...
StarcoderdataPython
5105434
cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_available = cars - drivers carpool = drivers * space_in_a_car average_passengers_per_car = passengers / drivers print "There are", cars, "cars available." print "There are only", drivers, "drivers available." print "There will be", cars_available, "cars...
StarcoderdataPython
11340572
# -*- coding: utf-8 -*- ################################################################################# ## Copyright (c) 2018-Present Webkul Software Pvt. Ltd. (<https://webkul.com/>) # You should have received a copy of the License along with this program. # If not, see <https://store.webkul.com/license.htm...
StarcoderdataPython
3392153
<reponame>BaldFish-Tong/push_weather<filename>main.py from push_weather.info import info from push_weather.Crawling_Weather import crawling_weather from push_weather.Send_Message import send_message if __name__ == '__main__': send_message(crawling_weather(info))
StarcoderdataPython
11270890
"""delete column seen Revision ID: c28b6d5e6c4c Revises: Create Date: 2020-11-05 06:07:06.334130 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c28b6d5e6c4c' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands aut...
StarcoderdataPython
11222965
<reponame>LS80/script.module.pyrollbar<filename>lib/rollbar/kodi/__init__.py import json import platform import xbmc import xbmcaddon import xbmcgui import rollbar addon = xbmcaddon.Addon('script.module.pyrollbar') def _kodi_version(): query = dict(jsonrpc='2.0', method='Application.GetProper...
StarcoderdataPython
1879260
<reponame>gloriousDan/recipe-scrapers from recipe_scrapers.whatsgabycooking import WhatsGabyCooking from tests import ScraperTest class TestWhatsGabyCookingScraper(ScraperTest): scraper_class = WhatsGabyCooking def test_host(self): self.assertEqual("whatsgabycooking.com", self.harvester_class.host()...
StarcoderdataPython
4809603
# coding: utf-8 from __future__ import print_function, unicode_literals import mock import time import threading import json import unittest2 import pdb import logging import logtail from logtail.formatter import LogtailFormatter from logtail.helpers import LogtailContext class TestLogtailFormatter(unittest2.TestCas...
StarcoderdataPython
6533616
<gh_stars>0 import random import csv # The Feminism plen name was changed because of an error in the gsheet plen = ["China and Africa's New Era", "Cryptocurrencies: Friend or Foe?", "Drug Legalization in a Progressive World", "The Global Food Crisis", "The Future of Feminism", "Nuclear Weapons: Obsolete or the Future...
StarcoderdataPython
1890147
import csv import urllib2 import json import datetime import re from bs4 import BeautifulSoup from bs4 import NavigableString from bs4 import Tag ## Loops through team list, gets links for all teams player_table = [] current_player_table = [] errors =[] alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m',...
StarcoderdataPython
11205610
<reponame>dungdinhanh/mmselfsup # Copyright (c) OpenMMLab. All rights reserved. import os import os.path as osp import platform import shutil import time import warnings import torch import mmcv from mmcv.runner.base_runner import BaseRunner from mmcv.runner.epoch_based_runner import EpochBasedRunner from mmcv.runner...
StarcoderdataPython
11212240
from analysis.convert_analysis_files_to_kgtk_edge import KGTKAnalysis from argparse import ArgumentParser if __name__ == '__main__': parser = ArgumentParser() parser.add_argument('-f', '--folder', action='store', dest='folder_path', help="folder where all files will be created") ...
StarcoderdataPython
8009210
<gh_stars>0 import os, sys if len(sys.argv) < 2: print('Usage: prepare.py <prefix> <new>') exit() prefix = sys.argv[1] new = sys.argv[2] files = os.listdir() for f in files: if f.startswith(prefix): name = f.replace(prefix,new) try: os.rename(f, name) except Exception: print('Failed...
StarcoderdataPython
3522135
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: """ import os import sys sys.path.append('..') from dialogbot import Bot from dialogbot.utils.io import save_json, load_json from dialogbot.utils.log import logger class BotServer: def __init__(self, cache_path='cache.json'): self.bot = B...
StarcoderdataPython
8093995
<gh_stars>1-10 import json import pandas as pd import numpy as np import re from textblob import TextBlob import nltk nltk.download('wordnet') nltk.download('omw-1.4') from nltk.corpus import wordnet as wn nltk.download('stopwords') from nltk.corpus import stopwords class DbSearch: def __init__(self,country,fund...
StarcoderdataPython
3207558
<gh_stars>0 #!/usr/bin/env python import rospy from nav_msgs.msg import Odometry from EmeraldAI.Logic.Singleton import Singleton from EmeraldAI.Config.Config import Config if(Config().Get("Database", "WiFiFingerprintDatabaseType").lower() == "sqlite"): from EmeraldAI.Logic.Database.SQlite3 import SQlite3 as db eli...
StarcoderdataPython
12832003
from model import YOLOv1 import torch import torch.nn as nn class YOLOv1Loss(nn.Module): def __init__(self, S=7, B=2, C=20): """ __init__ initialize YOLOv1 Loss. Args: S (int, optional): split_size. Defaults to 7. B (int, optional): number of boxes. Defaults to 2. ...
StarcoderdataPython
101448
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2019 Wuhan PS-Micro Technology Co., Itd. # # 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.apach...
StarcoderdataPython
1846470
#! /usr/bin/env python # License: Apache 2.0. See LICENSE file in root directory. # # For simple behaviors that can run syncronously, Python provides # a simple way to implement this. Add the work of your behavior # in the execute_cb callback # import rospy import actionlib import behavior_common.msg import time imp...
StarcoderdataPython
3338449
import os # --- ID:s --- PROJECT_ID = 'project_id' FOLDER_ID = 'folder_id' CAMERA_ID = 'camera_id' CLIP_ID = 'clip_id' FILTER_ID = 'filter_id' PROGRESS_ID = 'progress_id' # --- Text --- PROJECT_NAME = 'project_name' CLIP_NAME = 'clip_name' # --- OS related --- FILE_PATH = 'file_path' # --- Objects --- PROJECTS = 'p...
StarcoderdataPython
4905934
AUTHOR = '<NAME>' AUTHOR_EMAIL = '<EMAIL>' NAME = 'tiddlywebplugins.sqlalchemy3' DESCRIPTION = 'sqlalchemy store for tiddlyweb' VERSION = '3.1.1' # make sure you update in __init__ too import os from setuptools import setup, find_packages # You should carefully review the below (install_requires especially). setup...
StarcoderdataPython
11275619
#!/usr/bin/env python import unittest from pycoin.ecdsa import generator_secp256k1, sign, verify, public_pair_for_secret_exponent class ECDSATestCase(unittest.TestCase): def test_sign_verify(self): def do_test(secret_exponent, val_list): public_point = public_pair_for_secret_exponent(generat...
StarcoderdataPython
393710
# Copyright 2020 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Tool for generating markdown documentation for a test. """ import difflib from pathlib import Path from typing import IO, List from types_ import CompatT...
StarcoderdataPython
326385
<gh_stars>10-100 """ Test the manager a little bit. """ import sys try: from StringIO import StringIO except ImportError: from io import StringIO from .fixtures import reset_textstore from tiddlyweb import __version__ from tiddlyweb.config import config from tiddlyweb.manage import handle from tiddlyweb.stor...
StarcoderdataPython
8196622
<gh_stars>1-10 #<NAME> 2018 from Tkinter import * from math import * master = Tk() master.title('Multiplication Animation') def placeCoordinates(): x=0.0 y=0.0 for z in range(360): x = 500 + scale.get() * sin((z*pi)/180) #Converting Degrees to Radians y = 430 + scale.get() * cos((z*pi)/180...
StarcoderdataPython
3301503
# Some components are reused in each app. Put here for easier code readability import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc def make_navbar(active=0): classnames = ['', '', ''] classnames[active] = "active" navbar = dbc.NavbarSi...
StarcoderdataPython
8085560
<gh_stars>1-10 # coding: utf-8 """ Honeywell Home No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F40...
StarcoderdataPython
9626669
'''helpers docstring''' import collections def onset(f): """Return the 1-set as list of integers, DC not allowed""" ret = [] for term in list(f.satisfy_all()): ordered = collections.OrderedDict(reversed(sorted(term.items()))) literals = list(ordered.values()) tmp_str = '' ...
StarcoderdataPython
9727381
<reponame>soheltarir/grpc-django<gh_stars>10-100 from django.core.exceptions import ObjectDoesNotExist from grpc_django.interfaces import rpc from grpc_django.views import RetrieveGRPCView, ServerStreamGRPCView from tests.grpc_codegen.test_pb2 import User USERS = [{ "id": 1, "name": "<NAME>", ...
StarcoderdataPython
396580
<filename>part7/44.py import json def make_new_dictionary(products_list): new_dictionary = {} for item in products_list: new_dictionary[item["name"]] = [item["price"], item["quantity"]] return new_dictionary def main(): messages = { "product": "\nWhat is the product name? ", ...
StarcoderdataPython
3553058
<filename>prisprob.py from Prisoner import Prisoner from Box import Box import random def main(): # Initializing list of prisonors list_of_prisoners = [] for n in range(100): list_of_prisoners.append(Prisoner(n)) # Initializing list of boxes list_of_boxes = [] # to set up what is insi...
StarcoderdataPython
6493281
<gh_stars>1-10 from .SLearner import SLearner from .TLearner import TLearner from .XLearner import XLearner
StarcoderdataPython
1638960
<reponame>SergeyShurkhovetckii/Best-Current_Python_telegram_bot<filename>bot.py import config #Конфинурация для Telegram Bot import requests # Модуль для обработки URL from bs4 import BeautifulSoup as BS # Модуль для работы с HTML import time # Модуль для остановки программы import telebot import emoji #Смайлики from...
StarcoderdataPython
8056010
#!/usr/bin/env python # -*- coding: UTF-8 -*- import math # from random import uniform, randint import pygame # from enum import Enum import time import rospy from sensor_msgs.msg import PointCloud2 import sensor_msgs.point_cloud2 as pc2 # 定义全局变量:地图中节点的像素大小 CELL_WIDTH = 25 # 单元格宽度 CELL_HEIGHT = 25 # 单元格长度 BORDER_WI...
StarcoderdataPython
6668257
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS INC # # 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 ...
StarcoderdataPython
8160518
"""Script to make a master catalog of 2D material thicknesses Usage: - Set in_file (line ) to file location of the npz catalog for desired material/substrate. - Set out_file (line ) for how to save the master catalog for desired material/substrate. - Set layers_id (line ) to the number...
StarcoderdataPython
1649041
from django.conf.urls import url, include from material.frontend import urls as frontend_urls from . import views, tinder, resume_upload, resume_retrieval, take_picture urlpatterns = [ url(r'^review/(?P<idx>[0-9]+)/', tinder.review_page, name='review_page'), url(r'^review', tinder.review_page, name='review_p...
StarcoderdataPython
9691195
<filename>src/bitcaster/utils/tests/factories.py import datetime import os import random from contextlib import ContextDecorator from random import choice import factory import pytz from django.contrib.auth.models import Group, Permission from factory.base import FactoryMetaClass from factory.fuzzy import FuzzyDateTim...
StarcoderdataPython
6519650
"""Analyse persistent homology statistics wrt. their expressivity.""" import argparse import numpy as np import pandas as pd from sklearn.metrics.pairwise import euclidean_distances if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('INPUT') parser.add_argument( ...
StarcoderdataPython
269099
<filename>packages/augur-core/tests/reporting/test_rep_oracle.py from eth_tester.exceptions import TransactionFailed from utils import longToHexString, nullAddress, stringToBytes from pytest import raises import codecs import functools from old_eth_utils import sha3 def test_rep_oracle(contractsFixture, augur, cash, m...
StarcoderdataPython
6507197
<reponame>esynr3z/CorSaiR #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Demostration of Register API """ import copy from corsair import BitField, Register, config # create csr_cnt = Register('CNT', 'Counter for some events', 0x10) # access to the attributes csr_cnt.address = 0 print("%s.address = 0x%x" % (csr...
StarcoderdataPython
8054798
<gh_stars>1-10 from setuptools import setup, find_packages import conv1d_text_vae long_description = ''' conv1d-text-vae ============ The Conv1D-Text-VAE is a special convolutional VAE (variational autoencoder) for the text generation and the text semantic hashing. This package with the sklearn-like interface, and it...
StarcoderdataPython
6593806
from .manager import Manager from .entity import Entity from .motion import Motion from .group import Group import numpy as np import random class EntityGroup(Group): """An entity group is a group of entities. Entity specific features are added.""" @staticmethod def getCollided(group1, group2): ...
StarcoderdataPython
8130463
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Tutorial 9: Basic Shading """ from __future__ import print_function from OpenGL.GL import * from OpenGL.GL.ARB import * from OpenGL.GLU import * from OpenGL.GLUT import * from OpenGL.GLUT.special import * from OpenGL.GL.shaders import * from glew_wish im...
StarcoderdataPython
12864002
import time from datetime import datetime import pytest from pnp.plugins.pull import StopPollingError from pnp.plugins.pull.simple import CustomPolling from . import make_runner, start_runner @pytest.mark.asyncio async def test_poll(): events = [] def callback(plugin, payload): events.append(payload...
StarcoderdataPython
67754
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
StarcoderdataPython
1699094
import numpy as np import rospy import time import sys import pymap3d as pm import numba as nb from lib_ta_py.controller_2D_TA import Controller from pkg_ta.msg import Control from pkg_ta.msg import State_EKF_2D from sensor_msgs.msg import NavSatFix from sensor_msgs.msg import Imu yawc_compass = - np.pi/2 # Reference ...
StarcoderdataPython
11269139
from __future__ import absolute_import from .models import * from .session import * from .exceptions import * from .chat import * __all__ = [models.__all__ + session.__all__ + exceptions.__all__ + chat.__all__] __author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '0.9.3'
StarcoderdataPython
3351142
<gh_stars>1-10 # MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020 # # 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 lim...
StarcoderdataPython
6612254
<gh_stars>1-10 import spectrum_functions import unittest import numpy as np class SpectrumFunctionsTest(unittest.TestCase): def test2DSpecX(self): '''an error is raised if check_spectrum is given a 2D x input''' x = np.arange(10).reshape((2, 5)) y = np.arange(10) with self.asse...
StarcoderdataPython
1778527
<gh_stars>0 import re from math import inf from heapq import heappush, heappop from typing import List, Any def create_cave(depth: int, tx: int, ty: int) -> List[List[int]]: """ Creates the cave according to the cave generation rules. Since the cave is essentially infinite a constant size padding is appl...
StarcoderdataPython
6525596
from account import Account import sqlite3 accounts = {} data_path = "accounts.db" active_account = None con = sqlite3.connect(data_path) c = con.cursor() undr = 50 def check_for_accounts(): global accounts try: c.execute( """CREATE TABLE IF NOT EXISTS accounts( name TEXT, ...
StarcoderdataPython
388719
<reponame>louwenjjr/nplinker<filename>prototype/nplinker/nplinker.py # Copyright 2021 The NPLinker Authors # # 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/licen...
StarcoderdataPython
8114239
#!/usr/bin/env python3 import os import pickle import sys def main(): if 'DATA_ROOT' not in os.environ: print( 'Set the DATA_ROOT environment variable to the parent dir of the inria_holidays ' 'directory.') sys.exit(1) data_root = os.environ['DATA_ROOT'] with open(...
StarcoderdataPython
51061
from math import sqrt from numpy import * import numpy as np import sys from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import NMF from sklearn.decomposition import PCA from sklearn.decomposition import TruncatedSVD from ...
StarcoderdataPython
378386
# Generated by Django 3.1.2 on 2021-03-26 08:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0053_auto_20210326_0416'), ] operations = [ migrations.AlterField( model_name='movie', name='title', ...
StarcoderdataPython
11201899
<gh_stars>1-10 from dataclasses import dataclass from datetime import date, datetime from typing import Any, Optional from .base import ZGWModel from .catalogi import Eigenschap from .constants import RolOmschrijving, RolTypes, VertrouwelijkheidsAanduidingen @dataclass class Zaak(ZGWModel): url: str identifi...
StarcoderdataPython
4942554
<gh_stars>0 """ __author__ = "<NAME> and <NAME>" Main -Capture the config file -Process the json config passed -Create an agent instance -Run the agent """ import argparse from utils.logger import setup_logging from configs.default import update_config from configs import config from agents import...
StarcoderdataPython
212118
<gh_stars>0 import torch import numpy as np import torch_geometric.datasets from ogb.graphproppred import PygGraphPropPredDataset from ogb.lsc.pcqm4m_pyg import PygPCQM4MDataset import pyximport from torch_geometric.data import InMemoryDataset, download_url import pandas as pd from sklearn import preprocessing pyximpo...
StarcoderdataPython
11200927
import numpy as np from adventofcode.util.input_helpers import get_input_for_day data = get_input_for_day(2021, 5) segments = np.array( [[pair.split(",") for pair in line.split(" -> ")] for line in data] ).astype(int) xmax = segments[:, :, 0].max() ymax = segments[:, :, 1].max() class Line: def __init__(se...
StarcoderdataPython
6521479
""" This module contains unit tests of single_peer_satisfaction_neutral(). """ import copy from typing import List, NamedTuple import pytest from scenario import Scenario from engine import Engine import performance_candidates from ..__init__ import SCENARIO_SAMPLE, ENGINE_SAMPLE # The arrange helper function needed...
StarcoderdataPython
1693170
<filename>cleverhans/attacks/fast_feature_adversaries.py """ The FastFeatureAdversaries attack """ # pylint: disable=missing-docstring import warnings import numpy as np import tensorflow as tf from cleverhans.attacks.attack import Attack from cleverhans.compat import reduce_sum from cleverhans.model import Model fro...
StarcoderdataPython
1785230
from PIL import Image from DDRDataTypes import DDRScreenshot, DDRParsedData from IIDXDataTypes import IIDXScreenshot, IIDXParsedData import sys, requests, io, os if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: DDRGenie.py [path to screenshot image file]") exit(0) sshot = Image.op...
StarcoderdataPython
3394292
<gh_stars>0 import tweepy, json, time CONSUMER_KEY = '' CONSUMER_SECRET = '' ACCESS_KEY = '' ACCESS_SECRET = '' AUTH = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) AUTH.set_access_token(ACCESS_KEY, ACCESS_SECRET) API = tweepy.API(AUTH, wait_on_rate_limit=True, wait_on_rate_limit_notify=True) # TODO: Tune virali...
StarcoderdataPython
6411662
from django.db import models from django.conf import settings #from language.views_common import yesterday import datetime ## Acquisition of yesterday, correctly def yesterday(): return datetime.datetime.now() - datetime.timedelta(days = 1) class Sentence(models.Model): number = models.IntegerField('Number', defau...
StarcoderdataPython
3369999
__all__ = ["graphic", "play", "sound"] from . import graphic from . import play from . import sound
StarcoderdataPython
6491183
<reponame>huuhoa/adaptivecards<gh_stars>1-10 import json class PropertyType: def __init__(self, type, key_name=None): self.key_name = key_name self.type = type def __get__(self, instance, owner): return instance.get_data(self.key_name) def __set__(self, instance, value): ...
StarcoderdataPython
1979676
<reponame>LeoIV/sparse-ho import pytest import numpy as np from scipy.sparse import csc_matrix from sklearn import linear_model from sklearn.model_selection import KFold import celer from celer.datasets import make_correlated_data from sparse_ho.utils import Monitor from sparse_ho.models import Lasso from sparse_ho.cr...
StarcoderdataPython
1653784
from ._pymimkl import * # importing wrapped models from .average_mkl import AverageMKL from .easy_mkl import EasyMKL from .umkl_knn import UMKLKNN # cleanup unused objects del(EasyMKL_) del(UMKLKNN_) del(AverageMKL_)
StarcoderdataPython
215261
# -*- coding: utf-8 -*- """ Created on Sat Feb 29 09:54:51 2020 @author: bruger """
StarcoderdataPython
356951
<reponame>yingstat/SingleCellOpenProblems<filename>test/utils/name.py import parameterized def object_name(x): """Get a human readable name for an object.""" if hasattr(x, "__name__"): return x.__name__ elif hasattr(x, "__func__"): return object_name(x.__func__) else: return st...
StarcoderdataPython
1716713
<reponame>detrout/htsworkflow import argparse import RDF import jinja2 from pprint import pprint from htsworkflow.util.rdfhelp import \ get_model, \ get_serializer, \ sparql_query, \ libraryOntology, \ load_into_model from htsworkflow.util.rdfns import * TYPE_N = rdfNS['type'] CREATION_DATE = ...
StarcoderdataPython
1642372
<gh_stars>1-10 """ input: - a fasta file with all sequences used for all-by-all blast - a file with all the unfiltered results from all-by-all blastn or blastp Currently assume that query and hit are the same direction Ignore hits from the same taxa Check for ends that doesn't have any hits in any other taxa output: ...
StarcoderdataPython
11262013
# -*- coding: utf-8 -*- class PoetFileError(Exception): pass class MissingElement(PoetFileError): def __init__(self, element): super(MissingElement, self).__init__( 'The poetry.toml file is missing the [{}] element'.format(element) ) class InvalidElement(PoetFileError): ...
StarcoderdataPython
9654155
<gh_stars>0 #!/usr/bin/env python """resinOS version distribution plot Display the resinOS versions as time series, based on the fleet score data record. """ from datetime import datetime import numpy import xlrd import semver import matplotlib.pyplot as plt import matplotlib.dates as mdates MC_VERSION = ">=2.12.0" ...
StarcoderdataPython