text
string
size
int64
token_count
int64
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
18,709
5,420
'Author: Aimore Resende Riquetti Dutra' '''email: aimorerrd@hotmail.com''' # -------------------------------------------------------------------------------------------------- # # This code can run 4 different models of Reinforcement Learning: # Q-Learning (QL), DQN, SRL (DSRL), SRL+CS(DSRL_object_near) and some ot...
68,069
23,881
import logging from typing import Tuple import bpy from mathutils import Vector from .object import get_objs logger = logging.getLogger(__name__) class SceneBoundingBox(): """Scene bounding box, build a bounding box that includes all objects except the excluded ones.""" ##################################...
4,273
1,138
# coding=utf-8 # Copyright 2019 The Tensor2Tensor 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 applicable...
38,887
13,527
""" WS-DAN models Hu et al., "See Better Before Looking Closer: Weakly Supervised Data Augmentation Network for Fine-Grained Visual Classification", arXiv:1901.09891 """ import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import models.resnet as resnet from models.incep...
9,421
3,190
#!/usr/bin/env python import mirheo as mir dt = 0.001 ranks = (1, 1, 1) domain = (8, 16, 8) force = (1.0, 0, 0) density = 4 u = mir.Mirheo(ranks, domain, dt, debug_level=3, log_filename='log', no_splash=True) pv = mir.ParticleVectors.ParticleVector('pv', mass = 1) ic = mir.InitialConditions.Uniform(number_densit...
1,526
716
#!/usr/bin/python # -*- coding: utf-8 -*- import abc import bs4 import functools import utilities class Error(Exception): """Base exception class that takes a message to display upon raising. """ def __init__(self, message=None): """Creates an instance of Error. :type message: str :param message: A...
3,765
1,196
"""p2 core http responses""" from wsgiref.util import FileWrapper from django.http import StreamingHttpResponse from p2.core.constants import ATTR_BLOB_MIME, ATTR_BLOB_SIZE_BYTES from p2.core.models import Blob class BlobResponse(StreamingHttpResponse): """Directly return blob's content. Optionally return as at...
624
209
# Generated by Django 3.0.6 on 2020-05-28 09:07 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('project_formfac', '0008_...
7,566
2,287
""" Data: Temperature and Salinity time series from SIO Scripps Pier Salinity: measured in PSU at the surface (~0.5m) and at depth (~5m) Temp: measured in degrees C at the surface (~0.5m) and at depth (~5m) - Timestamp included beginning in 1990 """ # imports import sys,os import pandas as pd import numpy as...
12,224
5,648
from collections import namedtuple as Struct from sklearn.model_selection import GroupShuffleSplit, ShuffleSplit DataSplitConfig = Struct('DataSplitConfig', ['validation_size', 'test_size', 'random_seed']) DEFAULT_SPLIT_CONFIG = DataSplitConfig(0.2, 0.2, 1337) class GroupDataSplit(): def __init__(self, df, key, ...
1,782
565
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import torch.nn as nn from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from .make_divisible import make_divisible class SELayer(BaseModule): """Squeeze-and-Excitation Module. Args: channels (int): The input (and output) ch...
2,989
910
from django.contrib import admin from .models import Images,Comments,Profile # Register your models here. class CommentInline(admin.TabularInline): model=Comments extra=3 class ImageInline(admin.ModelAdmin): fieldsets=[ (None,{'fields':['image']}), (None,{'fields':['image_name']}), ...
605
194
import numpy as np def normalize(x): return x / np.linalg.norm(x) def norm_sq(v): return np.dot(v,v) def norm(v): return np.linalg.norm(v) def get_sub_keys(v): if type(v) is not tuple and type(v) is not list: return [] return [k for k in v if type(k) is str] def to_vec3(v): if isinstance(v, (float, int)): ...
2,234
1,085
""" recognize face landmark """ import json import os import requests import numpy as np FACE_POINTS = list(range(0, 83)) JAW_POINTS = list(range(0, 19)) LEFT_EYE_POINTS = list(range(19, 29)) LEFT_BROW_POINTS = list(range(29, 37)) MOUTH_POINTS = list(range(37, 55)) NOSE_POINTS = list(range(55, 65)) RIGHT_EYE_POINTS =...
8,894
3,435
import requests import time from bs4 import BeautifulSoup import re def decdeg2dms(dd): negative = dd < 0 dd = abs(dd) minutes,seconds = divmod(dd*3600,60) degrees,minutes = divmod(minutes,60) if negative: if degrees > 0: degrees = -degrees elif minutes > 0: ...
1,646
602
"""Generated message classes for datacatalog version v1beta1. A fully managed and highly scalable data discovery and metadata management service. """ # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.protorpclite import messages as _messages from apitools.base.py import encoding ...
81,110
22,734
# Generated by Django 2.1.7 on 2019-04-22 21:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('materials', '0071_auto_20190416_1557'), ] operations = [ migrations.RemoveField( model_name='atomicpositions', name='idinfo_...
656
206
# -*- coding:utf-8 -*- # ------------------------ # written by Songjian Chen # 2018-10 # ------------------------ import os import skimage.io from skimage.color import rgb2gray import skimage.transform from scipy.io import loadmat import numpy as np import cv2 import math import warnings import random import torch imp...
5,054
1,805
fruit='banana' x=len(fruit) print(x)
38
20
# Generated by Django 3.1.7 on 2021-03-05 10:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recruiter', '0003_auto_20210304_2132'), ] operations = [ migrations.RemoveField( model_name='recruiter', name='middl...
689
231
''' Uses [[https://github.com/fabianonline/telegram_backup#readme][telegram_backup]] database for messages data ''' from pathlib import Path from textwrap import dedent from typing import Optional, Union, TypeVar from urllib.parse import unquote # TODO mm, make it easier to rememember to use... from ..common import P...
4,899
1,383
''' Created on Dec 27, 2019 @author: duane ''' DOLLAR = ord('$') LBRACE = ord('{') RBRACE = ord('}') LPAREN = ord('(') RPAREN = ord(')') class IStrFindResult(object): OK = 0 NOTFOUND = 1 SYNTAX = 2 def __init__(self): self.result = IStrFindResult.SYNTAX self.lhs = 0 self.rh...
6,407
2,198
#!/usr/bin/env python3 """ CLI for Accessing Deenis """ # Standard Imports import sys from pathlib import Path # Module Imports import click # Path Fixes working_dir = Path(__file__).resolve().parent sys.path.append(str(working_dir)) # Project Imports from deenis import Deenis @click.group( help=( "Deen...
7,712
2,271
# coding: utf-8 from bigone import BigOneDog from common import gen_logger import logging import time import json def strategy_eth_big_bnc_eth(dog): """ 正向:买BIG/ETH -> 卖BIG/BNC -> 买ETH/BNC 反向:卖ETH/BNC -> 买BIG/BNC -> 卖BIG/ETH :param dog: implemention of BigOneDog :return: 正向收益率,反向收益率 """ ...
5,383
2,535
import os import yaml import logging import importlib os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' logging.getLogger('tensorflow').disabled = True from cifar_training_tools import cifar_training, cifar_error_test def print_dict(d, tabs=0): tab = '\t' for key in d: if type(d[key]) == dict: pri...
1,191
433
#!/usr/bin/python import sys import yaml import json if __name__ == '__main__': content = json.load(sys.stdin) print yaml.dump(content, indent=2, default_flow_style=False)
179
67
# -*- coding: utf-8 -*- import os,sys from PyQt4 import QtGui,QtCore dataRoot = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir,os.pardir,'histdata')) sys.path.append(dataRoot) import dataCenter as dataCenter from data.mongodb.DataSourceMongodb import Mongodb import datetime as dt ...
1,542
486
from joblib import Parallel, delayed from tqdm import tqdm from .processing import map, filter, split, expand, combine, join from .manipulation import windowed, flatten class BaseTransformer: ''' The BaseTransformer defines a generic data transformation pattern that can be implemented with a number of da...
10,196
2,976
P, R = input().split() if P == '0': print('C') elif R == '0': print('B') else: print('A')
90
39
import pymongo import yaml import sched import time import json from castella import TweetCrawler class Castella(object): def __init__(self): # Get connection parameters with open("settings.yml", "r") as stream: try: settings = yaml.safe_load(stream)["settings"] ...
3,813
1,037
# # slice paddle model generator # import numpy as np from save_model import saveModel import paddle as pdpd import sys data_type = 'float32' def slice(name : str, x, axes : list, start : list, end : list): pdpd.enable_static() with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()): ...
1,275
487
# Copyright (C) 2021 Nippon Telegraph and Telephone Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE...
2,513
785
# compatibility module for different python versions import sys if sys.version_info[:2] > (3, 0): PY2 = False PY3 = True Bytes = bytes Unicode = str basestring = str class_type_name = 'class' ClassType = type exception_module = 'builtins' new_class = type self_name = '__self_...
719
237
import re import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.notification_type import NotificationType from helpers.event.event_test_creator import EventTestCreator from models.team import Team from models.notifications.match_score import MatchScoreNotification...
3,898
1,208
md_template_d144 = """verbosity=0 xcFunctional=PBE FDtype=4th [Mesh] nx=160 ny=80 nz=80 [Domain] ox=0. oy=0. oz=0. lx=42.4813 ly=21.2406 lz=21.2406 [Potentials] pseudopotential=pseudo.D_tm_pbe [Poisson] solver=@ max_steps_initial=@50 max_steps=@50 reset=@ bcx=periodic bcy=periodic bcz=periodic [Run] type=MD [MD] type=@...
5,406
2,605
#! /usr/bin/env python import copy from copy import deepcopy import rospy import threading import quaternion import numpy as np from geometry_msgs.msg import Point from visualization_msgs.msg import * from franka_interface import ArmInterface from panda_robot import PandaArm import matplotlib.pyplot as plt from scipy.s...
21,700
9,592
# Generated by Django 2.2.9 on 2020-01-28 14:50 import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("tests", "0009_auto_20200113_1239"), ] operations = [ migrations.AddField( model_name="modeltest", ...
483
165
""" Author: Mohammad Dehghani Ashkezari <mdehghan@uw.edu> Date: 2019-06-28 Function: Host a collection of shared multi-purpose helper functions. """ import os import sys from tqdm import tqdm from colorama import Fore, Back, Style, init import numpy as np import pandas as pd import webbrowser import I...
6,998
2,252
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: api/v3/api_proto/projects.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection f...
26,204
10,050
"""Testing Device operations.""" import json import unittest.mock as mock from click.testing import CliRunner import homeassistant_cli.cli as cli def test_device_list(default_devices) -> None: """Test Device List.""" with mock.patch( 'homeassistant_cli.remote.get_devices', return_value=default_devic...
2,207
617
from PyQt5.QtWidgets import QAction, QTreeWidget, QTreeWidgetItem, QFileDialog from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt import animations.general_animation as j3d from widgets.yaz0 import compress, compress_slow, compress_fast from io import BytesIO class tree_item(QTreeWidgetItem): def __init__(...
4,350
1,349
#Create the pre-defined song values and empty variables...Correct names not used so each starting letter would be unique numbers = (1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ) letters = ['a ','b ','c ','d ','e ','f ','g ','h ','i ','j ','k ','l ','m ','n ','o ','p ','q ','r '] roman = ['I ', 'II ...
3,445
1,335
# (c) 2012-2014 Continuum Analytics, Inc. / http://continuum.io # All Rights Reserved # # conda is distributed under the terms of the BSD 3-clause license. # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. import os from os.path import dirname, join, exists import unittest import pytest import con...
15,792
4,958
# Bert has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model, # by Alex Wang, Kyunghyun Cho, NeuralGen 2019 # https://colab.research.google.com/drive/1MxKZGtQ9SSBjTK5ArsZ5LKhkztzg52RV # https://arxiv.org/abs/1902.04094 import tensorflow as tf import tensorflow_probability as tfp import numpy as ...
3,579
1,293
""" [E] Given a sorted array, create a new array containing squares of all the number of the input array in the sorted order. Input: [-2, -1, 0, 2, 3] Output: [0, 1, 4, 4, 9] """ # Time: O(N) Space: O(n) def make_squares(arr): n = len(arr) squares = [0 for x in range(n)] highestSquareIdx = n - 1 left, r...
652
260
import os from azureml.pipeline.steps import PythonScriptStep from azureml.core.runconfig import RunConfiguration from azureml.core.conda_dependencies import CondaDependencies from azureml.pipeline.core import PipelineData from azureml.pipeline.core import PipelineParameter from azureml.pipeline.steps import EstimatorS...
1,917
554
import torch import argparse import os import sys import cv2 import time class Configuration(): def __init__(self): self.EXP_NAME = 'mobilenetv2_cfbi' self.DIR_ROOT = './' self.DIR_DATA = os.path.join(self.DIR_ROOT, 'datasets') self.DIR_DAVIS = os.path.join(self.DIR_DATA, 'DAVIS'...
4,806
2,079
#!/usr/bin/python2.4 import httplib, urllib, sys # Define the parameters for the POST request and encode them in # a URL-safe format. params = urllib.urlencode([ #('js_code', sys.argv[1]), ('code_url', 'https://raw.githubusercontent.com/kennytilton/MatrixJS/master/js/matrixjs/js/Matrix/Cells.js'), ('code...
968
324
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
4,551
1,500
# Copyright 2020 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
8,767
2,562
from couchdbkit import ResourceNotFound from tastypie import fields as tp_f from corehq.apps.api.resources import JsonResource from corehq.apps.api.resources.v0_1 import ( CustomResourceMeta, RequirePermissionAuthentication, ) from corehq.apps.api.util import get_object_or_not_exist from corehq.apps.fixtures.mo...
2,563
787
# -*- coding: utf-8 -*- """Define the cert_manager.domain.Domain unit tests.""" # Don't warn about things that happen as that is part of unit testing # pylint: disable=protected-access # pylint: disable=no-member import json from requests.exceptions import HTTPError from testtools import TestCase import responses f...
24,467
7,436
"""Text parts.""" SEPARATOR = '----------------------------------' CONT_GAME = 'enter для продолжения игры' GREETING = 'Добро пожаловать в игру ''Сундук сокровищ''!\n' \ 'Попробуй себя в роли капитана корабля, собери ' \ 'команду и достань все сокровища!' NAME_QUESTION = 'Как тебя зовут?' CHOO...
3,844
1,457
# Generated by Django 3.1.3 on 2021-01-07 00:42 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
3,587
1,036
import os import importlib class ControllerLoader: """ The ControllerLoader class. """ @staticmethod def load(directory, package): """ It is an utility to load automatically all the python module presents on a given directory """ for module in os.listdir(di...
737
191
from flask import Blueprint, Flask, send_from_directory from werkzeug.security import check_password_hash, generate_password_hash from app import db from app.mod_auth.forms import LoginForm from app.mod_auth.models import User mod_ecomm = Blueprint('products', __name__, url_prefix='/products', ...
601
191
from .functions import monitor_watchlist_action, manager with manager.get_dagr(): monitor_watchlist_action()
118
36
import pprint import logging from django.conf import settings from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from zenslackchat.message import handler from zenslackchat.models import SlackApp from zenslackchat.models import ZendeskApp class Eve...
2,739
778
# Copyright 2020 University Of Delhi. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
16,882
5,524
""" Here you find either new implemented modules or alternate implementations of already modules. This directory is intended to have a second implementation beside the main implementation to have a discussion which implementation to favor on the long run. """
262
54
''' Created on Mar 6, 2014 @author: tharanga ''' import unittest from time import sleep import EventService as es from EventService import WebSocketServer as ws from EventService import EventManager as em import socket from base64 import b64encode import struct import MySQLdb import json import EventService import fl...
14,801
5,561
import os import threading import time import unittest from OpenDrive.client_side import file_changes_json as c_json from OpenDrive.client_side import interface from OpenDrive.client_side import main from OpenDrive.client_side import paths as client_paths from OpenDrive.server_side import paths as server_paths from te...
1,945
633
import os import numpy as np from skimage import io, data_dir from skimage._shared import testing from skimage._shared.testing import assert_array_equal one_by_one_jpeg = ( b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01' b'\x00\x01\x00\x00\xff\xdb\x00C\x00\x03\x02\x02\x02\x02' b'\x02\x03\x02\x02...
1,850
1,048
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import numpy as np from unittest import TestCase from core.feature_extraction.galaxy.galaxy_processor import GalaxyProcessor from commons.helpers.dataset.strategies.galaxy_dataset.label_strategy import GalaxyDataSetLabelStrategy from commons.helpers.dataset.conte...
1,369
410
from django.conf import settings from django.core.management import call_command from django.core.management.base import BaseCommand from os import path class Command(BaseCommand): help = "Populates data" def handle(self, *args, **options): fixture_path = path.join(path.dirname( path.dirn...
559
160
"""Registry utilities to handle formats for gmso Topology.""" class UnsupportedFileFormatError(Exception): """Exception to be raised whenever the file loading or saving is not supported.""" class Registry: """A registry to incorporate a callable with a file extension.""" def __init__(self): sel...
1,630
424
dosyaadi = input("Enter file name: ") dosyaadi = str(dosyaadi + ".txt") with open(dosyaadi, 'r') as file : dosyaicerigi = file.read() silinecek = str(input("Enter the text that you wish to delete: ")) dosyaicerigi = dosyaicerigi.replace(silinecek, '') with open(dosyaadi, 'w') as file: file.write(dosyai...
417
177
import tensorflow as tf @tf.function def BinaryAccuracy_Infiltrates(y_true, y_pred, i=0): return tf.keras.metrics.binary_accuracy(y_true[:, i], y_pred[:, i]) @tf.function def BinaryAccuracy_Pneumonia(y_true, y_pred, i=1): return tf.keras.metrics.binary_accuracy(y_true[:, i], y_pred[:, i]) @tf.function def...
6,106
2,065
import re import json import time import sys import httplib2 from twitter import * import magic class TwitterMediaDL: http = httplib2.Http(".cache") baseUrl = "https://twitter.com" consumer_key = "" consumer_secret = "" access_token_key = "" access_token_secret = "" t = Twitter(auth=OAu...
3,528
1,180
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
6,185
1,855
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
9,133
2,366
#!/usr/bin/env python # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
14,091
4,441
# -*- coding: utf-8 -*- import sys import urllib import urlparse # import xbmc import xbmcgui import xbmcplugin import aci # Get the plugin url in plugin:// notation. _url = sys.argv[0] # Get the plugin handle as an integer number. _handle = int(sys.argv[1]) # Get an instance of ACI. ATV = aci.ACI() ATV.load_aci()...
9,999
2,905
# Copyright (c) 2020, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import logging from coremltools.converters.mil.input_types import ( InputType, TensorType, ...
17,151
5,052
#!/usr/bin/env python # Copyright (c) 2016 Clay Wells # # A Python-based link checker. # # Usage: pylinkcheck.py -r https://www.example.com # # By default, we can spider and check all of the links found at the URL's # domain. For example, a check of https://foo.example.com will only check # links with the base URL ...
4,420
1,505
import logging from abc import abstractmethod import abc import six from collections import deque from moto.dynamodb2.parsing.ast_nodes import ( UpdateExpression, UpdateExpressionSetClause, UpdateExpressionSetActions, UpdateExpressionSetAction, UpdateExpressionRemoveActions, UpdateExpressionRem...
34,975
9,337
# -*- coding: utf-8 -*- """The graphical part of a DFTB+ Optimization node""" import logging import tkinter as tk import tkinter.ttk as ttk import dftbplus_step logger = logging.getLogger(__name__) class TkOptimization(dftbplus_step.TkEnergy): def __init__( self, tk_flowchart=None, nod...
5,332
1,523
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Módulo de configuração dos consoles """ from Crypto.PublicKey import RSA import socket import os import base64 class Console(object): """Superclasse Console Classe base para os terminais de cliente e servidor. Attributes: ...
7,000
2,177
""" Django settings for marion project. """ from pathlib import Path from tempfile import mkdtemp from configurations import Configuration, values BASE_DIR = Path(__file__).parent.resolve() DATA_DIR = Path("/data") # pylint: disable=no-init class Base(Configuration): """ This is the base configuration ever...
4,988
1,472
# # 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"); you may not us...
3,512
970
# Generated by Django 3.0.3 on 2020-02-07 19:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coingate', '0003_auto_20200207_1513'), ] operations = [ migrations.RemoveField( model_name='payment', name='token', ...
2,032
644
import toml from flask import Flask from flask_sqlalchemy import SQLAlchemy app = Flask(__name__, instance_relative_config=True) app.config.from_file("config.toml", load=toml.load) db = SQLAlchemy(app) @app.before_first_request def create_table(): db.create_all() from space_trace import views, cli
309
110
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import logging from enum import Enum from .NormalDist import NormalDist from .UniformDist import UniformDist class Distribution(Enum): UNIFORM = 0 GAUSSIAN = 1 POISSON = 2 @staticmethod def determine_distribution(distribution, distribution_params): ...
1,388
348
import os import sys filename = sys.argv[1] from_id = int(sys.argv[2]) to_id = int(sys.argv[2]) for i in range(from_id, to_id + 1): sys.system("mv {0}.in{1} {0}{1}.in".format(filename, i)) sys.system("mv {0}.out{1} {0}{1}.out".format(filename, i))
258
115
from django.urls import path from . import views urlpatterns = [ path('apply/', views.FillPassApplication, name='transit-pass-application-form'), path('application-details/<int:appln_id>', views.DisplayApplicationToken, name='application-details'), path('view-application-list/', views.DisplayApplication...
668
191
import dash from dash.dependencies import Input, Output import dash_html_components as html import dash_core_components as dcc app = dash.Dash(__name__) app.layout = html.Div([ dcc.Textarea( id='textarea-example', value='Textarea content initialized\nwith multiple lines of text', style={'w...
683
221
import pytest from selenium.common.exceptions import WebDriverException from wrapped_driver import WrappedDriver def test_empty_chromedriver_path(): """Assert error is raised if no chromedriver path is used""" with pytest.raises(WebDriverException): WrappedDriver(executable_path="", headless=True) ...
490
145
from rlp.sedes import ( CountableList, ) from eth.rlp.headers import ( BlockHeader, ) from eth.vm.forks.byzantium.blocks import ( ByzantiumBlock, ) from .transactions import ( PetersburgTransaction, ) class PetersburgBlock(ByzantiumBlock): transaction_builder = PetersburgTransaction fields = ...
470
143
# Copyright 2020 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, s...
5,107
1,538
""" transforms.py is for shape-preserving functions. """ import numpy as np def shift(values: np.ndarray, periods: int, axis: int, fill_value) -> np.ndarray: new_values = values if periods == 0 or values.size == 0: return new_values.copy() # make sure array sent to np.roll is c_con...
963
342
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext as _ class Group(models.Model): """ Group model """ title = models.CharField(max_length=256, blank=False, verbose_name=_('Name')) leader = models.OneToOneField( 'Student', v...
789
248
from abc import ABCMeta, abstractmethod from frontegg.helpers.frontegg_urls import frontegg_urls import typing import jwt import requests from frontegg.helpers.logger import logger from jwt import InvalidTokenError class IdentityClientMixin(metaclass=ABCMeta): __publicKey = None @property @abstractmethod...
2,319
642
# coding: utf-8 # Copyright © 2021 Splunk, 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 at # # [http://www.apache.org/licenses/LICENSE-2.0] # # Unless required by applicable law or agre...
7,534
2,190
from flask import Blueprint home_bp = Blueprint('home', __name__) from . import views # noqa
97
33
#!/usr/bin/env python3 import requests import subprocess import smtplib import re import os import tempfile def download(url): get_response = requests.get(url) file_name = url.split("/")[-1] with open(file_name, "wb") as f: f.write(get_response.content) def send_mail(email, password, message): ...
786
282
from SmartAPI.rdf.List import List class LinkedList(List): def __init__(self): List.__init__(self)
113
38
################################################################################################## # Copyright (c) 2012 Brett Dixon # # 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 r...
13,974
4,068
# uncompyle6 version 3.2.0 # Python bytecode 2.4 (62061) # Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] # Embedded file name: pirates.speedchat.PSpeedChatQuestMenu from otp.speedchat.SCMenu import SCMenu from otp.speedchat.SCTerminal import * from otp.speedchat....
2,232
775
# from redbot.core import Config from redbot.core import Config, commands, checks import asyncio import aiohttp import discord from discord import Webhook, AsyncWebhookAdapter import re class Spotifyembed(commands.Cog): """Automatically send a reply to Spotify links with a link to the embed preview. Convenient for...
5,309
1,520