id
stringlengths
2
8
text
stringlengths
16
264k
dataset_id
stringclasses
1 value
5154983
<reponame>maykinmedia/bluebottle import json from django.test import TestCase from django.core.urlresolvers import reverse from bluebottle.test.factory_models.projects import ( ProjectFactory, ProjectThemeFactory, ProjectPhaseFactory) from bluebottle.test.factory_models.accounts import BlueBottleUserFactory f...
StarcoderdataPython
87349
<reponame>bmanzella/zhuartcc.org<gh_stars>1-10 from django.contrib import admin from .models import Event, EventPosition, PositionPreset, EventPositionRequest, EventScore @admin.register(Event) class EventAdmin(admin.ModelAdmin): list_display = ('name', 'host', 'start', 'end', 'hidden') @admin.register(EventPos...
StarcoderdataPython
1967264
from rover import turn, move, Position, Plateau, Rover, parse, World, main import pytest def test_turn_left(): assert turn('N', 'L') == 'W' assert turn('W', 'L') == 'S' assert turn('S', 'L') == 'E' assert turn('E', 'L') == 'N' def test_turn_right(): assert turn('N', 'R') == 'E' assert...
StarcoderdataPython
1932803
<filename>boilerplate/helpers/enterinteractivemode.py ''' Created on Jul 9, 2018 @author: havrila ''' def interactive(): import code code.interact(local=locals())
StarcoderdataPython
245640
<filename>yakut/enum_param.py # Copyright (c) 2020 OpenCyphal # This software is distributed under the terms of the MIT License. # Author: <NAME> <<EMAIL>> import enum import typing import click class EnumParam(click.Choice): """ A parameter that allows the user to select one of the enum options. The sel...
StarcoderdataPython
11280252
# -*- coding: utf-8 -*- """<div> template""" from ..environment import env div = env.from_string("""\ <div {% if align -%} align="{{ align }}" {% endif -%}> {%- if text -%} {{ text }} {%- endif -%}</div> """)
StarcoderdataPython
8063727
# -*- coding: utf-8 -*- # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
StarcoderdataPython
11302733
import os import sys from Bio import SeqIO from Bio.Seq import Seq def main(*args, **kwargs): fpath = os.path.join(os.getcwd(), args[-1]) records = list(SeqIO.parse(fpath,'fasta')) s = str(records[0].seq) t = str(records[1].seq) idxs = [] idx = 0 for m in t: idx = s.find(m,idx) ...
StarcoderdataPython
1905831
<reponame>neuron-ai/easyneuron from io import BufferedReader, BufferedWriter from typing import (Any, Iterable, List, Sequence, Set, Sized, SupportsFloat, SupportsInt, Tuple, Union) from numpy import (float16, float32, float64, int0, int8, int16, int32, int64, ndarray) # Numeric...
StarcoderdataPython
9682545
from typing import * import numpy as np from ..typing_ import * from .misc import generate_random_seed __all__ = [ 'get_array_shape', 'to_number_or_numpy', 'minibatch_slices_iterator', 'arrays_minibatch_iterator', 'split_numpy_arrays', 'split_numpy_array', ] def get_array_shape(arr) -> ArrayShape: """ ...
StarcoderdataPython
196
# -*- encoding:utf-8 -*- # @Time : 2021/1/3 15:15 # @Author : gfjiang import os.path as osp import mmcv import numpy as np import cvtools import matplotlib.pyplot as plt import cv2.cv2 as cv from functools import partial import torch import math from cvtools.utils.path import add_prefix_filename_suffix from mmdet....
StarcoderdataPython
1850535
""" Tested with: Python 3.7.7 scikit-learn==0.24.2 """ import json import joblib from sklearn import svm from sklearn import datasets classes = {"0": "Setosa", "1": "Versicolour", "2": "Virginica" } clf = svm.SVC(gamma='scale', probability=True) iris = datasets.load_iris() X, y = iris.data, iris.target clf.fit(X, y)...
StarcoderdataPython
1951025
from pwn import * import angr import claripy import tqdm from .simgr_helper import get_trimmed_input import logging import copy log = logging.getLogger(__name__) # Better symbolic strlen def get_max_strlen(state, value): i = 0 for c in value.chop(8): # Chop by byte i += 1 if not state.solver....
StarcoderdataPython
11300555
<gh_stars>1-10 # Import tensorflow with correct log level import inceptionkeynet __log_levels = { 'DEBUG': '0', 'INFO': '1', 'WARNING': '2' } if inceptionkeynet.TERMINAL_LOG_LEVEL in __log_levels: import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = __log_levels[inceptionkeynet.TERMINAL_LOG_LEVEL] import tens...
StarcoderdataPython
1845781
# Copyright 2019 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
StarcoderdataPython
3490927
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 from math import isclose import numpy as np import pytest from emukit.quadrature.kernels.integration_measures import IsotropicGaussianMeasure, UniformMeasure REL_TOL = 1e-5 ABS_TOL = 1e-4 def test_unif...
StarcoderdataPython
273832
#!/usr/bin/env python import asyncio import enum import logging import signal from collections import defaultdict import evdev import pyudev REMAPPED_PREFIX = '[remapped]' class AlreadyRemappedError(Exception): pass class VirtualModifierState(enum.Enum): RELEASED = enum.auto() PRESSED_SILENT = enum.a...
StarcoderdataPython
1781890
<reponame>sjhonatan/pentesting<filename>wifiDeauth.py #!/usr/bin/python #for python 2.7 from subprocess import check_output,call import time try: from scapy.all import * except: print "Installation of scapy is necessary" print "Ip addres of target" ipTarget = ... print "Ip addres of router" router = ... print...
StarcoderdataPython
57520
<reponame>momentoscope/hextofloader """ This module implements the flash data preprocessing class. The raw hdf5 data is saved into parquet files and loaded as a pandas dataframe. The class attributes are inherited by dataframeReader - a wrapper class. """ import os from typing import cast from pathlib import Path from...
StarcoderdataPython
4903951
import codecs from collections import defaultdict import torch from allennlp.common import Params from allennlp.data import Vocabulary from allennlp.modules.token_embedders.token_embedder import TokenEmbedder @TokenEmbedder.register("sentence_embedding") class SentenceEmbedding(TokenEmbedder): """ Embedd...
StarcoderdataPython
214253
<gh_stars>0 import re from datetime import datetime from flask import abort, current_app from flask_login import current_user from dmapiclient import APIError try: import urlparse except ImportError: import urllib.parse as urlparse def get_drafts(apiclient, framework_slug): try: drafts = apiclie...
StarcoderdataPython
1857354
from __future__ import annotations from dataclasses import dataclass import numpy as np import matplotlib as mpl from seaborn._marks.base import ( Mark, Mappable, MappableBool, MappableFloat, MappableString, MappableColor, MappableStyle, resolve_properties, resolve_color, ) from t...
StarcoderdataPython
3388311
<filename>imperfecto/misc/utils.py """ A collection of helper functions and classes. """ from enum import Enum import os import numpy as np def run_web(config: dict) -> None: """Run the express server. Args: config: a dictionary containing the configuration for the express server """ command...
StarcoderdataPython
277141
<reponame>SophieHerbst/mne-bids """Utility functions to copy raw data files. When writing BIDS datasets, we often move and/or rename raw data files. several original data formats have properties that restrict such operations. That is, moving/renaming raw data files naively might lead to broken files, for example due t...
StarcoderdataPython
5060372
<reponame>DavidLlorens/algoritmia<gh_stars>1-10 from algoritmia.semirings.interfaces import IIdempotentSemiRing class _FuzzySemiRing(IIdempotentSemiRing): zero = property(lambda self: 0.0) one = property(lambda self: 1.0) def plus(self, left, right): return max(left, right) def times(self, left, ...
StarcoderdataPython
4842435
from modelLib import * from trainUtils import * from keras.models import load_model import customLoss as cl import metrics as m import keras import keras.backend as K # suprresing tensorflow messages import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' configTF = tf.ConfigProto() configTF.gpu_options.allow...
StarcoderdataPython
6400322
l1 = [1 , 2, 3] l2 = [4 , 5, 6] print(l1 , l2) l2.insert(0, 4) #inserir no indice 0 o valor 4 l2.append(5) #adicionar valor ao final l3 = l1 + l2 #concatenar l1.extend(l2) #concatenar print(l3) print(l1) l4 = [ 5 , 6, 7, 8, 9] del(l4[:2]) print(l4) l4.pop() #remover ultimo print(l4) l5= list(range(1,10)) #transform...
StarcoderdataPython
3454984
from AccessControl import ClassSecurityInfo import csv from DateTime.DateTime import DateTime from Products.Archetypes.event import ObjectInitializedEvent from Products.CMFCore.WorkflowCore import WorkflowException from bika.lims import bikaMessageFactory as _ from bika.lims.browser import ulocalized_time from bika.lim...
StarcoderdataPython
3444077
<reponame>imranq2/SparkAutoMapper.FHIR from typing import Optional from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime from spark_auto_mapper_fhir.fhir_types.string import FhirString class BaseExtensionItem(ExtensionBase): ...
StarcoderdataPython
3434963
from django.test import TestCase from accounts.models import UserProfile from django.contrib.auth.models import User from django.urls import reverse class TestPost(TestCase): @classmethod def setUpTestData(cls): test_user = User(username='test_user', email='<EMAIL>', ...
StarcoderdataPython
1907678
#----------------------------------------------------------------------------- """ MIMXRT-1020-EVK Evaluation Kit (i.MX RT1020) SoC: NXP PIMXRT1021DAG5A SDRAM: ISSI IS42S16160J-6TLI CODEC: Cirrus Logic WM8960G Ethernet Phy: Microchip KSZ8081 """ #----------------------------------------------------------------------...
StarcoderdataPython
1721008
import math import numpy as np import matplotlib.pyplot as plt import numerical_solvers as ns '''General functions for formatting, printing and plotting output''' def PrintHeader(): '''Prints header information''' #TODO: (Extend and edit as you see fit to help you debug your methods) print("x \t EXACT ...
StarcoderdataPython
9703875
<filename>utils/sso.py<gh_stars>10-100 # -*- coding: utf-8 -*- import json from urllib import urlencode from urllib2 import urlopen from functools import wraps from urlparse import urlparse, parse_qs from flask import redirect, request, session, jsonify, abort from modules import Admin, Cluster, Msg def logout(uesr):...
StarcoderdataPython
3491661
<gh_stars>10-100 import numpy as np from visual_dynamics.utils import transformations as tf from visual_dynamics.spaces import Space class AxisAngleSpace(Space): """ SO(3) space where the rotation is represented as an axis-angle vector in R^3 where its magnitude is constrained within an interval and the ...
StarcoderdataPython
12838179
<filename>lab1/abstractFactory.py '''Define Abstract Factory''' from abc import ABCMeta, abstractmethod class Snack: pass class Beer: pass class Beer(metaclass=ABCMeta): @abstractmethod def interact(self, snack: Snack): pass class Snack(metaclass=ABCMeta): @abstractmethod def interact(self, beer: Beer): p...
StarcoderdataPython
9729583
import json import time import torch import random import numpy as np import pandas as pd from tqdm import trange import torch.nn.init as init from torch.nn import Parameter import torch.nn.functional as F from utils import calculate_auc, setup_features from sklearn.model_selection import train_test_split from signedsa...
StarcoderdataPython
5164940
<filename>src/apps/profiles/migrations/0011_auto_20200824_2337.py # Generated by Django 3.0.9 on 2020-08-24 23:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipes', '0015_ingredient_notes'), ('profiles', '0010_auto_20200817_1355'), ] ...
StarcoderdataPython
3225594
<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License")...
StarcoderdataPython
9607763
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The ``nti.testing`` module exposes the most commonly used API from the submodules (for example, ``nti.testing.is_true`` is just an alias for ``nti.testing.matchers.is_true``). The submodules may contain other functions, though, so be sure to look at their documentation....
StarcoderdataPython
1898935
from collections import defaultdict import pytest from transformers import AutoTokenizer, T5ForConditionalGeneration, DataCollatorForSeq2Seq, T5Config from datasets import load_dataset, set_caching_enabled, Dataset from promptsource.templates import DatasetTemplates from src.preprocessors import ThreeChoiceEntailmentP...
StarcoderdataPython
11263271
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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/licenses/LICENSE-2.0 # # Unless required by ...
StarcoderdataPython
5103808
<filename>metadata-etl/src/main/resources/jython/OwnerTransform.py # # Copyright 2015 LinkedIn Corp. 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...
StarcoderdataPython
3260797
<gh_stars>0 import seis_database vp_db = seis_database.VpDb() vp_db.delete_table_vp() vp_db.delete_table_vp_files() vp_db.delete_table_vaps() vp_db.delete_table_vaps_files()
StarcoderdataPython
3491326
<reponame>pierky/mrtparse #!/usr/bin/env python ''' slice.py - This script slices MRT format data. Copyright (C) 2016 greenHippo, LLC. 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://ww...
StarcoderdataPython
5083917
# coding=utf-8 import json from ... import options as opts from ...charts.chart import Chart from ...commons.types import List, Numeric, Optional, Sequence, Union from ...commons.utils import produce_js_func from ...datasets import COORDINATES from ...globals import ChartType, TooltipFormatterType class G...
StarcoderdataPython
11384940
from bs4 import BeautifulSoup import requests import webbrowser def getDeals(cat,page): dealsList=[] url="https://www.hotukdeals.com/{}?page={}".format(cat,page) soup = BeautifulSoup(requests.get(url).content,"html5lib") deals = soup.find_all("article") for deal in deals: if "thread--...
StarcoderdataPython
1697243
<reponame>cstein/neb import copy import numpy import atom import bond import angle class Molecule(object): """ A molecule. A molecule is at the minimum a collection of atoms. The molecule class can also be asked to identify all bonds. This can be quite costly since we use a brute force a...
StarcoderdataPython
190060
<reponame>LegitStack/knot from .config import get, put, env, project_path
StarcoderdataPython
3282677
"""Illustrate a "three way join" - where a primary table joins to a remote table via an association table, but then the primary table also needs to refer to some columns in the remote table directly. E.g.:: first.first_id -> second.first_id second.other_id --> partitioned.other_id ...
StarcoderdataPython
8024352
<gh_stars>0 #!/usr/bin/env python3 # # Author: <NAME> # License: BSD 2-clause # Last Change: Mon Aug 16, 2021 at 06:04 PM +0200 import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True # Don't hijack argparse! ROOT.PyConfig.DisableRootLogon = True # Don't read .rootlogon.py from argparse import ArgumentParser from...
StarcoderdataPython
9685779
""" Fixer for method.__X__ -> method.im_X """ from lib2to3 import fixer_base from lib2to3.fixer_util import Name MAP = { "__func__" : "im_func", "__self__" : "im_self" # Fortunately, im_self.__class__ == im_class in 2.5. } class FixMethodattrs(fixer_base.BaseFix): PATTERN = """ power< any+ tr...
StarcoderdataPython
1672931
""" This module contains submodules for generating the sampling grid coordinates on which to propagate the acoustic field. """ __all__ = [ 'abstract_sampler', 'clist_sampler', 'hexagonal_sampler', 'lambert_sampler', 'rectilinear_sampler' ]
StarcoderdataPython
1735263
# -*- coding: utf-8 -*- from django.contrib import admin from . import models # Register your models here. class ProjectsInLine(admin.TabularInline): # inherits from Tabular inline so Projects can appear as a table on the user page model = models.Project extra = 0 @admin.register(models.Profile) class Pr...
StarcoderdataPython
3254792
<reponame>jeffersonraimon/Programming-UFBA E, P =input().split() E = int(E) P = int(P) cont = E - P contador = 1 contadorP = P - 1 if contadorP > 0: while cont > 0: cont = cont - contadorP contador = contador + 1 if contadorP <= 0: print("F") break contador...
StarcoderdataPython
5091380
<filename>r/pandas.py import copy from rpy2.robjects import pandas2ri, numpy2ri import rpy2.robjects.conversion as conversion from rpy2.robjects import r OTHER_DEFAULT_CONVERSIONS = { # R (str) : Python type "NULL": type(None), } def automatic_pandas_conversion(**other_conversions): """Automatically co...
StarcoderdataPython
1941780
<filename>pincer/commands.py # Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from __future__ import annotations import logging import re from asyncio import iscoroutinefunction, gather from copy import deepcopy from inspect import Signature, isasyncgenfunction from ty...
StarcoderdataPython
5094039
import json from tests.TestingSuite import BaseTestingSuite class TestUsersResource(BaseTestingSuite): def setUp(self): print('Testing Users resources...') super().setUp() self.user_payload = json.dumps({ "email": "<EMAIL>", "password": "password" }) ...
StarcoderdataPython
9671689
<filename>kluctl/utils/env_config_sets.py import os import re def parse_env_config_sets(prefix): r = re.compile(r"%s_(\d+)_(.*)" % prefix) r2 = re.compile(r"%s_(.*)" % prefix) ret = {} for env_name, env_value in os.environ.items(): m = r.fullmatch(env_name) if m: idx = m.g...
StarcoderdataPython
6513832
<reponame>victorvasil93/flask-ask import logging import os import re from six.moves.urllib.request import urlopen from flask import Flask from flask_ask import Ask, request, session, question, statement app = Flask(__name__) ask = Ask(app, "/") logging.getLogger('flask_ask').setLevel(logging.DEBUG) # URL prefix t...
StarcoderdataPython
1680162
<filename>app/mqtt_handler.py<gh_stars>1-10 import logging import time from queue import SimpleQueue import paho.mqtt.client as mqtt class MQTTHandler(object): def __init__(self, mqtt_broker_host, mqtt_broker_port=1883): self.logger = logging.getLogger("mqtt.client") self.mqtt_broker_host = mqtt_...
StarcoderdataPython
4862115
# TODO: Missing script docstring. How should this script be run? What is this for? # ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license in...
StarcoderdataPython
8096675
<filename>main.py<gh_stars>0 from flask import Flask,redirect,render_template,request,url_for, session,jsonify from datetime import datetime from flask import send_file import undetected_chromedriver as uc from selenium.webdriver.common.by import By import time import os import glob from selenium.webdriver.support.ui i...
StarcoderdataPython
6535810
<gh_stars>100-1000 #!/usr/bin/env python """ A simple logging module that logs to the console and a logfile, and has a configurable threshold loglevel for each of console and logfile output. Use it this way: import anuga.utilities.log as log # configure my logging log.console_logging_level = log.INFO ...
StarcoderdataPython
1906767
# coding=utf-8 import datetime import logging import scrapy from shop.items import ShopItem logger = logging.getLogger('mycustomlogger') class Megadrop24Spider(scrapy.Spider): name = 'megadrop24.ru' base_url = 'https://megadrop24.ru' search = '/search/page%d?query=%s&minprice=1&maxprice=20000&submit=' ...
StarcoderdataPython
150294
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-01-07 00:36 # IMPORTANT: This file was renamed on purpose to keep the same naming as release/python3, TODO: Check conflicts from __future__ import unicode_literals import django.core.files.storage from django.db import migrations, models import djangoplicit...
StarcoderdataPython
1854797
<reponame>ThePokerFaCcCe/myblog from drf_spectacular.utils import OpenApiExample, OpenApiParameter from rest_framework import serializers from core.schema_helper import (schema_generator, RESPONSE_DEFAULT_RETRIEVE, PAGINATION_DEFAULT, RESPONSE_DEFAULT_PAG...
StarcoderdataPython
3534509
#coding: utf-8 from pandas import Series, DataFrame import pandas as pd import numpy as np import sys df = pd.read_csv('ex1.csv') print(df) df_read_table = pd.read_table('ex1.csv', sep=',') print(df_read_table) nohead_csv = pd.read_csv('no_head_csv.csv', header=None) print(nohead_csv) nohead_csv = pd.read_csv( ...
StarcoderdataPython
1698723
<filename>plato/processors/compress.py """ Implements a Processor for compressing a numpy array. """ from typing import Any import zstd from plato.processors import base class Processor(base.Processor): """ Implements a Processor for compressing numpy array. """ def __init__(self, cr=1, **kwargs) -> None: ...
StarcoderdataPython
4837174
<filename>simpleGame.py # Simple game in python import time while True:#infinite loop print('Hi, welcome to the Tim quiz!') time.sleep(0.5) print('Try to get as many questions correct as possible...') time.sleep(0.5) totalQuestions = 4 score = 0 ans = input('1. What is the nam...
StarcoderdataPython
164441
<reponame>Rabbit1010/TensorFlow2.0-Tutorial-2019 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Dec 23 17:11:08 2019 @author: Wei-Hsiang, Shen """ import matplotlib.pyplot as plt import tensorflow as tf import time from GAN_model import Generator_Model, Discriminator_Model from data_generator impo...
StarcoderdataPython
349436
#!/usr/bin/env python import rospy import sys import os import math import csv from nav_msgs.msg import Odometry from std_msgs.msg import Int64 from geometry_msgs.msg import PoseStamped car_name = str(sys.argv[1]) pkg_path = str(sys.argv[2]) trajectory_name = str(sys.argv[3]) plan = [] min_index_pub ...
StarcoderdataPython
6593553
cont = cont2 = cont4 = cont5 = 0 cont3 = 16 times = ['Atlético-MG', 'Flamengo', 'Palmeiras', 'Fortaleza', 'Corinthians', 'Bragrantino', 'Fluminense', 'América-MG', 'Atlético-GO', 'Santos', 'Ceará', 'Internacional', 'São Paulo', 'Athletico-PR', 'Cuiabá', 'Juventude', 'Grêmio', 'Bahia', 'Sport', 'Chapecoense'] print('Tab...
StarcoderdataPython
6533181
import os import tensorflow as tf tf.logging.set_verbosity(tf.logging.INFO) def create_folder(location): if not os.path.exists(location): os.makedirs(location) def get_session_config(): config = tf.ConfigProto( allow_soft_placement=True, log_device_placement=False ) config.gp...
StarcoderdataPython
6514314
""" Example of how to use the ray tune library to perform hyperparameter sweeps on the Proximal Policy Optimization (PPO) algorithm. """ import argparse from functools import partial import numpy as np import pandas as pd from ray import tune from ray.tune import Analysis, CLIReporter from ray.tune.schedulers import ...
StarcoderdataPython
3289596
from distutils.core import setup setup( name='py-synology', version='0.5.1', packages=['synology'], url='https://github.com/metronidazole/py-synology', license='MIT', author='snjoetw, metronidazole', author_email='', description='Python API for Synology Surveillance Station (DSM7)', ...
StarcoderdataPython
8110931
<gh_stars>1-10 ############################################################################## ## Copyright (C) 1999-2006 Michigan State University ## ## Based on work Copyright (C) 1993-2003 California Institute of Technology ## ## ...
StarcoderdataPython
5128725
<reponame>benspaulding/django-shortwave from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^shortwave/', include('shortwave.urls')), )
StarcoderdataPython
1680471
<gh_stars>10-100 from ...base import * from .transform import TransformMixin class SelectionMixin: """ GeomDataObject class mix-in """ def __setstate__(self, state): self._poly_selection_data = {"selected": [], "unselected": []} self._selected_subobj_ids = {"vert": [], "edge": [], "poly": []...
StarcoderdataPython
6494588
<filename>AS2SegsMapper.py import sys import logging from argparse import ArgumentParser, RawTextHelpFormatter from lib.Seg2EventMapper import generateEventsSegsIOE description = \ "Description:\n\n" + \ "This subcommand Maps alternative splicing events to their respective " + \ "inclusion/...
StarcoderdataPython
1736542
#!/usr/bin/env python3 # # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. ...
StarcoderdataPython
3278470
import re from rest_framework import generics from rest_framework import permissions from rest_framework import exceptions from rest_framework import status from rest_framework.response import Response from django.shortcuts import get_object_or_404 from django.contrib.auth.models import User from django.db.models imp...
StarcoderdataPython
338429
<reponame>dadosabertossergipe/querido-diario<filename>data_collection/gazette/spiders/rs_porto_alegre.py import datetime as dt import dateparser from dateutil.rrule import MONTHLY, rrule from gazette.items import Gazette from gazette.spiders.base import BaseGazetteSpider class RsPortoAlegreSpider(BaseGazetteSpider)...
StarcoderdataPython
11265294
__author__ = 'jie' TOEHOLD_LENGTH = 5 from cadnano.cnproxy import UndoCommand from strandrep.toehold_list import ToeholdList from strandrep.toehold import Toehold class CreateToeholdCommand(UndoCommand): ''' called by Domain to create toehold on an end of an oligo; can be undone if added to undo stack befor...
StarcoderdataPython
6505836
<gh_stars>1000+ # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptio...
StarcoderdataPython
1861583
import csv from math import sqrt from paraview import servermanager from paraview.simple import * YIELD_STRENGTH = 1.6e8 def get_mean_component(array, component_index): array_length = array.GetNumberOfTuples() return sum(array.GetComponent(i, component_index) for i in range(array_length)) / array...
StarcoderdataPython
9660854
<reponame>EdinburghGenomics/hesiod<filename>hesiod_version.py #!/usr/bin/env python3 from hesiod import hesiod_version print("{}".format(hesiod_version))
StarcoderdataPython
271997
from util import hash_util import hashlib class Verification: @classmethod def validate_j_chain(cls, chain): for (index, block) in enumerate(chain): if index > 0: if block.previous_hash != hash_util.hash_block(chain[index - 1]): print("Die chain wurde g...
StarcoderdataPython
8127415
# 4. Write a python program that deletes a car from the server using the API. import requests import json url = 'http://127.0.0.1:5000/cars/08%20c%201234' response = requests.delete(url) print(response.status_code) print(response.text)
StarcoderdataPython
12803815
""" This file provides a single interface to unittest objects for our tests while supporting python < 2.7 via unittest2. If you need something from the unittest namespace it should be imported here from the relevant module and then imported into your test from here """ # Import python libs import os import sys # sup...
StarcoderdataPython
126251
<filename>setup.py<gh_stars>0 from setuptools import find_packages, setup setup(name='sacred_logs', version='0.2.0', install_requires=['click', 'matplotlib', 'pandas'], packages=find_packages(), entry_points=""" [console_scripts] sacredlogs=sacred_logs.cli:cli """)
StarcoderdataPython
8122347
import sys import traceback import discord from bot.utils import wrap_in_code from discord.ext import commands ignored_errors = ( commands.CommandNotFound, commands.DisabledCommand, commands.NotOwner, ) error_types = ( (commands.CommandOnCooldown, "Cooldown"), (commands.UserInputError, "Bad input...
StarcoderdataPython
8138126
<filename>stix2elevator/test/test_main.py # Standard Library from argparse import Namespace import io import os # external import pytest from stix.core import STIXPackage import stixmarx # internal from stix2elevator import elevate, options from stix2elevator.options import ( ElevatorOptions, get_option_value, in...
StarcoderdataPython
6554234
<reponame>Hephaest/DoubanCrawler import requests, json from selenium import common from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from PIL import Image import time class LoginCracker: def __init__(self, usern...
StarcoderdataPython
3480018
<gh_stars>1-10 ############################################################################### # # Exceptions - A class for XlsxWriter exceptions. # # Copyright 2013-2019, <NAME>, <EMAIL> # class XlsxWriterException(Exception): """Base exception for XlsxWriter.""" class XlsxInputError(XlsxWriterException): ...
StarcoderdataPython
1759163
<filename>alfirt.opencv/src/algorithms/SURFFlannMatchingAlgorithm.py<gh_stars>1-10 ''' Created on Sep 9, 2011 @author: Ankhazam & Piotr & OpenCV team ''' from algorithms.AlgorithmBase import AlgorithmBase import classification.SURFFlannMatcher as SFM import classification.TrainedObject as TO import image.ImageDescript...
StarcoderdataPython
11230155
from .upload import UploadImporter from .vandy import VandyImporter available_importers = { cls.__name__: cls for cls in [ UploadImporter, VandyImporter, ] }
StarcoderdataPython
13178
<filename>2808.py def conv(s): if s[0] == 'a': v = '1' elif s[0] == 'b': v = '2' elif s[0] == 'c': v = '3' elif s[0] == 'd': v = '4' elif s[0] == 'e': v = '5' elif s[0] == 'f': v = '6' elif s[0] == 'g': v = '7' elif s[0] == 'h': v = '8' v += s[1] return v e = str(input()).split(...
StarcoderdataPython
8030330
from hermes.core.attributes import set_encoder from hermes.language import Language from hermes.tag.pos import PartOfSpeech import hermes.types as htypes """ Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. ...
StarcoderdataPython
395727
from collections import defaultdict, Counter import csv import random import json from nltk.metrics import agreement # constants HITID = "HITId" LABEL = "Answer.political bias.label" WORKERID = "WorkerId" WORKTIME = "WorkTimeInSeconds" APPROVE = "Approve" TEXT = "Input.text" sample_path = "amt_output_csv/abortion_batc...
StarcoderdataPython
4993683
<reponame>mihailoz/python-term-project # -*- coding: utf-8 -*- import dao.ReservationDAO as ReservationDAO import manager.PermissionManager as PermissionManager import manager.HotelManager as HotelManager import manager.RoomManager as RoomManager import dao.HotelDAO as HotelDAO def make_reservation(person): if ...
StarcoderdataPython